0

I have a managed bootstrapper application, which uses wix 3.7.

While in the middle of execution of one of the ExePackages, if there is a forced shutdown or a power off, then when the system is restarted and the user starts the bootstrapper again, it should resume from last ExePackage it stopped. The Command parameter has the value "Install" rather than "Resume". How do I ensure it starts as a "Resume" command.

1 Answers1

0

The bootstrapper is not designed to track the progress of arbitrary installers. Each time it is run it either finds that it itself is completely installed and executes its modify/remove behavior or it doesn't and executes its install behavior.

During install, each ExePackage in the chain has an optional detect condition. If the condition is not present, or it fails, the InstallCommand for that package is executed.

So, ideally the installer should sort out if it is only partially installed itself and then do the right thing. (In other words, be robust like Windows Installer and other well-designed installers are.)

If you can't change that but can write such detect conditions into your Bundle, you could try having two ExePackage elements in your chain, 1) to run the Resume command on the condition your installer is partially installed, then 2) to run the Install command on the condition your installer is not fully installed.

Normal installation case:

  1. first one doesn't run,
  2. second one runs completely.

Resumed installation case, starting fresh:

  1. first one doesn't run,
  2. second one runs but
  3. interruption
  4. power up and go again
  5. first one runs
  6. goto back two steps if interruption occurs again
  7. second one doesn't run

If it's not convenient to do in your Bundle, you could write a robust wrapper around the installer that can't cope. This assumes, of course, that you can tell when the Resume command vs the Install command should be used based on the state of the machine.

Tom Blodget
  • 20,260
  • 3
  • 39
  • 72