Implement installers via electron-builder
This commit is contained in:
38
script/installer.js
Normal file
38
script/installer.js
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const createWindowsInstaller = require('electron-winstaller').createWindowsInstaller
|
||||
const path = require('path')
|
||||
const rimraf = require('rimraf')
|
||||
|
||||
deleteOutputFolder()
|
||||
.then(getInstallerConfig)
|
||||
.then(createWindowsInstaller)
|
||||
.catch((error) => {
|
||||
console.error(error.message || error)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
function getInstallerConfig() {
|
||||
const rootPath = path.join(__dirname, '..')
|
||||
const outPath = path.join(rootPath, 'release')
|
||||
|
||||
return Promise.resolve({
|
||||
appDirectory: path.join(outPath, 'Mattermost-win32-x64'),
|
||||
iconUrl: 'https://raw.githubusercontent.com/mattermost/desktop/master/resources/icon.ico',
|
||||
//loadingGif: path.join(rootPath, 'assets', 'img', 'loading.gif'),
|
||||
noMsi: true,
|
||||
outputDirectory: path.join(outPath, 'windows-installer'),
|
||||
setupExe: 'Mattermost.exe',
|
||||
setupIcon: path.join(rootPath, 'resources', 'icon.ico'),
|
||||
skipUpdateIcon: true,
|
||||
exe: 'Mattermost.exe'
|
||||
})
|
||||
}
|
||||
|
||||
function deleteOutputFolder() {
|
||||
return new Promise((resolve, reject) => {
|
||||
rimraf(path.join(__dirname, '..', 'out', 'windows-installer'), (error) => {
|
||||
error ? reject(error) : resolve()
|
||||
})
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user