From 90a194fc00626bfcc448b020ea5fa3fa4140242e Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Thu, 4 Jun 2026 09:05:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20ISCC=20=E8=B0=83=E7=94=A8=E5=85=B3?= =?UTF-8?q?=E9=97=AD=20MSYS=20=E5=8F=82=E6=95=B0=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=EF=BC=8C=E4=BF=AE=E5=A4=8D=20more=20than=20o?= =?UTF-8?q?ne=20script=20filename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Git Bash(MSYS) 把 /D 开头的参数当 POSIX 路径自动转换,导致 ISCC 的 /DAppVer /DSrcDir /DOutDir 丢失 /D 前缀、被当成多个脚本文件名而报错。 调用 ISCC 时设 MSYS_NO_PATHCONV=1 + MSYS2_ARG_CONV_EXCL='*' 关闭转换。 install-innosetup.ps1 顺带加 /LOG 失败时打印安装日志。 Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 4 ++-- scripts/ci/compile-windows.sh | 5 ++++- scripts/ci/install-innosetup.ps1 | 9 +++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1f6e27..3f7eef5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,14 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.0.11] - 2026-06-04 +## [1.0.12] - 2026-06-04 ### 新功能 - Windows 客户端改为提供安装程序(Inno Setup 打包的 `jiu-windows-x64-setup.exe`,含中文向导、桌面/开始菜单快捷方式、卸载项),不再是解压版 zip ### 修复 - 修复客户端「无法安全下载」:下载地址从内网 HTTP Forgejo(`http://192.168.3.200:3000`,公网不可达且被浏览器拦截)改为同源 HTTPS `https://jiu.51yanmei.com/downloads/...`,Windows、macOS 均生效 -- 修复 Windows runner 安装 Inno Setup 失败:改用健壮的 `install-innosetup.ps1`(校验下载大小 + 检查安装退出码 + 双 Program Files 目录定位 ISCC),替代会静默成功但实际没装上的内联命令 +- 修复 ISCC 编译报「more than one script filename」:调用 Inno Setup 时关闭 Git Bash 的 MSYS 参数路径转换,避免 `/D` 定义参数被改写 - 部署时将最新安装包发布到 web 服务(`/opt/jiu/downloads/`,nginx `/downloads/` 提供),仅保留最新版本(清旧放新) ## [1.0.9] - 2026-06-04 diff --git a/scripts/ci/compile-windows.sh b/scripts/ci/compile-windows.sh index 826e3ec..a2becf2 100755 --- a/scripts/ci/compile-windows.sh +++ b/scripts/ci/compile-windows.sh @@ -60,7 +60,10 @@ fi cp deploy/windows/jiu-installer.iss "${BUILD_ROOT}/jiu-installer.iss" mkdir -p "${BUILD_ROOT}/dist" echo "==> building installer with Inno Setup (version ${VER})" -"$ISCC" \ +# MSYS_NO_PATHCONV / MSYS2_ARG_CONV_EXCL disable Git Bash's automatic conversion +# of /-leading args into Windows paths, which otherwise mangles ISCC's /D defines +# (turning them into extra "script filenames"). +MSYS_NO_PATHCONV=1 MSYS2_ARG_CONV_EXCL='*' "$ISCC" \ "/DAppVer=${VER}" \ "/DSrcDir=C:\\jiu-build\\client\\build\\windows\\x64\\runner\\Release" \ "/DOutDir=C:\\jiu-build\\dist" \ diff --git a/scripts/ci/install-innosetup.ps1 b/scripts/ci/install-innosetup.ps1 index 11f4f91..f1070e5 100644 --- a/scripts/ci/install-innosetup.ps1 +++ b/scripts/ci/install-innosetup.ps1 @@ -23,9 +23,14 @@ Write-Output "Downloaded $size bytes" if ($size -lt 1000000) { throw "Downloaded file too small ($size bytes) - not a valid installer" } Write-Output "Installing silently..." -$p = Start-Process -FilePath $out -ArgumentList '/VERYSILENT','/SUPPRESSMSGBOXES','/NORESTART','/SP-','/NOICONS' -Wait -PassThru +$log = Join-Path $env:TEMP 'innosetup-install.log' +$p = Start-Process -FilePath $out -ArgumentList '/VERYSILENT','/SUPPRESSMSGBOXES','/NORESTART','/SP-','/NOICONS',"/LOG=$log" -Wait -PassThru Write-Output "Installer exit code: $($p.ExitCode)" -if ($p.ExitCode -ne 0) { throw "Inno Setup installer failed with exit code $($p.ExitCode)" } +if ($p.ExitCode -ne 0) { + Write-Output "----- install log tail -----" + if (Test-Path $log) { Get-Content $log -Tail 40 | ForEach-Object { Write-Output $_ } } + throw "Inno Setup installer failed with exit code $($p.ExitCode)" +} foreach ($c in $candidates) { if (Test-Path $c) { Write-Output "ISCC installed: $c"; exit 0 }