[wix-users] Wix Burn install .Net 4.5.1 only if installed .Net version is lower and not higher

Jerome jero2rome at gmail.com
Mon Jun 27 06:00:34 PDT 2016


Alternatively reply can be made in my stackoverflow question.

http://stackoverflow.com/q/38049206/949702

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 =
"4.5.50938") AND (NOT VersionNT64 OR (Net4x64FullVersion =
"4.5.50938"))"
              InstallCondition="(VersionNT >= v6.1 OR VersionNT64 >=
v6.1) AND (NOT (Net4FullVersion = "4.5.50938" OR
Net4x64FullVersion = "4.5.50938"))" /></PackageGroup>


More information about the wix-users mailing list