title: Adding WIC as a requirement before .NET 4.0 in WiX Burn custom Managed Bootstrapper
body: <p>I'm having trouble getting a burn bundle with a custom managed bootstrapper application to launch on certain platforms that do not come with Windows Imaging Component, which is required to install .NET 4.0 (Windows 2003 being one of them).</p>
  
  <p>We are using the standard method of defining what the managed bootstrapper application requires:</p>
  
  <pre><code>&lt;WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full"/&gt;
  </code></pre>
  
  <p>When this bootstrapper is run on a newly installed Windows 2003 R2 machine, it launches the standard requirements installer for .NET, which then fails with an error.</p>
  
  <p>We have attempted to solve this issue by doing the following (with everything non-essential snipped):</p>
  
  <pre class="lang-xml prettyprint-override"><code>...
  &lt;!-- Define WIC packages --&gt;
  &lt;PackageGroup Id="PG.WIC"&gt;      
    ...
    &lt;ExePackage Id="EP.wic_x64_enu" Cache="no" Compressed="no"  PerMachine="yes" Permanent="yes" Vital="no"  
       DisplayName="Windows Imaging Component for Windows Server 2003 x64"
       Name="{4A85FFDB-5563-4FE9-9C0E-C780A271BCC7}\WIC\wic_x64_enu.exe"
       SourceFile="$(var.SetupPrereq_SRC)\WindowsImagingComponent\x64\wic_x64_enu.exe"
       DownloadUrl="http://download.microsoft.com/download/6/4/5/645fed5f-a6e7-44d9-9d10-fe83348796b0/wic_x64_enu.exe"
       InstallCondition="(VersionNT=v5.2 AND VersionNT64 AND NOT NETFRAMEWORK40FULL)"
       InstallCommand="/q /norestart"&gt;
    &lt;/ExePackage&gt;
  &lt;/PackageGroup&gt;
  ...
  &lt;!-- Define our own .NET package, and set it to be after the WIC package --&gt;
  &lt;PackageGroup Id="PG.NetFx40Full"&gt;
    &lt;ExePackage Id="EP.NetFx40Full" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="yes" Protocol="netfx4" 
        DisplayName="Microsoft .NET Framework 4"
        Name="{4A85FFDB-5563-4FE9-9C0E-C780A271BCC7}\NetFx\dotNetFx40_Full_x86_x64.exe"
        SourceFile="$(var.SetupPrereq_SRC)\NetFx\dotNetFx40_Full_x86_x64.exe"
        DownloadUrl="http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe"
        DetectCondition="NETFRAMEWORK40FULL"
        InstallCommand="/q /norestart /ChainingPackage &amp;quot;[WixBundleName]&amp;quot; /log %TEMP%\PG.NetFx40Full.log"
        RepairCommand="/q /norestart /repair /ChainingPackage &amp;quot;[WixBundleName]&amp;quot;"        
        After="EP.wic_x64_enu"        &gt;
    &lt;/ExePackage&gt;
  &lt;/PackageGroup&gt;
  ...
  &lt;!-- Change wixmbaprereqpackageid to point to our own package--&gt;
  &lt;WixVariable Id="WixMbaPrereqPackageId" Value="PG.Netfx4Full" Overridable="no"/&gt;
  &lt;WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" /&gt;
  ...
  &lt;Chain&gt;
    &lt;!--Windows Imaging Component--&gt;
    &lt;PackageGroupRef Id="PG.WIC"/&gt;
  
    &lt;!--.Net Framework 4 --&gt;      
    &lt;!--Custom offline package.--&gt;
    &lt;PackageGroupRef Id="PG.NetFx40Full"/&gt;
    ...
  &lt;/Chain&gt;
  ...
  </code></pre>
  
  <p>This does not work. The prereq installer launches as usual, but when you click on the button to start the install, the progress bar flashes for a second and the installer exits. If the bundle is started again, the prereq installer launches, but only shows a title and a logo, but no buttons. We also tried putting the After condition on the PackageGroupRef for the .NET packagegroup, with similar results.</p>
  
  <p>So, my question is: Is there a way to make burn install more than one package as a prerequisite for the managed bootstrapper, or is there any other way to solve this issue?</p>