Question

I'm trying to run a bootstrapper application using the WixStandardBootstrapperApplication. So far, it works great for everything I need it do, even handling a restart mid installation. The process goes like this-I check to see if .net 4.5 is installed on the computer, if not, then install .net 4.5. After it is installed, burn then knows to restart because I handle the exit codes. Upon resuming, the installer processes three more .exe files, one of which is dependent on the .net installation. This all functions really well until after the restart, at which point the bootstrapper attempts to repair each of the exe's post installation doubling the runtime. This wouldn't be so bad, except installing .net 4.5 takes so long that doubling is very undesirable. I've tried leaving out a repair command, and I've noticed there isn't any form of RepairCondition like the install and detect conditions. Is there any way to prevent the repair processes?

Here's the bootstrapper code:

<Chain>
      <ExePackage Id="NetFx45Redist" Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes" InstallCommand="/q /norestart" RepairCommand="/q"
              SourceFile="...\...\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;))"
              RepairCondition="" >
        <ExitCode Value="1641" Behavior="forceReboot"/>
        <ExitCode Value="3010" Behavior="forceReboot"/>
        <ExitCode Value="0" Behavior="success"/>
        <ExitCode Behavior="error"/>
      </ExePackage>
      <ExePackage
        SourceFile="...\...\Setup Files\Encoder_en.exe"
        InstallCommand="/q"
        RepairCommand="/q">
        <ExitCode Behavior="success"/>
      </ExePackage>
      <ExePackage
        SourceFile="...\...\Setup Files\vcredist_x86.exe"
        InstallCommand="/q"
        RepairCommand="/q">
        <ExitCode Behavior="success"/>
      </ExePackage>
      <ExePackage
        SourceFile="...\...\Setup Files\vcredist_x64.exe"
        InstallCommand="/q"
        RepairCommand="/q">
        <ExitCode Behavior="success"/>
      </ExePackage>
      <!-- installer for actual software at some point -->
</Chain>

I know it's basically a hack to have the behavior be success for these other .exe's but until the repair issue is handled they need to otherwise the installer says it fails. I've tried removing the repair commands from these too and that doesn't seem to help at all so I made them quiet so at least they aren't popping up and confusing the user.

Was it helpful?

Solution

You need accurate DetectCondition attribute values for every package that isn't an MsiPackage. Burn has no way to detect what an arbitrary .exe might do, so it relies on you to tell it. With no detect condition, Burn will always install the package. For .NET, you should use the DetectCondition from WiX:

<?define NetFx45MinRelease = 378389?>
...
  <util:RegistrySearch
      Id="NETFRAMEWORK45"
      Variable="NETFRAMEWORK45"
      Root="HKLM"
      Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"
      Value="Release"
      Result="value" />
...
DetectCondition="NETFRAMEWORK45 &gt;= $(var.NetFx45MinRelease)"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top