|
| 1 | +let { MSICreator } = require('electron-wix-msi'); |
| 2 | +let packageInfo = require('./package.json'); |
| 3 | +let arches = ['ia32', 'x64']; |
| 4 | + |
| 5 | +arches.forEach(function (arch) { |
| 6 | + console.log(`[${arch}] Start Building...`); |
| 7 | + |
| 8 | + // Step 1: Instantiate the MSICreator |
| 9 | + const msiCreator = new MSICreator({ |
| 10 | + appDirectory: `${process.env.PWD}/build/MOAI-win32-${arch}`, |
| 11 | + outputDirectory: `${process.env.PWD}/build/MOAI-win32-${arch}-installer`, |
| 12 | + description: packageInfo.description, |
| 13 | + exe: packageInfo.productName, |
| 14 | + name: packageInfo.productName, |
| 15 | + manufacturer: packageInfo.productName, |
| 16 | + version: packageInfo.version, |
| 17 | + ui: { |
| 18 | + chooseDirectory: true, |
| 19 | + images: { |
| 20 | + background: `${process.env.PWD}/images/WixUIDialogBmp.png`, |
| 21 | + banner: `${process.env.PWD}/images/WixUIBannerBmp.png`, |
| 22 | + exclamationIcon: `${process.env.PWD}/images/WixUIExclamationIco.ico`, |
| 23 | + infoIcon: `${process.env.PWD}/images/WixUIInfoIco.ico`, |
| 24 | + newIcon: `${process.env.PWD}/images/WixUINewIco.ico`, |
| 25 | + upIcon: `${process.env.PWD}/images/WixUIUpIco.ico` |
| 26 | + } |
| 27 | + } |
| 28 | + }); |
| 29 | + |
| 30 | + // Step 2: Create a .wxs template file |
| 31 | + msiCreator.create().then(() => { |
| 32 | + // Step 3: Compile the template to a .msi file |
| 33 | + msiCreator.compile().then(() => { |
| 34 | + console.log(`[${arch}] Build Success!`); |
| 35 | + }); |
| 36 | + }); |
| 37 | +}); |
0 commit comments