WiX Burn after restart/force reboot continuing installation
Asked Answered
I

1

6

I have a WiX Burn custom installer using ManagedBootstrapperApplicationHost. After installing one of the prerequisite Microsoft Windows Installer 4.5 I forcefully reboot the PC (Windows XP) using:

<ExitCode Behavior="forceReboot"/>

The Bundle chain looks like this:

<Chain>
   <PackageGroupRef Id="WindowsInstaller45"/>
   <PackageGroupRef Id="Netfx2Full"/>
   <PackageGroupRef Id="Netfx4Full"/>
   <PackageGroupRef Id="CustomPkg"/>
   <PackageGroupRef Id="SQLExpress"/>
</Chain>

After it reboots, I want my installation to continue after that, but it actually detects the installation and shows Uninstall option.

How can I detect an unfinished installation when reboot happens during installation?

Infrared answered 23/4, 2013 at 9:49 Comment(2)
What does your chain look like in your bundle and what version of wix are you using?Ky
I am using Wix 3.7 my chain is as follows <PackageGroupRef Id="WindowsInstaller45"/> <PackageGroupRef Id="Netfx2Full"/> <PackageGroupRef Id="Netfx4Full"/> <PackageGroupRef Id="CustomPkg"/> <PackageGroupRef Id="SQLExpress"/>Infrared
S
11

When the Bundle is started again after a restart the BOOTSTRAPPER_COMMAND struct passed to your BootstrapperApplicationCreate function contains a resumeType field that will be set to BOOTSTRAPPER_RESUME_TYPE_REBOOT. In managed code, the BootstrapperApplication class contains a Command property that contains the resume field.

For example in managed code, to tell that your BootstrapperApplication started after a restart, you can check:

 if (BootstrapperApplication.Command.resume == ResumeType.Reboot)
 {
    // started after restart, go straight to Detect->Plan->Apply to finish the
    // previous operation. BootstrapperApplication.Command.action will tell us
    // the action to complete.
 }
 else
 {
    // started normally, show typical UI scenarios.
 }
Stay answered 23/4, 2013 at 13:6 Comment(4)
Thanks Rob! Should i check for the same in this.Engine.Detect(); in RunInfrared
Yeah, you'll want to check that in Run() or something similarly early.Stay
Thanks Rob! it worked perfectly as expected after above implementationInfrared
Where is the "Managed Code" in a Bootstrapper ?Goda

© 2022 - 2024 — McMap. All rights reserved.