2

I am trying to check for .net Version with Wix 3.11 via Condition. This works fine until 4.5 like this:

<PropertyRef Id="NETFRAMEWORK45" />
<Condition Message="This application requires .NET Framework 4.5. Please install the .NET Framework then run this installer again.">
  <![CDATA[Installed OR NETFRAMEWORK45]]>
</Condition>

Checking for .Net 5 seems not to be possible - at least not with this mechanism. How can I do that?

Atif Waqar
  • 89
  • 2
  • 12
  • This .net version is not supported by WIX. You should write custom action to check it. [Here you can find my answer](https://stackoverflow.com/questions/58930065/check-if-netcore-is-installed-using-customaction-with-wix/62679569#62679569) with full code provided (scroll to updated one) – ba-a-aton Apr 01 '21 at 13:25

1 Answers1

2

The NETFAMEWORK45 property is injected at build time by the NetFx extension. It does not currently have support for .NET 5. You can see the source code for how it works here:

https://github.com/wixtoolset/Netfx.wixext/tree/master/src/wixlib

A custom action shouldn't be needed to detect .NET Core. Simply write a Property / RegSearch similar to the one below but modified for the details of the footprint .NET 5 leaves behind.

  <Fragment>
    <Property Id="NETFRAMEWORK40CLIENT" Secure="yes">
      <RegistrySearch Id="NetFramework40Client" Root="HKLM" Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client" Name="Install" Type="raw" />
    </Property>
  </Fragment>
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Christopher Painter
  • 54,556
  • 6
  • 63
  • 100