Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I detect .NET 3.5 in WiX?

Tags:

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.)

like image 977
mmr Avatar asked Mar 25 '09 18:03

mmr


People also ask

How do you confirm if .NET 3.5 is installed?

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.

Does WiX support .NET 6?

NET 6 runtime is installed. WiX provides pre-defined properties to check this for . NET framework but nothing for .

How do I create a Windows Installer MSI .NET core WiX?

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.


2 Answers

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.

like image 137
si618 Avatar answered Sep 27 '22 19:09

si618


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.

like image 26
Bo Christian Skjøtt Avatar answered Sep 27 '22 19:09

Bo Christian Skjøtt