Skip to content

Commit 0bafdb6

Browse files
Fix Windows desktop artifact path handling
- Disable Windows npm rebuild and executable editing during packaging - Install production deps without optional packages - Invoke electron-builder through `bun x --install=fallback`
1 parent caaeb69 commit 0bafdb6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎scripts/build-desktop-artifact.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,12 +610,15 @@ const createBuildConfig = Effect.fn("createBuildConfig")(function* (
610610
}
611611

612612
if (platform === "win") {
613+
buildConfig.npmRebuild = false;
613614
const winConfig: Record<string, unknown> = {
614615
target: [target],
615616
icon: "icon.ico",
616617
};
617618
if (signed) {
618619
winConfig.azureSignOptions = yield* AzureTrustedSigningOptionsConfig;
620+
} else {
621+
winConfig.signAndEditExecutable = false;
619622
}
620623
buildConfig.win = winConfig;
621624
}
@@ -811,7 +814,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
811814
...commandOutputOptions(options.verbose),
812815
// Windows needs shell mode to resolve .cmd shims (e.g. bun.cmd).
813816
shell: process.platform === "win32",
814-
})`bun install --production`,
817+
})`bun install --production --omit optional`,
815818
);
816819

817820
const buildEnv: NodeJS.ProcessEnv = {
@@ -851,7 +854,7 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
851854
...commandOutputOptions(options.verbose),
852855
// Windows needs shell mode to resolve .cmd shims.
853856
shell: process.platform === "win32",
854-
})`bunx electron-builder ${platformConfig.cliFlag} --${options.arch} --publish never`,
857+
})`bun x --install=fallback electron-builder ${platformConfig.cliFlag} --${options.arch} --publish never`,
855858
);
856859

857860
const stageDistDir = path.join(stageAppDir, "dist");

0 commit comments

Comments
 (0)