Wix Burn install .Net 4.5.1 only if installed .Net version is lower and not higher

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Wix Burn install .Net 4.5.1 only if installed .Net version is lower and not higher

jero2rome
This post has NOT been accepted by the mailing list yet.
We have .Net 4.5.1 as pre-requisite for our software suite. At the time when we authored burn, we had .net 4.5.1 as the latest version and so we didn't had to check for higher version installations. Now that we have 4.6.X or higher .Net versions available in the pc, our setup is always trying to install .Net 4.5.1. So, how to check if higher versions are installed and skip .Net installation?

We don't use web install. The setup file will be available as a .exe for burn to access. Here is the current authoring code.

<WixVariable Id="WixMbaPrereqPackageId" Value="Netfx451Full" />
<WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx40EulaLink)" />

<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version"
                     Variable="Net4FullVersion" />
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version"
                     Variable="Net4x64FullVersion" Win64="yes" />

<PackageGroup Id="Netfx451Full">
  <ExePackage Id="Net45" Name="Microsoft .NET Framework 4.5.1.exe"
              Description="Microsoft .NET Framework 4.5.1 AllOS (x86 and x64) Setup"
              Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="yes"
              InstallCommand="/norestart"
              SourceFile="$(var.PreRequisites_x86)DotNetFramework\NDP451-KB2858728-x86-x64-AllOS-ENU.exe"
              DetectCondition="(Net4FullVersion = &quot;4.5.50938&quot;) AND (NOT VersionNT64 OR (Net4x64FullVersion = &quot;4.5.50938&quot;))"
              InstallCondition="(VersionNT >= v6.1 OR VersionNT64 >= v6.1) AND (NOT (Net4FullVersion = "4.5.50938" OR Net4x64FullVersion = "4.5.50938"))" />
</PackageGroup>
Loading...