-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeInstallers.js
35 lines (29 loc) · 1.09 KB
/
makeInstallers.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
const { createWindowsInstaller } = require('electron-winstaller');
const { join } = require('path');
const { version } = require('./package.json');
const arch = process.argv[2] || 'ia32';
const distPath = join(__dirname, 'dist');
const platformPhrase = `for version ${version} on win32-${arch}`;
console.log(`Now creating Installer ${platformPhrase}... (This might take a while)`);
const appDirectory = join(distPath, `Chatron-win32-${arch}`);
const settings = {
appDirectory,
authors: 'robflop',
outputDirectory: join(appDirectory, '..', 'windows-installer'),
exe: 'Chatron.exe',
setupExe: `ChatronInstaller-${version}-${arch}.exe`,
description: 'Chatron',
noMsi: true,
title: 'Chatron',
iconURL: 'https://github.com/robflop/chatron-client/raw/master/src/icon.ico',
setupIcon: join(appDirectory, '..', '..', 'src', 'icon.ico')
};
createWindowsInstaller(settings)
.then(() => {
console.log(`Installer successfully created ${platformPhrase}`);
process.exit();
})
.catch(e => {
console.log(`An error occurred creating the installer ${platformPhrase}:\n${e.message}`);
process.exit();
});