File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4949 - name : Install NSIS
5050 shell : pwsh
5151 run : |
52- choco install nsis -y --no-progress
53- echo "C:\Program Files (x86)\NSIS" >> $env:GITHUB_PATH
52+ $ErrorActionPreference = "Stop"
53+ # choco 社区源偶发 503,重试最多 3 次(应对瞬时故障)
54+ $installed = $false
55+ for ($i = 1; $i -le 3; $i++) {
56+ Write-Host "安装 NSIS (尝试 $i/3)..."
57+ choco install nsis -y --no-progress
58+ if ($LASTEXITCODE -eq 0) { $installed = $true; break }
59+ Write-Host "choco 退出码 $LASTEXITCODE,10s 后重试..."
60+ Start-Sleep -Seconds 10
61+ }
62+ if (-not $installed) {
63+ Write-Error "NSIS 安装失败:choco install 连续 3 次非零退出(可能是 Chocolatey 源故障)"
64+ exit 1
65+ }
66+ # 校验 makensis.exe 真实存在,缺失即提前失败(不拖到打包步骤)
67+ $nsisDir = "C:\Program Files (x86)\NSIS"
68+ if (-not (Test-Path "$nsisDir\makensis.exe")) {
69+ Write-Error "NSIS 安装后未找到 makensis.exe(路径:$nsisDir)"
70+ exit 1
71+ }
72+ echo "$nsisDir" >> $env:GITHUB_PATH
73+ Write-Host "NSIS 安装成功:$nsisDir\makensis.exe"
5474
5575 - name : Install frontend dependencies
5676 working-directory : wind_setting/frontend
You can’t perform that action at this time.
0 commit comments