From 634e4011fd9a37d9a05f2f1132203ec7d9ca4792 Mon Sep 17 00:00:00 2001 From: jim800121chen Date: Sun, 12 Apr 2026 02:23:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(local-tool):=20bootstrap=20=E6=8A=8A=20Inno?= =?UTF-8?q?=20Setup=20=E7=9B=AE=E9=8C=84=E5=8A=A0=E9=80=B2=20MSYS2=20bash?= =?UTF-8?q?=20PATH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit winget 裝的 Inno Setup 6 在 'C:\Program Files (x86)\Inno Setup 6\', 不在 PATH 裡,MSYS2 bash 找不到 iscc.exe 導致 make exe 失敗。 改由 bootstrap 主動偵測安裝路徑並 export 進 bash session PATH。 Co-Authored-By: Claude Opus 4.6 (1M context) --- local-tool/scripts/bootstrap-windows.ps1 | 27 +++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/local-tool/scripts/bootstrap-windows.ps1 b/local-tool/scripts/bootstrap-windows.ps1 index c3a7888..15b371a 100644 --- a/local-tool/scripts/bootstrap-windows.ps1 +++ b/local-tool/scripts/bootstrap-windows.ps1 @@ -104,6 +104,24 @@ function Convert-ToMsysPath($winPath) { } $msysPython = Convert-ToMsysPath $realPython +# 找 Inno Setup Compiler (iscc.exe),winget 裝在 Program Files (x86) 不在 PATH 裡 +$isccCandidates = @( + "${env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe", + "$env:ProgramFiles\Inno Setup 6\iscc.exe", + "${env:ProgramFiles(x86)}\Inno Setup 5\iscc.exe" +) +$isccPath = $null +foreach ($p in $isccCandidates) { + if ($p -and (Test-Path $p)) { $isccPath = $p; break } +} +if ($isccPath) { + Log "偵測到 Inno Setup: $isccPath" + $msysIsccDir = Convert-ToMsysPath (Split-Path $isccPath -Parent) +} else { + Log 'WARN: 找不到 Inno Setup(iscc.exe),make exe 步驟會失敗' + $msysIsccDir = $null +} + # Makefile 需要 bash + make,透過 MSYS2 bash 執行 # 將 Windows 路徑 C:\foo\bar 轉成 MSYS2 路徑 /c/foo/bar $projectPath = (Get-Location).Path @@ -113,10 +131,13 @@ $msysPath = '/' + $projectPath.Substring(0,1).ToLower() + '/' + ` $bashParts = @( "cd '$msysPath'", 'export VISIONA_ALLOW_GPL_FFMPEG=1', - "export VISIONA_PYTHON='$msysPython'", - 'make vendor-python-windows vendor-wheels-windows vendor-ffmpeg-windows vendor-ytdlp-windows', - 'make payload-windows' + "export VISIONA_PYTHON='$msysPython'" ) +if ($msysIsccDir) { + $bashParts += "export PATH=`"$msysIsccDir`":`$PATH" +} +$bashParts += 'make vendor-python-windows vendor-wheels-windows vendor-ffmpeg-windows vendor-ytdlp-windows' +$bashParts += 'make payload-windows' switch ($Target) { 'payload-windows' { }