Skip to content

Commit 7b7e6f0

Browse files
authored
Fix NSIS installer (#377)
* Fix nsis installer * Fix syntax * Add to path
1 parent 30c735d commit 7b7e6f0

File tree

1 file changed

+43
-6
lines changed

1 file changed

+43
-6
lines changed

.github/workflows/build.yaml

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,19 +282,56 @@ jobs:
282282
CD deploy
283283
windeployqt.exe --verbose 1 "${{ env.APP_NAME }}.exe"
284284
285-
- name: Install NSIS via Scoop
285+
- name: Install Scoop and NSIS (makensis)
286+
shell: powershell
286287
run: |
287-
iwr -useb get.scoop.sh -outfile 'install.ps1'
288-
.\install.ps1 -RunAsAdmin
288+
# install scoop as current user (no RunAsAdmin)
289+
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
290+
iwr -useb get.scoop.sh | iex
291+
292+
# ensure buckets and update
293+
if (-not (scoop bucket list | Select-String -Quiet '^extras$')) {
294+
scoop bucket add extras
295+
} else {
296+
Write-Host "extras already present"
297+
}
289298
scoop update
290-
scoop bucket add extras
299+
300+
# install packages
291301
scoop install nsis 7zip
292302
293-
- name: Print NSIS version
294-
run: makensis -VERSION
303+
# ensure scoop shims are on PATH for subsequent steps
304+
$scoopShims = Join-Path $env:USERPROFILE 'scoop\shims'
305+
if (Test-Path $scoopShims) {
306+
$env:PATH = "$scoopShims;$env:PATH"
307+
Write-Host "Added scoop shims to PATH: $scoopShims"
308+
} else {
309+
Write-Error "scoop shims not found at $scoopShims"
310+
exit 1
311+
}
312+
313+
# verify
314+
Get-Command scoop -ErrorAction Stop | Format-List Name,Path,Version
315+
Get-Command makensis -ErrorAction Stop | Format-List Name,Path,Version
316+
317+
- name: Add Scoop to PATH
318+
run: |
319+
echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
320+
321+
- name: Print NSIS version (cmd)
322+
shell: cmd
323+
run: |
324+
where makensis
325+
makensis -VERSION
295326
296327
- name: Create NSIS installer
328+
shell: powershell
297329
run: |
330+
# fail early if makensis is missing
331+
if (-not (Get-Command makensis -ErrorAction SilentlyContinue)) {
332+
Write-Error "makensis not found in PATH"
333+
exit 1
334+
}
298335
makensis /DAPP_NAME="${{ env.APP_NAME }}" /DPACKAGE_VERSION="${{ env.PACKAGE_VERSION }}" win-installer.nsi
299336
300337
- name: Rename installer

0 commit comments

Comments
 (0)