forked from dscalzi/HeliosLauncher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.js
91 lines (89 loc) · 2.66 KB
/
build.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
const builder = require('electron-builder')
const Platform = builder.Platform
function getCurrentPlatform() {
switch (process.platform) {
case 'win32':
return Platform.WINDOWS
case 'darwin':
return Platform.MAC
case 'linux':
return Platform.linux
default:
console.error('Cannot resolve current platform!')
return undefined
}
}
builder.build({
targets: (process.argv[2] != null && Platform[process.argv[2]] != null ? Platform[process.argv[2]] : getCurrentPlatform()).createTarget(),
publish: 'always',
config: {
generateUpdatesFilesForAllChannels: true,
appId: 'nblade.bladelauncher',
productName: 'BladeLauncher',
artifactName: 'BladeLauncher-setup.${ext}',
copyright: 'Copyright © 2019-2021 N-Blade LLC',
directories: {
buildResources: 'build',
output: 'dist'
},
publish: [{
provider: 'github',
releaseType: 'release',
}],
win: {
icon: 'app/assets/images/SealCircle.ico',
target: [
{
target: 'nsis',
arch: [
// 'x64',
'ia32'
]
}
],
legalTrademarks: 'N-blade',
sign: './sign.js',
signAndEditExecutable: true,
signDlls: true,
extraResources: [
'tools/win'
],
},
nsis: {
oneClick: true,
perMachine: false,
allowElevation: true,
allowToChangeInstallationDirectory: false,
deleteAppDataOnUninstall: true,
language: '1049'
},
mac: {
target: 'dmg',
category: 'public.app-category.games'
},
linux: {
icon: 'build/icon.png',
target: [
'pacman',
'deb'
],
maintainer: 'N-Blade LLC',
vendor: 'N-Blade LLC',
synopsis: 'Northern Blade Launcher',
description: 'Game launcher which allows users to join servers and handle updates automatically.',
category: 'Game',
extraResources: [
'tools/linux'
],
},
compression: 'maximum',
files: [
'!{dist,.gitignore,.vscode,docs,dev-app-update.yml,.travis.yml,.nvmrc,.eslintrc.json,build.js}'
],
asar: true
}
}).then(() => {
console.log('Build complete!')
}).catch(err => {
console.error('Error during build!', err)
})