[wix-users] Burn with mba, force reboot in middle of chain and handle restart.

Phill Hogland phill.hogland at rimage.com
Fri Sep 11 08:50:58 PDT 2015

My mba driven package chain has a package which includes a CA in which I call a system tool to do CBS servicing.  That tool may return 0x80070bc2

if (0x80070BC2 == hr) {  //success, reboot is needed, so changes may not be effective until after the reboot
WcaLog(LOGMSG_STANDARD, "Return code, %d, indicates a reboot is needed.  The installed features may not be available until after the next reboot, but this setup will proceed.\n", hr);
       hr = S_OK;

I then found Sean's helpful advice on implementing the mba code to handle the restart and I implemented the Startup and PlanPackageBegin changes.  What I am missing is what should I do in the mba to detect that the CA indicated that a reboot is necessary and force the reboot.  (Unfortunately I have a later third-party package for which the setup will error out if the error in the above CA is allowed to continue without doing the reboot immediately.)

I saw the source for WIXAPI WcaDidDeferredActionRequireReboot() but am not sure where I would call this (or equivalent) from my C# mba.

And then I also need to handle the situation where a reboot is not allowed as this bundle might be part of a silent script, but that is a separate issue.

Thanks for any advice.

More information about the wix-users mailing list