Skip to content

Commit 0186397

Browse files
authored
fix: skip resedit manifest embed on Windows arm64 builds (#556)
- afterPack leaves stock Electron PE on win-arm64-unpacked; resedit regenerate() can pass CI validation yet fail to materialize Mesh-client.exe during NSIS install on Windows 11 ARM. - x64 builds still embed longPathAware via resedit; contract test asserts the arm64 skip path. WoA installs were leaving support files and shortcuts but no main executable even with per-arch NSIS installers; arm64 no longer rewrites the PE at pack time.
1 parent 713df47 commit 0186397

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

scripts/electron-builder-after-pack.cjs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
const fs = require('fs');
1111
const path = require('path');
1212

13+
const { Arch } = require('builder-util');
14+
1315
// Ref: https://learn.microsoft.com/en-us/windows/win32/menurc/resource-types
1416
const RT_MANIFEST_TYPE = 24;
1517

@@ -18,6 +20,17 @@ module.exports = async function electronBuilderAfterPack(context) {
1820
return;
1921
}
2022

23+
const exeName = `${context.packager.appInfo.productFilename}.exe`;
24+
const exePath = path.join(context.appOutDir, exeName);
25+
26+
// resedit regenerate() can produce an ARM64 PE that passes Node parsing but fails to
27+
// materialize during NSIS install on Windows 11 ARM (support files land, exe missing).
28+
// Keep stock Electron manifest on arm64; longPathAware remains on x64 builds.
29+
if (context.arch === Arch.arm64) {
30+
console.debug(`[afterPack] Skipping resedit manifest embed on arm64: ${exePath}`);
31+
return;
32+
}
33+
2134
const manifestPath = path.join(
2235
__dirname,
2336
'..',
@@ -29,8 +42,6 @@ module.exports = async function electronBuilderAfterPack(context) {
2942
throw new Error(`[afterPack] Missing manifest: ${manifestPath}`);
3043
}
3144

32-
const exeName = `${context.packager.appInfo.productFilename}.exe`;
33-
const exePath = path.join(context.appOutDir, exeName);
3445
if (!fs.existsSync(exePath)) {
3546
throw new Error(`[afterPack] Missing Windows app exe: ${exePath}`);
3647
}

src/main/windows-long-path-manifest.contract.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ describe('Windows long-path application manifest (packaging contract)', () => {
1717
expect(hook).toContain('resedit');
1818
expect(hook).toMatch(/RT_MANIFEST_TYPE|type === 24/);
1919
expect(hook).toContain('mesh-client-long-path.manifest.xml');
20+
expect(hook).toContain('Arch.arm64');
21+
expect(hook).toContain('Skipping resedit manifest embed on arm64');
2022
expect(hook).toContain('renameSync');
2123
expect(hook).toMatch(/\.tmp['"`]/);
2224

0 commit comments

Comments
 (0)