fix: NSIS script — single-quoted here-string, no PS interpolation
Some checks failed
Build & Sign Wraith / Build Windows + Sign (push) Failing after 2m27s

PowerShell was eating $INSTDIR/$PROGRAMFILES64 and $version.
Use single-quoted here-string with placeholder replacement.
Pass full path to makensis instead of Push-Location.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell 2026-03-18 00:50:52 -04:00
parent 5910e7a849
commit 372689fa03

View File

@ -88,55 +88,56 @@ jobs:
shell: powershell shell: powershell
run: | run: |
$env:Path = "$env:EXTRA_PATH;$env:Path" $env:Path = "$env:EXTRA_PATH;$env:Path"
$version = "${{ steps.version.outputs.version }}" $ver = "${{ steps.version.outputs.version }}"
$outName = "Wraith_${ver}_x64-setup.exe"
# Stage files # Stage files
New-Item -ItemType Directory -Force -Path dist-pkg | Out-Null New-Item -ItemType Directory -Force -Path dist-pkg | Out-Null
Copy-Item src-tauri\target\release\Wraith.exe dist-pkg\ Copy-Item src-tauri\target\release\Wraith.exe dist-pkg\
Copy-Item src-tauri\icons\icon.ico dist-pkg\wraith.ico -ErrorAction SilentlyContinue Copy-Item src-tauri\icons\icon.ico dist-pkg\wraith.ico -ErrorAction SilentlyContinue
# Write NSIS script # Write NSIS script — use single-quoted here-string to avoid PS interpolation
@" $nsi = @'
!include "MUI2.nsh" !include "MUI2.nsh"
Name "Wraith" Name "Wraith"
OutFile "Wraith_${version}_x64-setup.exe" OutFile "OUTFILE_PLACEHOLDER"
InstallDir "`$PROGRAMFILES64\Wraith" InstallDir "$PROGRAMFILES64\Wraith"
RequestExecutionLevel admin RequestExecutionLevel admin
!insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "English"
Section "Install" Section "Install"
SetOutPath "`$INSTDIR" SetOutPath "$INSTDIR"
File "Wraith.exe" File "Wraith.exe"
File "wraith.ico" File "wraith.ico"
CreateDirectory "`$SMPROGRAMS\Wraith" CreateDirectory "$SMPROGRAMS\Wraith"
CreateShortcut "`$SMPROGRAMS\Wraith\Wraith.lnk" "`$INSTDIR\Wraith.exe" "" "`$INSTDIR\wraith.ico" CreateShortcut "$SMPROGRAMS\Wraith\Wraith.lnk" "$INSTDIR\Wraith.exe" "" "$INSTDIR\wraith.ico"
CreateShortcut "`$DESKTOP\Wraith.lnk" "`$INSTDIR\Wraith.exe" "" "`$INSTDIR\wraith.ico" CreateShortcut "$DESKTOP\Wraith.lnk" "$INSTDIR\Wraith.exe" "" "$INSTDIR\wraith.ico"
WriteUninstaller "`$INSTDIR\uninstall.exe" WriteUninstaller "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith" "DisplayName" "Wraith" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith" "DisplayName" "Wraith"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith" "UninstallString" "`$INSTDIR\uninstall.exe" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith" "UninstallString" "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith" "DisplayVersion" "${version}" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith" "DisplayVersion" "VER_PLACEHOLDER"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith" "Publisher" "Vigilance Cyber" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith" "Publisher" "Vigilance Cyber"
SectionEnd SectionEnd
Section "Uninstall" Section "Uninstall"
Delete "`$INSTDIR\Wraith.exe" Delete "$INSTDIR\Wraith.exe"
Delete "`$INSTDIR\wraith.ico" Delete "$INSTDIR\wraith.ico"
Delete "`$INSTDIR\uninstall.exe" Delete "$INSTDIR\uninstall.exe"
RMDir "`$INSTDIR" RMDir "$INSTDIR"
Delete "`$SMPROGRAMS\Wraith\Wraith.lnk" Delete "$SMPROGRAMS\Wraith\Wraith.lnk"
RMDir "`$SMPROGRAMS\Wraith" RMDir "$SMPROGRAMS\Wraith"
Delete "`$DESKTOP\Wraith.lnk" Delete "$DESKTOP\Wraith.lnk"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith"
SectionEnd SectionEnd
"@ | Out-File -FilePath dist-pkg\installer.nsi -Encoding ascii '@
$nsi = $nsi.Replace("OUTFILE_PLACEHOLDER", $outName).Replace("VER_PLACEHOLDER", $ver)
$nsi | Out-File -FilePath dist-pkg\installer.nsi -Encoding ascii
# Build installer # Build installer
Push-Location dist-pkg makensis dist-pkg\installer.nsi
makensis installer.nsi Move-Item "dist-pkg\$outName" .
Pop-Location
Move-Item "dist-pkg\Wraith_${version}_x64-setup.exe" .
Write-Host "=== Installer built ===" Write-Host "=== Installer built ==="
Get-ChildItem "Wraith_${version}_x64-setup.exe" Get-ChildItem $outName
- name: Download jsign - name: Download jsign
shell: powershell shell: powershell
@ -162,9 +163,9 @@ jobs:
shell: powershell shell: powershell
run: | run: |
$env:Path = "$env:EXTRA_PATH;$env:Path" $env:Path = "$env:EXTRA_PATH;$env:Path"
$version = "${{ steps.version.outputs.version }}" $ver = "${{ steps.version.outputs.version }}"
Write-Host "=== Signing Wraith binaries ===" Write-Host "=== Signing Wraith binaries ==="
$binaries = @("src-tauri\target\release\Wraith.exe", "Wraith_${version}_x64-setup.exe") $binaries = @("src-tauri\target\release\Wraith.exe", "Wraith_${ver}_x64-setup.exe")
foreach ($path in $binaries) { foreach ($path in $binaries) {
if (Test-Path $path) { if (Test-Path $path) {
Write-Host "Signing: $path" Write-Host "Signing: $path"
@ -185,6 +186,7 @@ jobs:
run: | run: |
$version = "${{ steps.version.outputs.version }}" $version = "${{ steps.version.outputs.version }}"
$installer = Get-Item "Wraith_${version}_x64-setup.exe" $installer = Get-Item "Wraith_${version}_x64-setup.exe"
Write-Host "Installer: $($installer.FullName)"
$hash = (Get-FileHash $installer.FullName -Algorithm SHA256).Hash.ToLower() $hash = (Get-FileHash $installer.FullName -Algorithm SHA256).Hash.ToLower()
$json = @{ $json = @{
version = $version version = $version