-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-windows-installer.js
37 lines (34 loc) · 1.29 KB
/
build-windows-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
let { MSICreator } = require('electron-wix-msi');
let packageInfo = require('./package.json');
let arches = ['ia32', 'x64'];
arches.forEach(function (arch) {
console.log(`[${arch}] Start Building...`);
// Step 1: Instantiate the MSICreator
const msiCreator = new MSICreator({
appDirectory: `${process.env.PWD}/build/MOAI-win32-${arch}`,
outputDirectory: `${process.env.PWD}/build/MOAI-win32-${arch}-installer`,
description: packageInfo.description,
exe: packageInfo.productName,
name: packageInfo.productName,
manufacturer: packageInfo.productName,
version: packageInfo.version,
ui: {
chooseDirectory: true,
images: {
background: `${process.env.PWD}/images/WixUIDialogBmp.png`,
banner: `${process.env.PWD}/images/WixUIBannerBmp.png`,
exclamationIcon: `${process.env.PWD}/images/WixUIExclamationIco.ico`,
infoIcon: `${process.env.PWD}/images/WixUIInfoIco.ico`,
newIcon: `${process.env.PWD}/images/WixUINewIco.ico`,
upIcon: `${process.env.PWD}/images/WixUIUpIco.ico`
}
}
});
// Step 2: Create a .wxs template file
msiCreator.create().then(() => {
// Step 3: Compile the template to a .msi file
msiCreator.compile().then(() => {
console.log(`[${arch}] Build Success!`);
});
});
});