From a379e4b0862618480de3c34d4523ad1d9551da7f Mon Sep 17 00:00:00 2001 From: sixteenmillimeter Date: Tue, 7 Jul 2020 12:05:28 -0400 Subject: [PATCH] Windows path differences from linux/darwin are ruining my day https://github.com/felixrieseberg/electron-wix-msi/issues/5 --- app/scripts/build_win.js | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/app/scripts/build_win.js b/app/scripts/build_win.js index 09df1ff..70cd384 100644 --- a/app/scripts/build_win.js +++ b/app/scripts/build_win.js @@ -1,19 +1,33 @@ +const path = require('path'); const { MSICreator } = require('electron-wix-msi'); const package = require('../package.json') // Step 1: Instantiate the MSICreator const msiCreator = new MSICreator({ - appDirectory: '../dist/mcopy-win32-x64', + appDirectory: path.resolve(__dirname, '..', 'dist', 'mcopy-win32-x64'), description: 'mcopy optical printer GUI', exe: 'mcopy', name: 'mcopy', manufacturer: 'sixteenmillimeter.com', version: package.version, - outputDirectory: '../dist/' + outputDirectory: path.resolve(__dirname, '..', 'dist') }); -// Step 2: Create a .wxs template file -msiCreator.create(); +async function build () { -// Step 3: Compile the template to a .msi file -setTimeout(msiCreator.compile, 30000) \ No newline at end of file + // 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(); \ No newline at end of file