I built an electron app, pack the app with electron-packager and build the installer with windows-installer.
Todo: I want to run some commands during the installing the app.
What I tried:
Put code inside squirrel events to execute commands:
case '--squirrel-install':
const exec = require('child_process).exec;
exec(...); // run command here to execute commands inside batch file
if (error) {make installation fail} // if there is an error during exec(), fail the installation
It works well if command can run successfully. However, I also need to handle command failed situation. In that case, I want to stop installing the app but it can't.
Does anyone have any idea?