Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check for .net framework 4.7.1 with Wix 3.11

Tags:

wix

wix3

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 anything above 4.5 seems not to be possible - at least not with this mechanism. How can I do that?

like image 931
hot33331 Avatar asked Apr 11 '18 15:04

hot33331


People also ask

How do I know what version of WiX I have?

Click here to view a list of browsers supported by Wix. Additionally, within most browsers you can find the version number in the Help or About section.

How do I know if I have WiX toolset installed?

The best way to check if you have WiX Toolset installed is by opening up the Command Prompt and trying to execute the light.exe command. You can also check in the Programs and Features section of Control Panel.

How to Check. net Framework version via PowerShell?

Open Start. Search for PowerShell, right-click the top result, and select the Run as administrator option. Type the following command to check the version of . NET installed and press Enter: Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse | Get-ItemProperty -Name version -EA 0 | Where { $_.


1 Answers

That method (PropertyRef) is syntactical sugar. The NetFxExtension preprocessor injects the implementation at compile time. WiX is currently lagging behind. The implementation you are looking for would be something like:

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

https://github.com/wixtoolset/issues/issues/5575

Update (hot33331): Added a # before the number 461308. Without that it did not work for me.

like image 55
Christopher Painter Avatar answered Oct 06 '22 23:10

Christopher Painter