From 43e0be4cf45f5a2ac25863bb228abb0004827781 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Fri, 19 Jun 2026 11:44:30 +0000 Subject: [PATCH] fix(packaging/windows): pass installer source files as validated absolute defines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The {#SourcePath} relative-traversal for host.env.example/README kept tripping ISCC ("path not found", error 2) regardless of the separator, so drop it: compute the two paths absolutely in pack-host-installer.ps1, Test-Path them (clear PS error if missing), and pass /DHostEnv + /DReadme. The .iss [Files] now reference the absolute defines — no {#SourcePath}, no ..\.. traversal. Also prints "source ok" for each so a future failure is unambiguous. Co-Authored-By: Claude Opus 4.8 (1M context) --- packaging/windows/pack-host-installer.ps1 | 17 ++++++++++++++++- packaging/windows/punktfunk-host.iss | 12 +++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/packaging/windows/pack-host-installer.ps1 b/packaging/windows/pack-host-installer.ps1 index 0422dfd..8979527 100644 --- a/packaging/windows/pack-host-installer.ps1 +++ b/packaging/windows/pack-host-installer.ps1 @@ -109,8 +109,23 @@ 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) ------- +$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)) { + if (-not (Test-Path -LiteralPath $p)) { throw "installer source file missing: $p" } + Write-Host " source ok: $p" +} +$defines = @( + "/DMyAppVersion=$Version", + "/DBinDir=$TargetDir", + "/DOutputDir=$OutDir", + "/DHostEnv=$hostEnv", + "/DReadme=$readme" +) + # --- stage the SudoVDA driver bundle ---------------------------------------------------------- -$defines = @("/DMyAppVersion=$Version", "/DBinDir=$TargetDir", "/DOutputDir=$OutDir") if (-not $NoDriver) { $stage = Join-Path $OutDir 'stage' & (Join-Path $here 'stage-sudovda.ps1') -OutDir $stage diff --git a/packaging/windows/punktfunk-host.iss b/packaging/windows/punktfunk-host.iss index 162736c..bb9aace 100644 --- a/packaging/windows/punktfunk-host.iss +++ b/packaging/windows/punktfunk-host.iss @@ -21,6 +21,13 @@ #ifndef OutputDir #define OutputDir "." #endif +; Absolute paths to the two extra payload files, passed by pack-host-installer.ps1 (validated there). +#ifndef HostEnv + #define HostEnv "..\..\scripts\windows\host.env.example" +#endif +#ifndef Readme + #define Readme "README.md" +#endif ; StageDir (the staged SudoVDA payload + nefconc.exe + install-sudovda.ps1) is optional. #ifdef StageDir #define WithDriver @@ -56,9 +63,8 @@ Name: "startservice"; Description: "Start the punktfunk host service now (also s [Files] Source: "{#BinDir}\punktfunk-host.exe"; DestDir: "{app}"; Flags: ignoreversion -; {#SourcePath} (the .iss dir) has no trailing backslash — keep the explicit '\' separator. -Source: "{#SourcePath}\..\..\scripts\windows\host.env.example"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#SourcePath}\README.md"; DestDir: "{app}"; DestName: "README.txt"; Flags: ignoreversion +Source: "{#HostEnv}"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#Readme}"; DestDir: "{app}"; DestName: "README.txt"; Flags: ignoreversion #ifdef WithDriver ; The driver payload + nefconc.exe + install-sudovda.ps1, extracted to {tmp} and removed after install. Source: "{#StageDir}\*"; DestDir: "{tmp}\sudovda"; Flags: deleteafterinstall recursesubdirs createallsubdirs; Tasks: installdriver