2019-04-23 14:35:07 -07:00
|
|
|
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(),
|
|
|
|
config: {
|
2019-09-05 13:08:47 -07:00
|
|
|
appId: 'helioslauncher',
|
|
|
|
productName: 'Helios Launcher',
|
2020-05-11 16:32:39 -07:00
|
|
|
artifactName: '${productName}-setup-${version}.${ext}',
|
2020-01-17 01:42:16 -08:00
|
|
|
copyright: 'Copyright © 2018-2020 Daniel Scalzi',
|
2019-04-23 14:35:07 -07:00
|
|
|
directories: {
|
|
|
|
buildResources: 'build',
|
|
|
|
output: 'dist'
|
|
|
|
},
|
|
|
|
win: {
|
|
|
|
target: [
|
|
|
|
{
|
|
|
|
target: 'nsis',
|
|
|
|
arch: 'x64'
|
|
|
|
}
|
2019-09-05 13:08:47 -07:00
|
|
|
]
|
2019-04-23 14:35:07 -07:00
|
|
|
},
|
|
|
|
nsis: {
|
|
|
|
oneClick: false,
|
2019-09-05 13:08:47 -07:00
|
|
|
perMachine: false,
|
2019-04-23 14:35:07 -07:00
|
|
|
allowElevation: true,
|
|
|
|
allowToChangeInstallationDirectory: true
|
|
|
|
},
|
|
|
|
mac: {
|
|
|
|
target: 'dmg',
|
2019-09-05 13:08:47 -07:00
|
|
|
category: 'public.app-category.games'
|
2019-04-23 14:35:07 -07:00
|
|
|
},
|
|
|
|
linux: {
|
|
|
|
target: 'AppImage',
|
|
|
|
maintainer: 'Daniel Scalzi',
|
|
|
|
vendor: 'Daniel Scalzi',
|
|
|
|
synopsis: 'Modded Minecraft Launcher',
|
|
|
|
description: 'Custom launcher which allows users to join modded servers. All mods, configurations, and updates are handled automatically.',
|
|
|
|
category: 'Game'
|
|
|
|
},
|
|
|
|
compression: 'maximum',
|
|
|
|
files: [
|
|
|
|
'!{dist,.gitignore,.vscode,docs,dev-app-update.yml,.travis.yml,.nvmrc,.eslintrc.json,build.js}'
|
|
|
|
],
|
|
|
|
extraResources: [
|
|
|
|
'libraries'
|
|
|
|
],
|
|
|
|
asar: true
|
|
|
|
}
|
|
|
|
}).then(() => {
|
|
|
|
console.log('Build complete!')
|
|
|
|
}).catch(err => {
|
|
|
|
console.error('Error during build!', err)
|
|
|
|
})
|