Skip to content

Commit 56f0ed9

Browse files
Use max installer compression for releases (#4978)
Keep local and dry-run installer builds on the default Inno compression path while allowing release builds to opt into lzma/ultra64. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2b555fc commit 56f0ed9

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

‎.github/workflows/build-release.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,13 @@ jobs:
260260
Set-Content $IssPath $issContentNoSign -NoNewline
261261
262262
$InstallerBaseName = "UniGetUI.Installer.$Platform"
263-
& ISCC.exe $IssPath /F"$InstallerBaseName" /O"$OutputDir"
263+
$IsccArgs = @($IssPath, "/F$InstallerBaseName", "/O$OutputDir")
264+
if ([System.Boolean]::Parse('${{ needs.preflight.outputs.dry-run }}') -eq $false) {
265+
Write-Host "Using lzma/ultra64 installer compression for release build."
266+
$IsccArgs = @('/DInstallerCompression=lzma/ultra64') + $IsccArgs
267+
}
268+
269+
& ISCC.exe @IsccArgs
264270
if ($LASTEXITCODE -ne 0) { throw "Inno Setup failed with exit code $LASTEXITCODE" }
265271
}
266272
finally {

‎UniGetUI.iss‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#define MyAppPublisher "Devolutions Inc."
77
#define MyAppURL "https://github.com/Devolutions/UniGetUI"
88
#define MyAppExeName "UniGetUI.exe"
9+
#ifndef InstallerCompression
10+
#define InstallerCompression "lzma"
11+
#endif
912

1013
#define public Dependency_Path_NetCoreCheck "InstallerExtras\"
1114
#include "InstallerExtras\CodeDependencies.iss"
@@ -46,7 +49,7 @@ SignedUninstallerDir=InstallerExtras\
4649
MinVersion=10.0
4750
SetupIconFile=src\SharedAssets\Assets\Images\icon.ico
4851
UninstallDisplayIcon={app}\UniGetUI.exe
49-
Compression=lzma
52+
Compression={#InstallerCompression}
5053
SolidCompression=yes
5154
WizardStyle=modern dynamic
5255
WizardImageFile=InstallerExtras\installer-banner.png

‎scripts/build.ps1‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@
2121
.PARAMETER Version
2222
Version string to stamp into the build (e.g. "3.3.7"). If not provided,
2323
the current version from SharedAssemblyInfo.cs is used.
24-
#>
2524
25+
.PARAMETER MaxInstallerCompression
26+
Use the strongest Inno Setup compression settings for the installer.
27+
#>
2628
[CmdletBinding()]
2729
param(
2830
[string] $Configuration = "Release",
2931
[string] $Platform = "x64",
3032
[string] $OutputPath = (Join-Path $PSScriptRoot ".." "output"),
3133
[switch] $SkipTests,
3234
[switch] $SkipInstaller,
35+
[switch] $MaxInstallerCompression,
3336
[string] $Version
3437
)
3538

@@ -143,7 +146,13 @@ if (-not $SkipInstaller) {
143146
$IssContentNoSign = $IssContentNoSign -Replace '(?m)^SignedUninstaller=yes', 'SignedUninstaller=no'
144147
Set-Content $IssPath $IssContentNoSign -NoNewline
145148

146-
& $IsccPath $IssPath /F"$InstallerBaseName" /O"$OutputPath"
149+
$IsccArgs = @($IssPath, "/F$InstallerBaseName", "/O$OutputPath")
150+
if ($MaxInstallerCompression) {
151+
Write-Host "Using lzma/ultra64 installer compression."
152+
$IsccArgs = @('/DInstallerCompression=lzma/ultra64') + $IsccArgs
153+
}
154+
155+
& $IsccPath @IsccArgs
147156
if ($LASTEXITCODE -ne 0) {
148157
throw "Inno Setup failed with exit code $LASTEXITCODE"
149158
}

0 commit comments

Comments
 (0)