Update Build-Electron to use Windows Powershell

Instead of PS Core, which has a build error finding installed certs
This commit is contained in:
Jaifroid 2025-05-13 07:51:53 +01:00
parent ba49410b98
commit bbe548a3a7

View File

@ -133,13 +133,16 @@ if ($electronbuild -eq "local" -and (-not $portableonly)) {
if ($winonly -eq "appx") { if ($winonly -eq "appx") {
"[Only building the appx package because -winonly appx was specified]" "[Only building the appx package because -winonly appx was specified]"
if ($skipsigning -or $buildstorerelease) { if ($skipsigning -or $buildstorerelease) {
npx electron-builder build --config ../scripts/electronBuilder.cjs --win appx --publish never --projectDir dist "Building unsigned appx package..."
powershell.exe -Command "npx electron-builder build --config ../scripts/electronBuilder.cjs --win appx --publish never --projectDir dist"
} else { } else {
npx electron-builder --win appx --projectDir dist # There is a bug in electron-builder that prevents discovery of the appx signing certificate if running in PS Core
# So we need to run the command in Windows PowerShell. See electron-userland/electron-builder#7729 and #8055
powershell.exe -Command "npx electron-builder --win appx --projectDir dist"
} }
} else { } else {
if ($skipsigning -or $buildstorerelease) { if ($skipsigning -or $buildstorerelease) {
npx electron-builder build --config ../scripts/electronBuilder.cjs --win --publish never --projectDir dist powershell.exe -Command "npx electron-builder build --config ../scripts/electronBuilder.cjs --win --publish never --projectDir dist"
} else { } else {
npm run dist-win npm run dist-win
} }