1

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?

Ng2-Fun
  • 3,307
  • 9
  • 27
  • 47

1 Answers1

0

Did you tried throwing an exception? Won't that abort the installation?

Tieme
  • 62,602
  • 20
  • 102
  • 156