I'm trying to detect which version .NET is installed using WiX. I've tried:
<Condition Message='This setup requires the .NET Framework 3.5 or higher.'>
<![CDATA[MsiNetAssemblySupport >= "3.5.0.0"]]>
</Condition>
But that won't work, because the MsiNetAssemblySupport property checks the version of fusion.dll
, which wasn't updated from version 2.0 in .NET 3.0 or 3.5.
Is it feasible to check for the presence of the .NET libraries in the system directory? How would I do that using WiX? Or is there some way to do that using the registry?
(I realize that there's a WiX user email list, but this is the Oughts-- I don't like 1980s technology, I like stuff I can easily search.)
It is essential for users to install and enable . NET 3.5 in their Windows system. To determine whether . NET 3.5 Framework is installed, users can check the path:C:\Windows\Microsoft.NET\Framework64 to see whether they can find the folder v3.
NET 6 runtime is installed. WiX provides pre-defined properties to check this for . NET framework but nothing for .
Adding a WiX setup project In Visual Studio, open your solution, and add a WiX project to it: go to the Visual Studio main menu and click File -> Add -> New Project to open the Add New Project dialog. Choose the Setup Project item in the Windows Installer XML node, specify the project name and click OK.
Visual Studio -> WiX project -> Add Reference -> WixNetFxExtension.dll and then:
<PropertyRef Id="NETFRAMEWORK35" />
<Condition Message="This setup requires the .NET Framework 3.5 to be installed.">
Installed OR NETFRAMEWORK35
</Condition>
Full details, including all .NET version properties available in the extension. Also consider whether condition message should be localized.
The answer seems to be no. You cannot (in a reliable way) check whether .NET framework version X or higher is installed. You can only check whether a specific .NET version is installed. Now that .NET 4.0 is released it is annoying that you have to install .NET 3.5 even if .NET 4.0 is already installed.
I hope the WiX developers will find a solution to this problem.
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