wixburnwix3.9

Package the .Net redistributable in my burn bootstrapper


I'm trying to package the .Net 4.5.2 redistributable into my burn application, by following the instructions on this page.

But it fails to find the file in the temp burn location.

According to the log burn tries to find the file here:

[0A14:09C4][2015-05-12T16:48:52]w343: Prompt for source of package: NetFx452Redist, payload: NetFx452Redist, path: `C:\Users\simon\Desktop\redist\NDP452-KB2901907-x86-x64-AllOS-ENU.exe`

But the file actually ends up in a temporary folder

eg.

C:\Users\simon\AppData\Local\Temp\{f5207472-d2a0-4b00-b9ee-c535385bde58}\redist\NDP452-KB2901907-x86-x64-AllOS-ENU.exe

The instructions say to do this:

<PayloadGroup Id="NetFx452RedistPayload">
  <Payload Name="redist\NDP452-KB2901907-x86-x64-AllOS-ENU.exe"
           SourceFile="..\..\Binaries\Microsoft\NetFramework\4.5.2\NDP452-KB2901907-x86-x64-AllOS-ENU.exe"/>
</PayloadGroup>

How can I make Burn look in the correct location for the .net installer?


Solution

  • Rather than reference NetFxExtension you could gain more control by directly referencing the .NET install package:

    <Fragment>
      <!-- Value of the 'Release' registry value when .NET 4.5.2 is installed -->
      <?define NetFx452MinRelease = 379893 ?>
    
      <!-- Get the release of the .NET V4 framework currently installed -->
      <util:RegistrySearch
            Id="NETFRAMEWORK4"
            Variable="NETFRAMEWORK4"
            Root="HKLM"
            Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"
            Value="Release"
            Result="value" />
    
      <!-- Install .NET 4.5.2 if not already installed -->
      <PackageGroup Id="NetFx4FullRedist">
        <ExePackage
            Id="NetFx4FullRedist"
            Cache="no"
            Compressed="yes"
            InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot;"
            RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot;"
            UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot;"
            PerMachine="yes"
            DetectCondition="NETFRAMEWORK4 &gt;= $(var.NetFx452MinRelease)"
            Vital="yes"
            Permanent="yes"
            Protocol="netfx4"
            SourceFile="..\..\Binaries\Microsoft\NDP452-KB2901907-x86-x64-AllOS-ENU.exe"
            Name="Redist\NDP452-KB2901907-x86-x64-AllOS-ENU.exe">
        </ExePackage>
      </PackageGroup>
    </Fragment>
    

    Then reference NetFx4FullRedist in your <chain>..</chain>:

      <!-- .NET runtime full profile -->
      <PackageGroupRef Id="NetFx4FullRedist"/>
    

    I've used a variation on this to include the .NET 4 Client redistributable into my burn generated installer application without any issues.