2024-10-04 17:13:36 -05:00
|
|
|
const fs = require('fs');
|
|
|
|
const yargs = require('yargs/yargs');
|
|
|
|
const { hideBin } = require('yargs/helpers');
|
|
|
|
|
2024-09-17 09:28:05 -05:00
|
|
|
const { FusesPlugin } = require('@electron-forge/plugin-fuses');
|
|
|
|
const { FuseV1Options, FuseVersion } = require('@electron/fuses');
|
|
|
|
|
2024-10-04 17:13:36 -05:00
|
|
|
const argv = yargs(hideBin(process.argv)).argv;
|
|
|
|
|
2024-09-17 09:28:05 -05:00
|
|
|
module.exports = {
|
|
|
|
packagerConfig: {
|
|
|
|
asar: true,
|
2024-10-04 17:13:36 -05:00
|
|
|
icon: './assets/icons/icon',
|
|
|
|
name: 'FCast Receiver',
|
|
|
|
osxSign: {},
|
2024-09-17 09:28:05 -05:00
|
|
|
osxNotarize: {
|
2024-10-02 12:11:35 -05:00
|
|
|
appleApiKey: process.env.FCAST_APPLE_API_KEY,
|
|
|
|
appleApiKeyId: process.env.FCAST_APPLE_API_KEY_ID,
|
|
|
|
appleApiIssuer: process.env.FCAST_APPLE_API_ISSUER
|
2024-09-17 09:28:05 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
rebuildConfig: {},
|
|
|
|
makers: [
|
2024-10-01 14:49:11 -05:00
|
|
|
// {
|
|
|
|
// name: '@electron-forge/maker-squirrel',
|
|
|
|
// config: {},
|
|
|
|
// },
|
2024-10-04 17:13:36 -05:00
|
|
|
{
|
|
|
|
name: '@electron-forge/maker-dmg',
|
|
|
|
config: {
|
|
|
|
additionalDMGOptions: {
|
|
|
|
window: {
|
|
|
|
position: {
|
|
|
|
x: 425,
|
|
|
|
y: 275
|
|
|
|
},
|
|
|
|
size: {
|
|
|
|
width: 640,
|
|
|
|
height: 480
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
background: './assets/images/background.png',
|
|
|
|
contents: [
|
|
|
|
{ 'x': 90, 'y': 350, 'type': 'file', 'path': `out/FCast Receiver-darwin-${argv.arch}/FCast Receiver.app` },
|
|
|
|
{ 'x': 360, 'y': 350, 'type': 'link', 'path': '/Applications' },
|
|
|
|
{ 'x': 0, 'y': 540, 'type': 'position', 'path': '.background' },
|
|
|
|
{ 'x': 120, 'y': 540, 'type': 'position', 'path': '.VolumeIcon.icns' }
|
|
|
|
],
|
|
|
|
format: 'ULFO',
|
|
|
|
icon: './assets/icons/icon.icns',
|
|
|
|
name: 'FCast Receiver'
|
|
|
|
}
|
|
|
|
},
|
2024-09-17 09:28:05 -05:00
|
|
|
{
|
|
|
|
name: '@electron-forge/maker-zip',
|
|
|
|
platforms: ['win32', 'darwin', 'linux'],
|
2024-10-04 17:13:36 -05:00
|
|
|
config: {}
|
2024-09-17 09:28:05 -05:00
|
|
|
},
|
2024-10-01 14:49:11 -05:00
|
|
|
// {
|
2024-10-01 21:43:23 -05:00
|
|
|
|
2024-10-01 14:49:11 -05:00
|
|
|
// name: '@electron-forge/maker-deb',
|
|
|
|
// config: {},
|
|
|
|
// },
|
|
|
|
// {
|
|
|
|
// name: '@electron-forge/maker-rpm',
|
|
|
|
// config: {},
|
|
|
|
// },
|
2024-09-17 09:28:05 -05:00
|
|
|
],
|
2024-10-04 17:13:36 -05:00
|
|
|
hooks: {
|
|
|
|
postMake: async (forgeConfig, makeResults) => {
|
|
|
|
makeResults.forEach(e => {
|
|
|
|
// Standardize artifact output naming
|
|
|
|
switch (e.platform) {
|
|
|
|
case "win32":
|
|
|
|
break;
|
|
|
|
case "darwin": {
|
|
|
|
let artifactName = 'FCast Receiver.dmg';
|
|
|
|
if (fs.existsSync(`./out/make/${artifactName}`)) {
|
|
|
|
fs.renameSync(`./out/make/${artifactName}`, `./out/make/FCast-Receiver-${e.packageJSON.version}-macOS-${e.arch}.dmg`);
|
|
|
|
}
|
|
|
|
|
|
|
|
artifactName = 'FCast Receiver-darwin-arm64-1.0.14.zip';
|
|
|
|
if (fs.existsSync(`./out/make/zip/darwin/arm64/${artifactName}`)) {
|
|
|
|
fs.renameSync(`./out/make/zip/darwin/arm64/${artifactName}`, `./out/make/zip/darwin/arm64/FCast-Receiver-${e.packageJSON.version}-macOS-${e.arch}.zip`);
|
|
|
|
}
|
|
|
|
|
|
|
|
artifactName = 'FCast Receiver-darwin-x64-1.0.14.zip';
|
|
|
|
if (fs.existsSync(`./out/make/zip/darwin/x64/${artifactName}`)) {
|
|
|
|
fs.renameSync(`./out/make/zip/darwin/x64/${artifactName}`, `./out/make/zip/darwin/x64/FCast-Receiver-${e.packageJSON.version}-macOS-${e.arch}.zip`);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case "linux":
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
2024-09-17 09:28:05 -05:00
|
|
|
plugins: [
|
|
|
|
{
|
|
|
|
name: '@electron-forge/plugin-auto-unpack-natives',
|
|
|
|
config: {},
|
|
|
|
},
|
|
|
|
// Fuses are used to enable/disable various Electron functionality
|
|
|
|
// at package time, before code signing the application
|
|
|
|
new FusesPlugin({
|
|
|
|
version: FuseVersion.V1,
|
|
|
|
[FuseV1Options.RunAsNode]: false,
|
|
|
|
[FuseV1Options.EnableCookieEncryption]: true,
|
|
|
|
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
|
|
|
|
[FuseV1Options.EnableNodeCliInspectArguments]: false,
|
|
|
|
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
|
|
|
|
[FuseV1Options.OnlyLoadAppFromAsar]: true,
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
};
|