2

How can I continue my installer after it reboots during installation of some package?

Actually, I have build an installer package of a project using WiX bundles (having different packages to install in a chain). But when it installs Microsoft Windows Installer 4.5 (.msi) it goes to reboot the PC. After it reboots, I want my installation to continue after that. How can I do that?

I guess we can do it with the use of the exit code, but I don't know how to use it in WiX bundles.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
AArora
  • 185
  • 2
  • 9

1 Answers1

4

Yes, you are right. You need to use an exit code in the Bundle:

<ExePackage Id="WinXP_x86"
              Cache="no"
              Compressed="no"
              PerMachine="yes"
              Permanent="yes"
              Vital="yes"
              Name="redist\WindowsXP-KB942288-v3-x86.exe"
              DownloadUrl="http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/WindowsXP-KB942288-v3-x86.exe"
              InstallCondition="VersionNT=v5.1 AND NOT VersionNT64 AND VersionMsi &lt; v4.5"
              InstallCommand="/quiet /norestart">
    <RemotePayload ProductName="Windows Installer 4.5"
                   Description="Windows Installer 4.5 Setup"
                   CertificatePublicKey="F321408E7C51F8544B98E517D76A8334052E26E8"
                   CertificateThumbprint="D57FAC60F1A8D34877AEB350E83F46F6EFC9E5F1"
                   Hash="86E1CC622DBF4979717B8F76AD73220CDB70400B"
                   Size="3327000"
                   Version="4.5.0.0" />
    <ExitCode Behavior="forceReboot"/>
</ExePackage>

Once this has rebooted, it will continue on with the installation, assuming you are using the latest version. There was a bug where the bootstrapper wouldn't continue after a reboot.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
caveman_dick
  • 6,302
  • 3
  • 34
  • 49
  • Why isn't there a 'Value=""' inside ? – Peter Mortensen Jul 17 '15 at 12:03
  • 1
    @PeterMortensen If you don't specify one it will force a reboot for all "Exit code returned from executable package. If no value is provided it means all values not explicitly set default to this behavior." http://wixtoolset.org/documentation/manual/v3/xsd/wix/exitcode.html – caveman_dick Jul 17 '15 at 13:32