2

I am trying to make an installer bundle for .NET 4.5.2.

I followed these instructions, and it works fine for that .NET version.

But when I change the version, as below, it does not detect the installed .NET version when I run the installer for the second time:

  <ExePackage Id="Netfx452" Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes" InstallCommand="/q /norestart"
    SourceFile="$(var.ProjectDir)Resources\NDP452-KB2901907-x86-x64-AllOS-ENU.exe"
    DetectCondition="(Netfx4FullVersion=&quot;4.5.51209&quot;) AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.51209&quot;))"
    InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Netfx4FullVersion=&quot;4.5.51209&quot; OR Netfx4x64FullVersion=&quot;4.5.51209&quot;))"/>
Community
  • 1
  • 1
Marc.O
  • 125
  • 1
  • 11

1 Answers1

8

This is only supported in WiX 3.9:

  1. Include a reference to WixNetFxExtension.dll

    enter image description here

  2. In your Bundle.wxs file, add the following to your <Bundle><Chain> element

    <PackageGroupRef Id="NetFx452Redist" />
    

    Alternatively, substitute any of the following for the Id attribute's value:

    PackageGroup ID     Description
    NetFx452Web         .Net Framework 4.5.2 web setup.
    NetFx452Redist      .Net Framework 4.5.2 standalone setup.
    

Here is a short example of final markup:

<Bundle Name="My App" Version="1.0.0.0" Manufacturer="Me" UpgradeCode="{YOUR-GUID-HERE}">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
    <Chain>
        <PackageGroupRef Id="NetFx452Redist" />
        <MsiPackage SourceFile="$(var.AppInstaller.TargetPath)" />
    </Chain>
</Bundle>
Chris Schiffhauer
  • 17,102
  • 15
  • 79
  • 88
  • Let's say then the MsiPackage requires the existence of .NET v4.5.2 to install (because it starts up a service or something). How can I set this to force a reboot after v4.5.2 installs and then resumes upon restart? I see references to some older .NET version detection stuff but I assume there's a better/easier way to do this with WiX v3.9 and up. – Dan Dec 07 '15 at 14:38