Description
const { FusesPlugin } = require('@electron-forge/plugin-fuses');
const { FuseV1Options, FuseVersion } = require('@electron/fuses');
const forgeConfigMac = require('./forge-config-mac');
const forgeConfigWin = require('./forge-config-win');
const { logMessage } = require('./util');
if (process.platform === 'darwin') {
logMessage('Loading macOS Forge config');
logMessage(JSON.stringify(forgeConfigMac, null, 2));
forgeConfigMac.plugins = [
new FusesPlugin({
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
[FuseV1Options.OnlyLoadAppFromAsar]: true,
[FuseV1Options.LoadBrowserProcessSpecificV8Snapshot]: true,
}),
];
module.exports = forgeConfigMac;
} else if (process.platform === 'win32') {
logMessage('Loading Windows Forge config');
logMessage(JSON.stringify(forgeConfigWin, null, 2));
forgeConfigWin.plugins = [
new FusesPlugin({
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
[FuseV1Options.OnlyLoadAppFromAsar]: true,
[FuseV1Options.LoadBrowserProcessSpecificV8Snapshot]: true,
}),
];
module.exports = forgeConfigWin;
}
As shown in the above sample code we are generating the packaging using Electro Forge.
After this App launch is successful also we can read the properties through the command line
like npx @electron/fuses read --app app-name
Now we are trying to modify the same properties by using the CLI
npx @electron/fuses write --app "appname.exe" EnableEmbeddedAsarIntegrityValidation=off
The expected behavior is the app launch should fail as we rewrite the properties through the command line but in Windows, the app Launch is successful after writing the properties whereas in Mac the app Launch fails if we rewrite the properties through the command line
The issue exists only in Windows