2020-07-07 16:05:28 +00:00
|
|
|
const path = require('path');
|
2018-01-30 09:08:35 +00:00
|
|
|
const { MSICreator } = require('electron-wix-msi');
|
2020-07-07 15:59:34 +00:00
|
|
|
const package = require('../package.json')
|
2018-01-30 09:08:35 +00:00
|
|
|
|
|
|
|
// Step 1: Instantiate the MSICreator
|
|
|
|
const msiCreator = new MSICreator({
|
2020-07-07 16:07:00 +00:00
|
|
|
appDirectory: path.resolve(__dirname, '..', '..', 'dist', 'mcopy-win32-x64'),
|
2018-01-30 09:08:35 +00:00
|
|
|
description: 'mcopy optical printer GUI',
|
|
|
|
exe: 'mcopy',
|
|
|
|
name: 'mcopy',
|
|
|
|
manufacturer: 'sixteenmillimeter.com',
|
2020-04-29 14:06:51 +00:00
|
|
|
version: package.version,
|
2020-07-07 16:07:00 +00:00
|
|
|
outputDirectory: path.resolve(__dirname, '..', '..', 'dist')
|
2018-01-30 09:08:35 +00:00
|
|
|
});
|
|
|
|
|
2020-07-07 16:05:28 +00:00
|
|
|
async function build () {
|
2018-01-30 09:08:35 +00:00
|
|
|
|
2020-07-07 16:05:28 +00:00
|
|
|
// Step 2: Create a .wxs template file
|
|
|
|
try {
|
|
|
|
await msiCreator.create();
|
|
|
|
} catch (err) {
|
|
|
|
console.error(err);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Step 3: Compile the template to a .msi file
|
|
|
|
try {
|
|
|
|
await msiCreator.compile();
|
|
|
|
} catch (err) {
|
|
|
|
console.error(err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
build();
|