/** * @type {import('electron-builder').Configuration} * @see https://www.electron.build/configuration/configuration */ const config = { appId: 'com.gdevelop-app.ide', directories: { app: 'app', buildResources: 'build', output: 'dist', }, extraResources: [ { from: '../app/resources/GDJS', to: 'GDJS', }, { from: '../app/resources/preview_node_modules', to: 'preview_node_modules', }, ], linux: { target: [ { target: 'AppImage', arch: ['x64', 'arm64'], }, { target: 'zip', arch: ['x64', 'arm64'], }, { target: 'deb', arch: ['x64', 'arm64'], }, ], }, mac: { category: 'public.app-category.developer-tools', hardenedRuntime: true, entitlements: './build/entitlements.mac.inherit.plist', target: { target: 'default', arch: ['universal'], }, mergeASARs: false, x64ArchFiles: 'Contents/Resources/app.asar.unpacked/node_modules/steamworks.js/dist/osx/steamworksjs.darwin-*.node', }, win: { executableName: 'GDevelop', target: [ { target: 'nsis', arch: ['x64'] }, { target: 'zip', arch: ['x64'] }, ], }, nsis: { oneClick: false, allowToChangeInstallationDirectory: true, }, appx: { publisherDisplayName: 'GDevelop game engine', displayName: 'GDevelop', publisher: 'CN=B13CB8D3-97AA-422C-A394-0EE51B9ACAD3', identityName: 'GDevelopgameengine.GDevelop', backgroundColor: '#524F9C', languages: [ 'EN-US', 'ZH-HANS', 'DE', 'IT', 'JA', 'PT-BR', 'RU', 'ES', 'FR', 'SL', ], }, afterSign: 'scripts/electron-builder-after-sign.js', publish: [ { provider: 'github', }, ], }; if (process.env.GD_PORTABLE_BUILD === 'true') { config.mac.identity = null; config.mac.hardenedRuntime = false; config.afterSign = undefined; // Exclude .exe from signing so signIf() never reaches signtool. config.win.signExts = ['!.exe']; console.log( 'ℹ️ GD_PORTABLE_BUILD is set — skipping macOS signing/notarization and Windows Authenticode (exe signing).' ); } else if ( process.env.GD_SIGNTOOL_SUBJECT_NAME && process.env.GD_SIGNTOOL_THUMBPRINT ) { config.win.signtoolOptions = {}; config.win.signtoolOptions.certificateSubjectName = process.env.GD_SIGNTOOL_SUBJECT_NAME; config.win.signtoolOptions.certificateSha1 = process.env.GD_SIGNTOOL_THUMBPRINT; // electron-builder default signtool.exe is not sufficient for some reason. if (!process.env.SIGNTOOL_PATH) { console.error( "❌ SIGNTOOL_PATH is not specified - signing won't work with the builtin signtool provided by electron-builder." ); } else { console.log( 'ℹ️ SIGNTOOL_PATH is specified and set to:', process.env.SIGNTOOL_PATH ); } // Seems required, see https://github.com/electron-userland/electron-builder/issues/6158#issuecomment-1587045539. config.win.signtoolOptions.signingHashAlgorithms = ['sha256']; console.log( 'ℹ️ Set Windows build signing options:', config.win.signtoolOptions ); } else { console.log('ℹ️ No Windows build signing options set.'); } module.exports = config;