How can I schedule a reboot mid-way through a wix burn chain?

wix, wix3.6

Solution

Ok I think I've found out how to do this. Basically I needed to specify the forceReboot option on the child ExitCode of the WixInstaller ExePackage.

<ExePackage Id="WinXp_x86"
              Cache="no"
              Compressed="no"
              PerMachine="yes"
              Permanent="yes"
              Vital="yes"
              InstallCommand="/norestart /passive"
              SourceFile="WindowsXP-KB942288-v3-x86.exe"
              DownloadUrl="http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/WindowsXP-KB942288-v3-x86.exe"
              DetectCondition="WINXP_X86_NEEDS_INSTALLER" >
    <ExitCode Behavior="forceReboot" />
</ExePackage>

This correctly tells the user to reboot the machine, and when it restarts the bootstrap installer window re-opens, but the user has to click on the "Install" button again. This it seems is a bug in the RC0 (3.6.2803.0) but has been fixed in the latest sources (3.6.2830.0). I've just built the latest sources and trying to verify...

Problem

Currently I have a chain that checks for and installs the following pre-requisites if they are missing: - Windows Installer 4.5 - .net Framework 4 - Sql Server Express 2008 R2 Unfortunately installer needs to reboot the machine after installing #1 otherwise the Sql server install fails. If the user is prompted to restart the machine, this is suppressed and the installer just continues with #2. How can I reboot the machine (if #1 was installed) and then automatically continue with the install? Thanks

Original source