fix: move NSIS script to template file — avoid YAML !include parse error
All checks were successful
Build & Sign Wraith / Build Windows + Sign (push) Successful in 2m43s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell 2026-03-18 02:01:42 -04:00
parent 348d8c842d
commit 15ee82ef53
2 changed files with 40 additions and 47 deletions

View File

@ -65,57 +65,19 @@ jobs:
$env:Path = "$env:EXTRA_PATH;$env:Path" $env:Path = "$env:EXTRA_PATH;$env:Path"
$ver = ("${{ github.ref_name }}" -replace '^v','') $ver = ("${{ github.ref_name }}" -replace '^v','')
$outExe = "Wraith_" + $ver + "_x64-setup.exe" $outExe = "Wraith_" + $ver + "_x64-setup.exe"
$workDir = (Get-Location).Path
New-Item -ItemType Directory -Force -Path "$workDir\dist-pkg" | Out-Null New-Item -ItemType Directory -Force -Path dist-pkg | Out-Null
Copy-Item "$workDir\src-tauri\target\release\Wraith.exe" "$workDir\dist-pkg\" Copy-Item src-tauri\target\release\Wraith.exe dist-pkg\
Copy-Item "$workDir\src-tauri\icons\icon.ico" "$workDir\dist-pkg\wraith.ico" -ErrorAction SilentlyContinue Copy-Item src-tauri\icons\icon.ico dist-pkg\wraith.ico -ErrorAction SilentlyContinue
$nsiContent = @' $nsi = Get-Content src-tauri\installer.nsi.template -Raw
!include "MUI2.nsh" $nsi = $nsi.Replace("OUTFILE_PLACEHOLDER", $outExe).Replace("VER_PLACEHOLDER", $ver)
Name "Wraith" [System.IO.File]::WriteAllText((Join-Path (Get-Location) "dist-pkg\installer.nsi"), $nsi)
OutFile "OUTFILE_PLACEHOLDER"
InstallDir "$PROGRAMFILES64\Wraith"
RequestExecutionLevel admin
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Section "Install"
SetOutPath "$INSTDIR"
File "Wraith.exe"
File "wraith.ico"
CreateDirectory "$SMPROGRAMS\Wraith"
CreateShortcut "$SMPROGRAMS\Wraith\Wraith.lnk" "$INSTDIR\Wraith.exe" "" "$INSTDIR\wraith.ico"
CreateShortcut "$DESKTOP\Wraith.lnk" "$INSTDIR\Wraith.exe" "" "$INSTDIR\wraith.ico"
WriteUninstaller "$INSTDIR\uninstall.exe"
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" "DisplayVersion" "VER_PLACEHOLDER"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith" "Publisher" "Vigilance Cyber"
SectionEnd
Section "Uninstall"
Delete "$INSTDIR\Wraith.exe"
Delete "$INSTDIR\wraith.ico"
Delete "$INSTDIR\uninstall.exe"
RMDir "$INSTDIR"
Delete "$SMPROGRAMS\Wraith\Wraith.lnk"
RMDir "$SMPROGRAMS\Wraith"
Delete "$DESKTOP\Wraith.lnk"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith"
SectionEnd
'@
$nsiContent = $nsiContent.Replace("OUTFILE_PLACEHOLDER", $outExe).Replace("VER_PLACEHOLDER", $ver)
[System.IO.File]::WriteAllText("$workDir\dist-pkg\installer.nsi", $nsiContent)
Write-Host "=== NSIS script written ===" & makensis (Join-Path (Get-Location) "dist-pkg\installer.nsi")
Write-Host "Working dir: $workDir" Move-Item "dist-pkg\$outExe" .
Write-Host "OutFile: $outExe"
Get-ChildItem "$workDir\dist-pkg\"
& makensis "$workDir\dist-pkg\installer.nsi"
Move-Item "$workDir\dist-pkg\$outExe" "$workDir\"
Write-Host "=== Installer built ===" Write-Host "=== Installer built ==="
Get-ChildItem "$workDir\$outExe" Get-ChildItem $outExe
- name: Download jsign - name: Download jsign
shell: powershell shell: powershell

View File

@ -0,0 +1,31 @@
!include "MUI2.nsh"
Name "Wraith"
OutFile "OUTFILE_PLACEHOLDER"
InstallDir "$PROGRAMFILES64\Wraith"
RequestExecutionLevel admin
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Section "Install"
SetOutPath "$INSTDIR"
File "Wraith.exe"
File "wraith.ico"
CreateDirectory "$SMPROGRAMS\Wraith"
CreateShortcut "$SMPROGRAMS\Wraith\Wraith.lnk" "$INSTDIR\Wraith.exe" "" "$INSTDIR\wraith.ico"
CreateShortcut "$DESKTOP\Wraith.lnk" "$INSTDIR\Wraith.exe" "" "$INSTDIR\wraith.ico"
WriteUninstaller "$INSTDIR\uninstall.exe"
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" "DisplayVersion" "VER_PLACEHOLDER"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith" "Publisher" "Vigilance Cyber"
SectionEnd
Section "Uninstall"
Delete "$INSTDIR\Wraith.exe"
Delete "$INSTDIR\wraith.ico"
Delete "$INSTDIR\uninstall.exe"
RMDir "$INSTDIR"
Delete "$SMPROGRAMS\Wraith\Wraith.lnk"
RMDir "$SMPROGRAMS\Wraith"
Delete "$DESKTOP\Wraith.lnk"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Wraith"
SectionEnd