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

dommer picture dommer · May 23, 2016 · Viewed 14.6k times · Source

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.

Answer

ProfNimrod picture ProfNimrod · May 23, 2016

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>