2020-02-16 18:30:00 +00:00
|
|
|
const os = require('os')
|
|
|
|
const builder = require('electron-builder')
|
|
|
|
|
|
|
|
const Platform = builder.Platform
|
|
|
|
const { name, productName } = require('../package.json')
|
|
|
|
|
|
|
|
let targets
|
|
|
|
var platform = os.platform()
|
|
|
|
|
|
|
|
if (platform == 'darwin') {
|
|
|
|
targets = Platform.MAC.createTarget()
|
|
|
|
} else if (platform == 'win32') {
|
|
|
|
targets = Platform.WINDOWS.createTarget()
|
|
|
|
} else if (platform == 'linux') {
|
|
|
|
targets = Platform.LINUX.createTarget()
|
|
|
|
}
|
|
|
|
|
|
|
|
const config = {
|
|
|
|
appId: `io.freetubeapp.${name}`,
|
2020-05-28 02:48:41 +00:00
|
|
|
copyright: 'Copyleft © 2020 freetubeapp@protonmail.com',
|
2020-02-16 18:30:00 +00:00
|
|
|
// asar: false,
|
|
|
|
// compression: 'store',
|
2020-03-24 13:22:29 +00:00
|
|
|
productName,
|
2020-02-16 18:30:00 +00:00
|
|
|
directories: {
|
|
|
|
output: './build/',
|
|
|
|
},
|
2020-05-28 03:01:14 +00:00
|
|
|
files: ['_icons/iconColor.*', './dist/**/*', '!./dist/web/**/*'],
|
2020-02-16 18:30:00 +00:00
|
|
|
dmg: {
|
|
|
|
contents: [
|
|
|
|
{
|
|
|
|
path: '/Applications',
|
|
|
|
type: 'link',
|
|
|
|
x: 410,
|
|
|
|
y: 230,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'file',
|
|
|
|
x: 130,
|
|
|
|
y: 230,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
window: {
|
|
|
|
height: 380,
|
|
|
|
width: 540,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
linux: {
|
2020-03-25 08:05:40 +00:00
|
|
|
category: 'Network',
|
2020-05-28 03:01:14 +00:00
|
|
|
icon: '_icons/icon.png',
|
|
|
|
target: ['deb', 'rpm', 'zip', 'AppImage'],
|
2020-07-12 17:53:34 +00:00
|
|
|
arch: [
|
|
|
|
'x64',
|
|
|
|
'arm64'
|
|
|
|
]
|
2020-02-16 18:30:00 +00:00
|
|
|
},
|
|
|
|
mac: {
|
|
|
|
category: 'public.app-category.utilities',
|
2020-05-27 23:01:44 +00:00
|
|
|
icon: '_icons/iconColor.icns',
|
2020-02-16 18:30:00 +00:00
|
|
|
target: ['dmg', 'zip'],
|
|
|
|
type: 'distribution',
|
|
|
|
},
|
|
|
|
win: {
|
2020-05-27 23:01:44 +00:00
|
|
|
icon: '_icons/iconColor.ico',
|
2020-05-27 21:18:04 +00:00
|
|
|
target: ['nsis', 'zip', 'portable', 'squirrel'],
|
2020-02-16 18:30:00 +00:00
|
|
|
},
|
|
|
|
nsis: {
|
|
|
|
allowToChangeInstallationDirectory: true,
|
|
|
|
oneClick: false,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
builder
|
|
|
|
.build({
|
|
|
|
targets,
|
|
|
|
config,
|
|
|
|
})
|
|
|
|
.then(m => {
|
|
|
|
console.log(m)
|
|
|
|
})
|
|
|
|
.catch(e => {
|
|
|
|
console.error(e)
|
|
|
|
})
|