From 24ee05a4d09a4cdd67e4b1d6b18ef1e547a62b67 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Fri, 19 Jun 2026 12:27:19 +0000 Subject: [PATCH] =?UTF-8?q?fix(packaging/windows):=20dodge=20WOW64=20redir?= =?UTF-8?q?ection=20=E2=80=94=20run=20ISCC=20on=20copies=20under=20C:\t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause of the persistent ISCC "path not found": ISCC.exe is 32-bit, and the self-hosted runner runs as SYSTEM, so the checkout lives under C:\Windows\System32\config\systemprofile\.cache\... . WOW64 file-system redirection rewrites a 32-bit process's System32 reads to SysWOW64 (where nothing exists), so ISCC died opening the .iss before it even printed its version line. (The smoke-test diagnostic compiled fine precisely because it lived at C:\t\out.) Fix: copy every file ISCC reads (the .iss + host.env.example + README.md) into the non-redirected build dir C:\t\out and compile from there; BinDir, StageDir, and OutputDir already live under C:\t. Removed the now-spent smoke diagnostic. Co-Authored-By: Claude Opus 4.8 (1M context) --- packaging/windows/pack-host-installer.ps1 | 46 +++++++++++------------ 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/packaging/windows/pack-host-installer.ps1 b/packaging/windows/pack-host-installer.ps1 index 551d139..35f6cb9 100644 --- a/packaging/windows/pack-host-installer.ps1 +++ b/packaging/windows/pack-host-installer.ps1 @@ -109,14 +109,26 @@ function Sign-File([string]$Path) { # --- sign the inner exe before it's packed ---------------------------------------------------- Sign-File $exe -# --- resolve + validate the installer's source files (absolute paths -> ISCC /D defines) ------- +# --- resolve + validate the installer's source files ------------------------------------------ $repoRoot = (Resolve-Path (Join-Path $here '..\..')).Path -$hostEnv = Join-Path $repoRoot 'scripts\windows\host.env.example' -$readme = Join-Path $here 'README.md' -foreach ($p in @($exe, $hostEnv, $readme)) { +$hostEnvSrc = Join-Path $repoRoot 'scripts\windows\host.env.example' +$readmeSrc = Join-Path $here 'README.md' +foreach ($p in @($exe, $hostEnvSrc, $readmeSrc, $iss)) { if (-not (Test-Path -LiteralPath $p)) { throw "installer source file missing: $p" } - Write-Host " source ok: $p" } + +# ISCC is a 32-bit program. On the self-hosted runner (which runs as SYSTEM) the checkout lives +# under C:\Windows\System32\config\systemprofile\..., and WOW64 file-system redirection rewrites a +# 32-bit process's System32 reads to SysWOW64 (where the files don't exist) -> ISCC dies at +# script-open with "path not found". So stage every file ISCC reads (the .iss + the two payload +# files) into the non-redirected build dir under C:\t. (BinDir/StageDir/OutputDir already live there.) +$hostEnv = Join-Path $OutDir 'host.env.example' +$readme = Join-Path $OutDir 'README.md' +$issLocal = Join-Path $OutDir 'punktfunk-host.iss' +Copy-Item -LiteralPath $hostEnvSrc -Destination $hostEnv -Force +Copy-Item -LiteralPath $readmeSrc -Destination $readme -Force +Copy-Item -LiteralPath $iss -Destination $issLocal -Force + $defines = @( "/DMyAppVersion=$Version", "/DBinDir=$TargetDir", @@ -134,26 +146,10 @@ if (-not $NoDriver) { } else { Write-Host "-NoDriver: building installer WITHOUT the bundled SudoVDA driver" } -# --- build the installer ---------------------------------------------------------------------- -Write-Host "==> ISCC $($defines -join ' ') $iss" -& $iscc @defines $iss -if ($LASTEXITCODE -ne 0) { - $rc = $LASTEXITCODE - Write-Warning "ISCC failed ($rc) — diagnostics:" - $innoDir = Split-Path $iscc - Write-Host " Inno dir: $innoDir" - Write-Host " Default.isl present: $(Test-Path (Join-Path $innoDir 'Default.isl'))" - Get-ChildItem $innoDir -File -ErrorAction SilentlyContinue | ForEach-Object { " $($_.Name)" } - Write-Host " OutDir=$OutDir exists=$(Test-Path $OutDir) ; TargetDir=$TargetDir exists=$(Test-Path $TargetDir) ; StageExists=$(Test-Path (Join-Path $OutDir 'stage'))" - # smoke test: does ISCC compile a trivial [Setup]-only script on this box at all? - $smoke = Join-Path $OutDir 'smoke.iss' - "[Setup]`r`nAppName=smoke`r`nAppVersion=1.0`r`nDefaultDirName={autopf}\smoke`r`nOutputDir=$OutDir`r`nOutputBaseFilename=smoke`r`n[Files]" | - Set-Content -Encoding ASCII $smoke - Write-Host "== smoke-test ISCC (trivial script) ==" - & $iscc $smoke - Write-Host "== smoke rc=$LASTEXITCODE ==" - throw "ISCC failed ($rc)" -} +# --- build the installer (from the non-redirected copy under C:\t) ----------------------------- +Write-Host "==> ISCC $($defines -join ' ') $issLocal" +& $iscc @defines $issLocal +if ($LASTEXITCODE -ne 0) { throw "ISCC failed ($LASTEXITCODE)" } $setup = Join-Path $OutDir "punktfunk-host-setup-$Version.exe" if (-not (Test-Path $setup)) { throw "expected installer not produced: $setup" }