forked from felixrieseberg/windows95
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforge.config.js
127 lines (122 loc) · 3.67 KB
/
forge.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
const { FusesPlugin } = require('@electron-forge/plugin-fuses')
const { FuseV1Options, FuseVersion } = require('@electron/fuses')
const { config } = require('dotenv')
const { resolve } = require('path')
const { execSync } = require('child_process')
const parcelBuild = require('./tools/parcel-build')
const { existsSync } = require('fs')
function initializeEnvironment(updateCodesignFile = false) {
config()
// @joelvaneenwyk #todo
if (updateCodesignFile && process.env['WINDOWS_CODESIGN_FILE']) {
const certPath = path.join(__dirname, 'win-certificate.pfx')
const certExists = existsSync(certPath)
if (certExists) {
process.env['WINDOWS_CODESIGN_FILE'] = certPath
}
}
}
initializeEnvironment()
module.exports = {
hooks: {
prePackage: async () => {
execSync('npm run prePackage')
},
generateAssets: async () => {
return await parcelBuild()
}
},
packagerConfig: {
asar: true,
icon: resolve(__dirname, 'assets', 'icon'),
appBundleId: 'com.joelvaneenwyk.windows95',
appCategoryType: 'public.app-category.developer-tools',
win32metadata: {
CompanyName: 'Felix Rieseberg',
OriginalFilename: 'windows95'
},
linux: {
target: 'zip'
},
osxSign: {
identity: 'Developer ID Application: Felix Rieseberg (LT94ZKYDCJ)',
'hardened-runtime': true,
'gatekeeper-assess': false,
entitlements: 'assets/entitlements.plist',
'entitlements-inherit': 'assets/entitlements.plist',
'signature-flags': 'library'
},
osxNotarize: {
appBundleId: 'com.felixrieseberg.macintoshjs',
appleId: process.env['APPLE_ID'],
appleIdPassword: process.env['APPLE_ID_PASSWORD'],
ascProvider: 'LT94ZKYDCJ'
},
ignore: [
/\/\.github(\/?)/,
/\/\.yarn(\/?)/,
/\/\.vs(\/?)/,
/\/assets(\/?)/,
/\/docs(\/?)/,
/\/tools(\/?)/,
/\/src\/.*\.ts/,
/package-lock\.json/,
/README\.md/,
/tsconfig\.json/,
/Dockerfile/,
/issue_template\.md/
]
},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: (arch) => {
return {
name: 'windows95',
authors: 'Felix Rieseberg',
description: 'The Windows 95 app that runs on macOS, Windows, and Linux.',
exe: 'windows95.exe',
noMsi: true,
remoteReleases: '',
iconUrl:
'https://raw.githubusercontent.com/joelvaneenwyk/windows95/develop/assets/icon.ico',
loadingGif: './assets/boot.gif',
setupExe: `windows95-${package_json.version}-setup-${arch}.exe`,
setupIcon: path.resolve(__dirname, 'assets', 'icon.ico')
//certificateFile: process.env['WINDOWS_CODESIGN_FILE'],
//certificatePassword: process.env['WINDOWS_CODESIGN_PASSWORD']
}
}
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin']
},
{
name: '@electron-forge/maker-deb',
config: {}
},
{
name: '@electron-forge/maker-rpm',
config: {}
}
],
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
})
]
}