1param(2 [Parameter(Mandatory = $true)][string]$Version,3 [Parameter(Mandatory = $true)][string]$Binary,4 [Parameter(Mandatory = $true)][string]$Dist5)67$ErrorActionPreference = "Stop"8$root = (Resolve-Path (Join-Path $PSScriptRoot "../..")).Path9$iscc = Join-Path ${env:ProgramFiles(x86)} "Inno Setup 6/ISCC.exe"10if (-not (Test-Path $iscc)) {11 throw "Inno Setup 6 is required at $iscc"12}1314New-Item -ItemType Directory -Force -Path $Dist | Out-Null15$outputBase = "Atlas-$Version-windows-amd64-setup"16& $iscc "/DMyAppVersion=$($Version.TrimStart('v'))" "/DMyAppExe=$Binary" "/DOutputDir=$Dist" "/DOutputBase=$outputBase" (Join-Path $root "packaging/windows/Atlas.iss")17if ($LASTEXITCODE -ne 0) {18 throw "Inno Setup failed with exit code $LASTEXITCODE"19}2021$installer = Join-Path $Dist "$outputBase.exe"22if (-not (Test-Path $installer)) {23 throw "Inno Setup did not create $installer"24}