-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_installer.js
51 lines (43 loc) · 1.76 KB
/
build_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
39
40
41
42
43
44
45
46
47
48
49
50
//import modules
const { MSICreator } = require('electron-wix-msi');
const path = require('path');
//define input and output directory
const APP_DIR = path.resolve(__dirname, './dist_electron/win-unpacked');
const OUT_DIR = path.resolve(__dirname, './windows_installer');
const ICO_PATH = path.resolve(__dirname, './build/icon.ico');
const BANNER_IMG_PATH = path.resolve(__dirname, './public/assets/installer/LinkTailor_Installer_Banner.png');
const BACKGROUND_IMG_PATH = path.resolve(__dirname, './public/assets/installer/LinkTailor_Installer_Background.png');
const INSTALLER_ICO_PATH = path.resolve(__dirname, './public/assets/installer/LinkTailor_Dark_Icon_32.ico');
//instansiate the MSICreator
const msiCreator = new MSICreator({
appDirectory: APP_DIR,
outputDirectory: OUT_DIR,
description: 'The LinkTailor application is for users to save and arrange layouts of links, making it easier for them to access applications, files, and websites.',
exe: 'LinkTailor',
name: 'LinkTailor Desktop Application',
shortName: 'LinkTailor',
shortcutFolderName: 'LinkTailor',
shortcutName: 'LinkTailor',
programFilesFolderName: 'LinkTailor',
appIconPath: ICO_PATH,
manufacturer: 'UC 2021 Senior Design Team 6',
version: '1.0.1',
//configure installer UI
ui: {
chooseDirectory: true,
template: '',
images: {
background: BACKGROUND_IMG_PATH,
banner: BANNER_IMG_PATH,
exclamationIcon: INSTALLER_ICO_PATH,
infoIcon: INSTALLER_ICO_PATH
}
},
});
//create a .wxs tempate file & compile to a .msi file
async function CreateMsi() {
await msiCreator.create();
await msiCreator.compile();
}
CreateMsi();
//msiCreator.create().then(function(){msiCreator.compile()});