fix(ci): 健壮化 Inno Setup 安装 + 部署仅保留最新安装包
- 新增 install-innosetup.ps1:校验下载大小、检查安装程序退出码、双 Program Files 目录定位 ISCC,修复原内联命令静默成功但没真正装上的问题 (SYSTEM 账户下 Invoke-WebRequest 无 -UseBasicParsing + 未检查退出码) - provision/compile-windows.sh 在两个 Program Files 目录查找 ISCC - deploy.sh 发布安装包到 /opt/jiu/downloads 前先清旧包,仅保留最新版本 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -18,17 +18,16 @@ CUR="${STAMP_DIR}/.flutter-version-win.cur"
|
||||
mkdir -p "$STAMP_DIR"
|
||||
|
||||
# --- ensure Inno Setup (ISCC) for building the installer (always checked) ---
|
||||
ISCC="/c/Program Files (x86)/Inno Setup 6/ISCC.exe"
|
||||
if [ ! -f "$ISCC" ]; then
|
||||
# ISCC installs to Program Files (x86) (32-bit app); check both to be safe.
|
||||
ISCC_X86="/c/Program Files (x86)/Inno Setup 6/ISCC.exe"
|
||||
ISCC_X64="/c/Program Files/Inno Setup 6/ISCC.exe"
|
||||
if [ ! -f "$ISCC_X86" ] && [ ! -f "$ISCC_X64" ]; then
|
||||
echo "==> installing Inno Setup 6 (silent)"
|
||||
# Canonical "latest stable" entry point (redirects to the GitHub release asset).
|
||||
INNO_URL="https://jrsoftware.org/download.php/is.exe"
|
||||
powershell -NoProfile -Command \
|
||||
"Invoke-WebRequest -Uri '${INNO_URL}' -OutFile \"\$env:TEMP\\innosetup.exe\""
|
||||
powershell -NoProfile -Command \
|
||||
"Start-Process -Wait -FilePath \"\$env:TEMP\\innosetup.exe\" -ArgumentList '/VERYSILENT','/SUPPRESSMSGBOXES','/NORESTART','/SP-'"
|
||||
if [ ! -f "$ISCC" ]; then
|
||||
echo "ERROR: Inno Setup install failed — ISCC not found at '$ISCC'." >&2
|
||||
# Robust installer (checks download size + installer exit code) — inline
|
||||
# bash->powershell quoting was the original failure; a .ps1 avoids it.
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File "${SCRIPT_DIR}/install-innosetup.ps1"
|
||||
if [ ! -f "$ISCC_X86" ] && [ ! -f "$ISCC_X64" ]; then
|
||||
echo "ERROR: Inno Setup install failed — ISCC not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "==> Inno Setup installed."
|
||||
|
||||
Reference in New Issue
Block a user