build: parameterize inno setup script and rework windows packaging step

This commit is contained in:
yyc12345 committed 2026-10-12 13:06:34 +08:00
1 parent 793f22ddfe
commit ef77d01b01
2 files changed
+36 -14

No files matched your search

+16 -6
View File
@@ -91,7 +91,7 @@ jobs:
cmake --build build_dependencies/kimageformats --config Release --target=install || goto :error
echo ::endgroup::
:: ------ app ------
echo ::group::===== App (Build'n'Install) =====
echo ::group::===== App Build =====
cmake -Bbuild . || goto :error
cmake --build build --config Release || goto :error
cmake --install build --config Release --prefix "%PWD%\build" || goto :error
@@ -101,14 +101,24 @@ jobs:
robocopy ./dependencies_bin/bin build/bin *.dll
if ErrorLevel 8 goto :error
copy LICENSE build\bin
copy build\inno-metadata\scwpic.iss build\bin\scwpic.iss
robocopy build\inno-metadata\Strings build\bin\Strings
if ErrorLevel 8 goto :error
iscc /Q build\bin\scwpic.iss || goto :error
mkdir pack
echo ::group::===== App InnoSetup Pack =====
mkdir pack\inno
iscc "/DPublishDir=%CD%\build\bin" "/DOutputDir=%CD%\pack\inno" build\inno-metadata\scwpic.iss || goto :error
echo ::endgroup::
echo ::group::===== App MSIX Pack =====
:: TODO
echo ::endgroup::
exit /B 0
:error
exit /B 1
- uses: actions/upload-artifact@v6
with:
name: "scwpic-windows-msvc${{ matrix.vs }}-qt${{ matrix.qt_ver }}-cmake-setup"
path: build/bin/scwpic-setup.exe
path: pack/inno/scwpic-setup.exe
# TODO: Enable when start to support MSIX pack.
# - uses: actions/upload-artifact@v6
# with:
# name: "scwpic-windows-msvc${{ matrix.vs }}-qt${{ matrix.qt_ver }}-cmake"
# path: pack/msix/scwpic.msix
+20 -8
View File
@@ -1,4 +1,14 @@
; Script for generating the SCW Photo Viewer installer.
; Inno Setup script for the Windows installer of SCW Photo Viewer.
;
; ISCC.exe /DPublishDir=<publish-dir> /DOutputDir=<dist-dir> path\to\this.iss
;
#ifndef PublishDir
#error PublishDir must be specified when running this script. It specifies the directory from which Inno Setup retrieves the artifacts to be packaged.
#endif
#ifndef OutputDir
#error OutputDir must be specified when running this script. It specifies the directory in which Inno Setup writes the generated setup package.
#endif
#define MyAppName "SCW Photo Viewer"
#define MyAppVersion "@PROJECT_VERSION@"
@@ -38,11 +48,11 @@ ArchitecturesInstallIn64BitMode=x64compatible
ChangesAssociations=yes
DefaultGroupName={cm:MyAppName}
AllowNoIcons=yes
LicenseFile=LICENSE
LicenseFile={#PublishDir}\LICENSE
; Uncomment the following line to run in non administrative install mode (install for current user only).
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=.
OutputDir={#OutputDir}
OutputBaseFilename=scwpic-setup
SolidCompression=yes
WizardStyle=modern
@@ -77,11 +87,13 @@ Name: "associatewithfiles"; Description: "{cm:MyAssociateWithFiles,{#MyAppName}}
[Files]
; YYC MARK:
; This file MUST be placed with "scwpic.exe" before compiling this script.
; Otherwise exception will be thrown.
Source: "{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "*"; Excludes: "vc_redist.x64.exe,scwpic-setup.exe,scwpic.iss,Strings"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "vc_redist.x64.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
; This script is compiled in place and retrieves the artifacts to be packaged
; from the directory given by the "PublishDir" define, which must contain
; "scwpic.exe", "vc_redist.x64.exe" and the "LICENSE" file. Otherwise
; exception will be thrown.
Source: "{#PublishDir}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#PublishDir}\*"; Excludes: "vc_redist.x64.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#PublishDir}\vc_redist.x64.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Registry]