Search code examples
wix.net-framework-version

How can I detect whether .NET Framework 4.6.1 or higher is installed in WiX?


I currently using the following markup in my WiX installer project to check if .NET Framework 4.5 or greater is installed.

<PropertyRef Id="NETFRAMEWORK45" />

<Condition Message="$(var.ProductName) requires .NET Framework 4.5 or higher.">
  <![CDATA[Installed OR (NETFRAMEWORK45 >= "#393295")]]>
</Condition>

How can I check for .NET Framework 4.6.1 and above?

I'm using WiX 3.10.2.2516.


Solution

  • How about:

    <PropertyRef Id="WIX_IS_NETFRAMEWORK_461_OR_LATER_INSTALLED" />
    <Condition Message="$(var.ProductName) requires .NET Framework 4.6.1 or higher.">
      <![CDATA[Installed OR WIX_IS_NETFRAMEWORK_461_OR_LATER_INSTALLED]]>
    </Condition>