Skip to content

Commit d1896e9

Browse files
Build 'Inno Setup' installer in Windows workflow
Add a step to build an Inno Setup-based CUETools installer in the Windows workflow.
1 parent cf034fc commit d1896e9

File tree

3 files changed

+72
-3
lines changed

3 files changed

+72
-3
lines changed

.github/workflows/release-windows.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
- uses: actions/checkout@v4
3030
with:
3131
submodules: recursive
32+
- name: Install Inno Setup
33+
run: pwsh -File ./install_inno.ps1
3234
- name: Apply patches
3335
# yamllint disable-line rule:line-length
3436
run: |
@@ -57,7 +59,7 @@ jobs:
5759
run: |
5860
collect_files_lite.bat
5961
- name: Package files
60-
run: pwsh -File ./packaging.ps1
62+
run: pwsh -File ./packaging.ps1
6163
- name: Get CUETools Version
6264
id: get_version
6365
run: |
@@ -66,7 +68,17 @@ jobs:
6668
set PRODUCTVER=%PRODUCTVER:;=%
6769
echo CUETools version: %PRODUCTVER%
6870
echo CUETOOLS_VERSION=%PRODUCTVER%>>%GITHUB_ENV%
69-
shell: cmd
71+
shell: cmd
72+
- name: Build Windows installer
73+
run: |
74+
"C:\\Program Files (x86)\\Inno Setup 6\\ISCC.exe" "installer.iss"
75+
shell: cmd
76+
- name: Generate hash for Windows installer
77+
run: |
78+
$installer = "CUETools_Setup_${{ env.CUETOOLS_VERSION }}.exe"
79+
$installerHash = (Get-FileHash $installer -Algorithm SHA256).Hash.ToLower()
80+
"$installerHash *$installer" | Out-File -Encoding ASCII "$installer.sha256"
81+
shell: pwsh
7082
- name: Add artifacts to Release
7183
uses: softprops/action-gh-release@v2
7284
with:
@@ -76,9 +88,11 @@ jobs:
7688
prerelease: false
7789
tag_name: ${{ github.ref_name }}
7890
files: |
91+
CUETools_Setup_${{ env.CUETOOLS_VERSION }}.exe
92+
CUETools_Setup_${{ env.CUETOOLS_VERSION }}.exe.sha256
7993
CUETools_${{ env.CUETOOLS_VERSION }}.zip
8094
CUETools_${{ env.CUETOOLS_VERSION }}.zip.sha256
8195
CUETools.Lite_${{ env.CUETOOLS_VERSION }}.zip
8296
CUETools.Lite_${{ env.CUETOOLS_VERSION }}.zip.sha256
8397
CUETools.CTDB.EACPlugin.${{ env.CUETOOLS_VERSION }}.zip
84-
CUETools.CTDB.EACPlugin.${{ env.CUETOOLS_VERSION }}.zip.sha256
98+
CUETools.CTDB.EACPlugin.${{ env.CUETOOLS_VERSION }}.zip.sha256

install_inno.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
$ErrorActionPreference = "Stop"
2+
3+
$innoUri = "https://files.jrsoftware.org/is/6/innosetup-6.4.2.exe"
4+
$executable = "innosetup-6.4.2.exe"
5+
$expectedHash = "238e2cf82c212a3879a050e02d787283c54bcb72d5cb6070830942de56627d5b"
6+
7+
Invoke-WebRequest -Uri $innoUri -OutFile $executable
8+
9+
$actualHash = (Get-FileHash $executable -Algorithm SHA256).Hash.ToLower()
10+
if ($actualHash -ne $expectedHash) {
11+
Write-Host "Hash mismatch! Executable is modified."
12+
exit 1
13+
}
14+
15+
Start-Process -FilePath $executable -ArgumentList "/SILENT" -Wait

installer.iss

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#define CUETOOLS_VERSION GetEnv('CUETOOLS_VERSION')
2+
#if CUETOOLS_VERSION == ''
3+
#define CUETOOLS_VERSION '0.0.0'
4+
#endif
5+
6+
#define APPNAME 'CUETools'
7+
8+
[Setup]
9+
AppName={#APPNAME}
10+
AppVersion={#CUETOOLS_VERSION}
11+
WizardStyle=modern
12+
DefaultDirName={autopf}\{#APPNAME}
13+
DefaultGroupName={#APPNAME}
14+
OutputDir=.
15+
OutputBaseFilename={#APPNAME}_Setup_{#CUETOOLS_VERSION}
16+
SetupIconFile=.\CUERipper.Avalonia\Assets\cue2.ico
17+
UninstallDisplayIcon={app}\{#APPNAME}.exe
18+
Compression=lzma2/ultra
19+
SolidCompression=yes
20+
LicenseFile=License.txt
21+
PrivilegesRequiredOverridesAllowed=dialog
22+
23+
[Files]
24+
Source: "bin\Release\CUETools_{#CUETOOLS_VERSION}\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs
25+
Source: "License.txt"; DestDir: "{app}"; Flags: onlyifdoesntexist
26+
27+
[Icons]
28+
Name: "{group}\CUETools"; Filename: "{app}\CUETools.exe"; Tasks: starticon
29+
Name: "{group}\CUERipper"; Filename: "{app}\CUERipper.Avalonia.exe"; Tasks: starticon
30+
Name: "{group}\CUERipper (Classic)"; Filename: "{app}\CUERipper.exe"; Tasks: starticon
31+
Name: "{autodesktop}\CUETools"; Filename: "{app}\CUETools.exe"; Tasks: desktopicon
32+
Name: "{autodesktop}\CUERipper"; Filename: "{app}\CUERipper.Avalonia.exe"; Tasks: desktopicon
33+
Name: "{group}\Uninstall CUETools"; Filename: "{uninstallexe}"
34+
35+
[Tasks]
36+
Name: "starticon"; Description: "Create start menu shortcut"; GroupDescription: "Additional shortcuts:"
37+
Name: "desktopicon"; Description: "Create desktop shortcut"; GroupDescription: "Additional shortcuts:"
38+
39+
[UninstallDelete]
40+
Type: filesandordirs; Name: "{app}"

0 commit comments

Comments
 (0)