-
-
Notifications
You must be signed in to change notification settings - Fork 292
/
Copy pathinstaller.js
executable file
·38 lines (33 loc) · 1.19 KB
/
installer.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
#!/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, 'out')
return Promise.resolve({
appDirectory: path.join(outPath, 'Electron API Demos-win32-ia32'),
exe: 'Electron API Demos.exe',
iconUrl: 'https://raw.githubusercontent.com/electron/electron-api-demos/master/assets/app-icon/win/app.ico',
loadingGif: path.join(rootPath, 'assets', 'img', 'loading.gif'),
noMsi: true,
outputDirectory: path.join(outPath, 'windows-installer'),
setupExe: 'ElectronAPIDemosSetup.exe',
setupIcon: path.join(rootPath, 'assets', 'app-icon', 'win', 'app.ico'),
skipUpdateIcon: true
})
}
function deleteOutputFolder () {
return new Promise((resolve, reject) => {
rimraf(path.join(__dirname, '..', 'out', 'windows-installer'), (error) => {
error ? reject(error) : resolve()
})
})
}