Skip to content

Commit

Permalink
Fix fuses for other platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacingBat3 committed Mar 7, 2022
1 parent 9833af8 commit 792e360
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions sources/code/build/forge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ const env = {
build: process.env.WEBCORD_BUILD?.toLocaleLowerCase()
}

function getElectronPath(platform:string) {
switch (platform) {
case "darwin":
return "Electron.app/Contents/MacOS/Electron"
case "win32":
return "electron.exe"
default:
return "electron"
}
}

function getBuildID() {
switch(env.build) {
case "release":
Expand Down Expand Up @@ -169,9 +180,9 @@ const config: ForgeConfigFile = {
writeFileSync(resolve(path, 'buildInfo.json'), JSON.stringify(buildConfig, null, 2))
return Promise.resolve();
},
packageAfterExtract: (_ForgeConfig, path:string) =>
packageAfterExtract: (_ForgeConfig, path:string, _electronVersion: string, platform: string) =>
// Hardened Electron binary via Electron Fuses feature.
flipFuses(resolve(path, 'electron'), {
flipFuses(resolve(path, getElectronPath(platform)), {
version: FuseVersion.V1,
[FuseV1Options.OnlyLoadAppFromAsar]: env.asar !== "false",
[FuseV1Options.RunAsNode]: false,
Expand Down

0 comments on commit 792e360

Please sign in to comment.