I am creating a managed bootstrapper application with WiX Burn. I need to handle some ExePackage elements which may require a forced restart. This question has some tantalizing clues about how to handle the restart, but I'm having trouble getting it working.
I have <ExitCode Value="3010" Behavior="forceReboot" />
in the ExePackage
elements, and I can see that triggering in the logs. I am listening to the Shutdown
event that is raised by the BootstrapperApplication
and setting e.Result = Result.Restart
, though I haven't figured out how to capture the condition for when this should occur when the force reboot is detected in the Apply phase. I am testing if (Command.Resume == ResumeType.Reboot)
in the Run
method of my BootstrapperApplication
going straight to the progress bar portion of my custom UI, but I'm not sure how to resume the Apply phase where it left off. Do I need to call Engine.Detect()
or Engine.Apply
in this case? Is there some special action I need to take to persist and restore the state to survive the reboot, or does the Burn engine handle all of that internally?
If anyone could point me to a working example of a WiX Burn managed bootstrapper application that handles reboots, I would appreciate it.