fix: Disable code signing to avoid Windows symlink errors
- Add signAndEditExecutable: false to skip code signing on Windows - Clear electron-builder winCodeSign cache before build - Add helpful error messages for symlink permission issues The winCodeSign package contains macOS symlinks that fail to extract on Windows without admin privileges or Developer Mode enabled. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -239,6 +239,13 @@ function Build-Electron {
|
||||
Write-Warn "已建立 .env,請確認設定"
|
||||
}
|
||||
|
||||
# 清理可能損壞的 electron-builder 快取(解決 symlink 問題)
|
||||
$ebCache = Join-Path $env:LOCALAPPDATA "electron-builder\Cache\winCodeSign"
|
||||
if (Test-Path $ebCache) {
|
||||
Write-Host " 清理 electron-builder 快取..." -ForegroundColor Gray
|
||||
Remove-Item -Recurse -Force $ebCache -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
Write-Host " 執行 electron-builder..." -ForegroundColor Gray
|
||||
|
||||
# 直接執行 node_modules 中的 electron-builder
|
||||
@@ -246,6 +253,9 @@ function Build-Electron {
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Err "electron-builder 執行失敗"
|
||||
Write-Warn "如果出現 symlink 錯誤,請嘗試以下方案:"
|
||||
Write-Warn " 1. 以系統管理員身分執行此腳本"
|
||||
Write-Warn " 2. 或啟用 Windows 開發人員模式(設定 > 更新與安全性 > 開發人員專用)"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user