fix(local-tool): bootstrap 把 Inno Setup 目錄加進 MSYS2 bash PATH
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) <noreply@anthropic.com>
This commit is contained in:
parent
13ce654ac2
commit
634e4011fd
@ -104,6 +104,24 @@ function Convert-ToMsysPath($winPath) {
|
|||||||
}
|
}
|
||||||
$msysPython = Convert-ToMsysPath $realPython
|
$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 執行
|
# Makefile 需要 bash + make,透過 MSYS2 bash 執行
|
||||||
# 將 Windows 路徑 C:\foo\bar 轉成 MSYS2 路徑 /c/foo/bar
|
# 將 Windows 路徑 C:\foo\bar 轉成 MSYS2 路徑 /c/foo/bar
|
||||||
$projectPath = (Get-Location).Path
|
$projectPath = (Get-Location).Path
|
||||||
@ -113,10 +131,13 @@ $msysPath = '/' + $projectPath.Substring(0,1).ToLower() + '/' + `
|
|||||||
$bashParts = @(
|
$bashParts = @(
|
||||||
"cd '$msysPath'",
|
"cd '$msysPath'",
|
||||||
'export VISIONA_ALLOW_GPL_FFMPEG=1',
|
'export VISIONA_ALLOW_GPL_FFMPEG=1',
|
||||||
"export VISIONA_PYTHON='$msysPython'",
|
"export VISIONA_PYTHON='$msysPython'"
|
||||||
'make vendor-python-windows vendor-wheels-windows vendor-ffmpeg-windows vendor-ytdlp-windows',
|
|
||||||
'make payload-windows'
|
|
||||||
)
|
)
|
||||||
|
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) {
|
switch ($Target) {
|
||||||
'payload-windows' { }
|
'payload-windows' { }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user