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?
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.
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.
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 { $_.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With