diff --git a/package.json b/package.json index 0150b7f6..20d1a9d1 100644 --- a/package.json +++ b/package.json @@ -120,6 +120,14 @@ "appId": "org.jtklein.raxmlGUI2", "productName": "raxmlGUI", "afterSign": "./scripts/notarize.js", + "electronFuses": { + "runAsNode": false, + "enableCookieEncryption": true, + "enableNodeOptionsEnvironmentVariable": false, + "enableNodeCliInspectArguments": false, + "enableEmbeddedAsarIntegrityValidation": true, + "onlyLoadAppFromAsar": true + }, "extends": null, "directories": { "buildResources": "public", diff --git a/src/pack.test.ts b/src/pack.test.ts index b77fee50..e645655c 100644 --- a/src/pack.test.ts +++ b/src/pack.test.ts @@ -4,7 +4,7 @@ import path from 'path'; import { getConfig } from 'app-builder-lib/out/util/config/config'; import type { FileSet } from 'app-builder-lib'; -import { scripts } from '../package.json'; +import { build, scripts } from '../package.json'; // electron-builder does not declare its pack matchers, so they load untyped. const { getMainFileMatchers, getNodeModuleFileMatcher } = require( 'app-builder-lib/out/fileMatcher' ); @@ -101,6 +101,17 @@ it( 'packs the built shell and the production dependencies', async () => { ] ); } ); +it( 'sets the Electron Fuses of the packaged app', () => { + expect( build.electronFuses ).toEqual( { + runAsNode: false, + enableCookieEncryption: true, + enableNodeOptionsEnvironmentVariable: false, + enableNodeCliInspectArguments: false, + enableEmbeddedAsarIntegrityValidation: true, + onlyLoadAppFromAsar: true, + } ); +} ); + it( 'pack scripts build the shell, then run electron-builder', () => { expect( scripts.build ).toBe( 'electron-vite build' );