Skip to content

Commit d03debd

Browse files
stytimclaude
andcommitted
Fix Windows NSIS installer output path
NSIS resolves OutFile relative to the .nsi file's directory, not the working directory. Since the .nsi is written to $env:RUNNER_TEMP, the installer landed in D:\a\_temp\ where upload-artifact's glob could not see it. Anchor OutFile to an absolute path under the workspace root. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3c90356 commit d03debd

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,12 @@ jobs:
302302
}
303303
304304
$version = $env:VERSION
305-
$outFile = "ir-tracking-app-$version-${{ matrix.label }}-setup.exe"
305+
# NSIS's OutFile is resolved relative to the .nsi file's directory,
306+
# so use an absolute path anchored at the workspace root — that
307+
# way the upload-artifact glob can find it.
308+
$outFileName = "ir-tracking-app-$version-${{ matrix.label }}-setup.exe"
309+
$outFileAbs = Join-Path (Get-Location).Path $outFileName
310+
$outFileNsi = $outFileAbs.Replace('\','\\')
306311
$nsiPath = "$env:RUNNER_TEMP\installer.nsi"
307312
$stageNsi = $stage.Replace('\','\\')
308313
@@ -317,7 +322,7 @@ jobs:
317322
!define REGKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\`${APPID}"
318323
319324
Name "`${APPNAME} `${VERSION}"
320-
OutFile "$outFile"
325+
OutFile "$outFileNsi"
321326
Unicode true
322327
InstallDir "`$PROGRAMFILES64\`${APPNAME}"
323328
InstallDirRegKey HKLM "Software\`${APPNAME}" "InstallDir"
@@ -364,7 +369,7 @@ jobs:
364369
Set-Content -Path $nsiPath -Value $nsi -Encoding UTF8
365370
& $makensis $nsiPath
366371
if ($LASTEXITCODE -ne 0) { throw "makensis failed (exit $LASTEXITCODE)." }
367-
Get-Item $outFile | Format-List Length, Name
372+
Get-Item $outFileAbs | Format-List Length, Name
368373
369374
# -----------------------------------------------------------------
370375
# Upload the installer for the release job to collect.

0 commit comments

Comments
 (0)