From c8eaa790f52a2e2df94e857a03b5388109cf24de Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Wed, 22 Jul 2026 23:10:19 -0700 Subject: [PATCH] fix(release): regenerate Windows blockmap via app-builder-lib JS (#10110) electron-builder 26 dropped the app-builder-bin Go binary, so the signed-installer staging step failed with 'node_modules/app-builder-bin/ win/x64/app-builder.exe is not recognized'. Blockmap generation now lives in app-builder-lib's pure-JS buildBlockMap; call it through a small script in both the release-cut and signing-rehearsal workflows. Co-authored-by: Orca (cherry picked from commit 56101422d26088b37e1f6df9dec951386f6f977f) --- .github/workflows/release-cut.yml | 3 ++- .../workflows/windows-signing-rehearsal.yml | 2 +- config/scripts/generate-windows-blockmap.mjs | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 config/scripts/generate-windows-blockmap.mjs 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})`)