diff --git a/.github/workflows/release-cut.yml b/.github/workflows/release-cut.yml index 2c48d466305..0142518c4cb 100644 --- a/.github/workflows/release-cut.yml +++ b/.github/workflows/release-cut.yml @@ -1330,7 +1330,8 @@ jobs: } Copy-Item -Path $signedInstaller.FullName -Destination 'dist/orca-windows-setup.exe' -Force - & 'node_modules/app-builder-bin/win/x64/app-builder.exe' blockmap --input 'dist/orca-windows-setup.exe' --output 'dist/orca-windows-setup.exe.blockmap' + node config/scripts/generate-windows-blockmap.mjs 'dist/orca-windows-setup.exe' 'dist/orca-windows-setup.exe.blockmap' + if ($LASTEXITCODE -ne 0) { throw "blockmap generation failed with exit code $LASTEXITCODE" } $installer = Get-Item 'dist/orca-windows-setup.exe' $blockmap = Get-Item 'dist/orca-windows-setup.exe.blockmap' diff --git a/.github/workflows/windows-signing-rehearsal.yml b/.github/workflows/windows-signing-rehearsal.yml index 24b4307a83b..4ca080d803d 100644 --- a/.github/workflows/windows-signing-rehearsal.yml +++ b/.github/workflows/windows-signing-rehearsal.yml @@ -271,7 +271,7 @@ jobs: throw 'Signed Windows installer was not returned by SignPath.' } Copy-Item -Path $signedInstaller.FullName -Destination 'dist/orca-windows-setup.exe' -Force - & 'node_modules/app-builder-bin/win/x64/app-builder.exe' blockmap --input 'dist/orca-windows-setup.exe' --output 'dist/orca-windows-setup.exe.blockmap' + node config/scripts/generate-windows-blockmap.mjs 'dist/orca-windows-setup.exe' 'dist/orca-windows-setup.exe.blockmap' if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } $installer = Get-Item 'dist/orca-windows-setup.exe' diff --git a/config/scripts/generate-windows-blockmap.mjs b/config/scripts/generate-windows-blockmap.mjs new file mode 100644 index 00000000000..7444a7b43dc --- /dev/null +++ b/config/scripts/generate-windows-blockmap.mjs @@ -0,0 +1,18 @@ +// Regenerate the electron-updater `.blockmap` for a (re-signed) Windows installer. +// electron-builder 26 dropped the app-builder-bin Go binary; blockmap generation +// now lives in app-builder-lib's pure-JS `buildBlockMap`. Mirrors createBlockmap's +// "gzip" format for the standalone NSIS installer blockmap. +import { createRequire } from 'node:module' + +const require = createRequire(import.meta.url) + +const [input, output] = process.argv.slice(2) +if (!input || !output) { + console.error('usage: generate-windows-blockmap.mjs ') + process.exit(1) +} + +const { buildBlockMap } = require('app-builder-lib/out/targets/blockmap/blockmap') + +const info = await buildBlockMap(input, 'gzip', output) +console.log(`blockmap written: ${output} (installer sha512=${info.sha512}, size=${info.size})`)