Question

I'm trying to create a bootstrap application using WixStandardBootstrapperApplication. It does everything I need it to do really well except handling a restart.

I need to install a group of EXE files. Only the first one is .NET 4.5 and that requires a restart. I would delay the restart, but I can't because one of the other programs is dependent on it. I've tried using an exit code to forcereboot, but when the computer starts back up the bootstrapper gets stuck at that exit code every time, and I can't install anything else. Is there a way to apply the exit code if and only if the program has not restarted yet (or any other logical way)?

Here's what I'm doing...

<ExePackage
  Id               = "NetFx45Redist"
  Cache            = "no"
  Compressed       = "yes"
  PerMachine       = "yes"
  Permanent        = "yes"
  Vital            = "yes"
  InstallCommand   = "/quiet /norestart"

  SourceFile       = "C:\Users\visibleEP\Documents\Visual Studio 2012\Projects\Bootstrapper1\VEP Deploy\Setup Files\dotNetFx45_Full_setup.exe"
  DetectCondition  = "(Netfx4FullVersion=&quot;4.5.50709&quot;) AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.50709&quot;))"
  InstallCondition = "(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Netfx4FullVersion=&quot;4.5.50709&quot; OR Netfx4x64FullVersion=&quot;4.5.50709&quot;))">

  <ExitCode Behavior = "forceReboot"/>
</ExePackage>

<ExePackage
  SourceFile = "...\...\Setup Files\Encoder_en.exe"
  InstallCommand = "/q"/>

<ExePackage
  SourceFile = "...\...\Setup Files\vcredist_x86.exe"
  InstallCommand = "/q /ACTION=Install"
  RepairCommand = "/q ACTION=Repair /hideconsole" />

<ExePackage
  SourceFile = "...\...\Setup Files\vcredist_x64.exe"
  InstallCommand = "/q /ACTION=Install"
  RepairCommand = "/q ACTION=Repair /hideconsole" />
Was it helpful?

Solution

Replace

<ExitCode Behavior="forceReboot"/>

With

<ExitCode Behavior="forceReboot" Value="1641" />
<ExitCode Behavior="forceReboot" Value="3010" />

Both 1641 and 3010 are "A restart is required to complete the installation. This message indicates success."

Your version treats all exit codes as the same, which you observed. See the documentation on that installer. Fortunately, exit codes are documented.

UPDATE: I added known success codes and a catch-all which could be error if you are confident that all success codes are documented.

<ExitCode Behavior="success" Value="0" />
<ExitCode Behavior="error"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top