diff --git a/.azuredevops/Pipelines/Templates/create-installer.yaml b/.azuredevops/Pipelines/Templates/create-installer.yaml index aa649c4c..34702e16 100644 --- a/.azuredevops/Pipelines/Templates/create-installer.yaml +++ b/.azuredevops/Pipelines/Templates/create-installer.yaml @@ -17,12 +17,15 @@ steps: displayName: Remove empty directories - pwsh: | - nuget install NSIS-Package -Version 3.11.0.2 -OutputDirectory ./packages - $nsis = Get-ChildItem -Path "./packages" -Filter "makensis.exe" -Recurse | Select-Object -First 1 - if (-not $nsis) { - Write-Error "makensis.exe not found in ./packages after nuget install NSIS-Package" + choco install nsis --version 3.12.0 --yes --no-progress --limit-output + if ($LASTEXITCODE -ne 0) { + throw "Chocolatey failed to install NSIS (exit code $LASTEXITCODE)." } - & $nsis.FullName /DPRODUCT_VERSION=$Env:NBGV_SEMVER2 setup/RepoM.nsi + $nsis = Join-Path ${env:ProgramFiles(x86)} "NSIS\makensis.exe" + if (-not (Test-Path -LiteralPath $nsis -PathType Leaf)) { + throw "makensis.exe was not found at '$nsis' after installing NSIS." + } + & $nsis /DPRODUCT_VERSION=$Env:NBGV_SEMVER2 setup/RepoM.nsi displayName: ⚙️ Create installer - task: DeleteFiles@1