WindSurf和Gemini3救火成功

main
Jenkins CI 5 months ago
parent 153aa01fb8
commit 24ae486f65

137
Jenkinsfile vendored

@ -556,7 +556,8 @@ pipeline {
@echo off
setlocal EnableDelayedExpansion
set JAVA_HOME=%JAVA_HOME%
set "WIX_HOME=C:\\Program Files (x86)\\WiX Toolset v3.11"
REM 使用短路径避免 LocalSystem 权限导致的 "此时不应有" 错误
for %%P in ("C:\\Program Files (x86)\\WiX Toolset v3.11") do set "WIX_HOME=%%~sP"
set "PATH=%WIX_HOME%\\bin;%PATH%"
echo ============================================
@ -578,12 +579,12 @@ pipeline {
REM 检查 WiX Toolset
echo [2/6] 检查 WiX Toolset...
set "WIX_AVAILABLE=0"
if exist "%WIX_HOME%\\bin\\candle.exe" (
echo ✓ WiX Toolset 已安装: %WIX_HOME%
set "WIX_AVAILABLE=1"
) else (
echo ✗ WiX Toolset 未找到
echo MSI 打包需要 WiX Toolset
exit /b 1
echo ⚠️ WiX Toolset 未找到,跳过 EXE/MSI改用 ZIP 绿色版
)
echo.
@ -626,71 +627,79 @@ pipeline {
echo ✓ app-image 创建成功
echo.
REM 创建 EXE 安装包
echo [5/6] 创建 EXE 安装包...
jpackage ^
--type exe ^
--app-image target\\jpackage-output\\SLMS ^
--name SLMS ^
--app-version 1.0 ^
--vendor "CHZU" ^
--description "Smart Library Management System" ^
--win-menu ^
--win-dir-chooser ^
--win-shortcut ^
--dest target
if errorlevel 1 (
echo ⚠️ EXE 安装包创建失败 ^(可能缺少 Inno Setup^)
echo 尝试创建 ZIP 绿色版作为替代...
powershell -Command "Compress-Archive -Path target\\jpackage-output\\SLMS -DestinationPath target\\slms-gui.zip -Force"
if exist target\\slms-gui.zip (
echo ✓ ZIP 绿色版创建成功: slms-gui.zip
)
) else (
REM 重命名生成的 EXE
if exist target\\SLMS-1.0.exe (
move /Y target\\SLMS-1.0.exe target\\slms-gui.exe >nul
for %%F in (target\\slms-gui.exe) do (
set /a SIZE_MB=%%~zF/1048576
echo ✓ EXE 安装包创建成功: slms-gui.exe ^(!SIZE_MB! MB^)
if "%WIX_AVAILABLE%"=="1" (
REM 创建 EXE 安装包
echo [5/6] 创建 EXE 安装包...
jpackage ^
--type exe ^
--app-image target\\jpackage-output\\SLMS ^
--name SLMS ^
--app-version 1.0 ^
--vendor "CHZU" ^
--description "Smart Library Management System" ^
--win-menu ^
--win-dir-chooser ^
--win-shortcut ^
--dest target
if errorlevel 1 (
echo ⚠️ EXE 安装包创建失败 ^(可能缺少 Inno Setup^)
) else (
REM 重命名生成的 EXE
if exist target\\SLMS-1.0.exe (
move /Y target\\SLMS-1.0.exe target\\slms-gui.exe >nul
for %%F in (target\\slms-gui.exe) do (
set /a SIZE_MB=%%~zF/1048576
echo ✓ EXE 安装包创建成功: slms-gui.exe ^(!SIZE_MB! MB^)
)
) else (
echo ⚠️ EXE 文件生成了但未找到预期文件名,列出 target 目录:
dir target\\*.exe
)
)
echo.
REM 创建 MSI 安装包
echo [6/6] 创建 MSI 安装包...
jpackage ^
--type msi ^
--app-image target\\jpackage-output\\SLMS ^
--name SLMS ^
--app-version 1.0 ^
--vendor "CHZU" ^
--description "Smart Library Management System" ^
--win-menu ^
--win-dir-chooser ^
--win-shortcut ^
--dest target
if errorlevel 1 (
echo ⚠️ MSI 创建失败,将保留 EXE/ZIP
) else (
echo ⚠️ EXE 文件生成了但未找到预期文件名,列出 target 目录:
dir target\\*.exe
REM 重命名 MSI
if exist target\\SLMS-1.0.msi (
move /Y target\\SLMS-1.0.msi target\\slms-gui-installer.msi >nul
for %%F in (target\\slms-gui-installer.msi) do (
set /a SIZE_MB=%%~zF/1048576
echo ✓ MSI 创建成功: slms-gui-installer.msi ^(!SIZE_MB! MB^)
)
) else (
echo ⚠️ MSI 文件未找到,检查其他可能的文件名...
dir target\\*.msi
)
)
echo.
) else (
echo [5/6] WiX 不可用,跳过 EXE/MSI创建 ZIP 绿色版...
)
echo.
REM 创建 MSI 安装包
echo [6/6] 创建 MSI 安装包...
jpackage ^
--type msi ^
--app-image target\\jpackage-output\\SLMS ^
--name SLMS ^
--app-version 1.0 ^
--vendor "CHZU" ^
--description "Smart Library Management System" ^
--win-menu ^
--win-dir-chooser ^
--win-shortcut ^
--dest target
if errorlevel 1 (
echo ✗ MSI 创建失败
exit /b 1
)
REM 重命名 MSI
if exist target\\SLMS-1.0.msi (
move /Y target\\SLMS-1.0.msi target\\slms-gui-installer.msi >nul
for %%F in (target\\slms-gui-installer.msi) do (
set /a SIZE_MB=%%~zF/1048576
echo ✓ MSI 创建成功: slms-gui-installer.msi ^(!SIZE_MB! MB^)
if %WIX_AVAILABLE%==0 (
powershell -Command "Compress-Archive -Path target\\jpackage-output\\SLMS -DestinationPath target\\slms-gui.zip -Force"
if exist target\\slms-gui.zip (
echo ✓ ZIP 绿色版创建成功: slms-gui.zip
) else (
echo ✗ ZIP 创建失败,请检查 jpackage 输出
)
) else (
echo ⚠️ MSI 文件未找到,检查其他可能的文件名...
dir target\\*.msi
)
echo.

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save