tags:

views:

2517

answers:

5

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 registries?

(I realize that there's a WiX user email list, but this is the Oughts-- I don't like 1980's technology, I like stuff I can easily search)

A: 

http://blogs.msdn.com/astebner/archive/2008/07/07/8705318.aspx

the almighty google to the rescue

mmr
+12  A: 

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.

Si
error LGHT0094: Unresolved reference to symbol 'Property:NETFRAMEWORK35' in section 'Product:*'.
mmr
Also have to add -ext WiXNetFxExtension to the command line
mmr
@mmr - I've clarified the answer, this is all I have to do to get it working. This will add reference to wixproj, which adds -ext WixNetFxExtension automatically to command line.
Si
+2  A: 

Are help files out-moded as well? Sorry, couldn't resist :) I searched the Wix help file for "framework" and came up with an answer in the first result. Online version is here.

Daniel Pratt
nope, fair commentary. I stopped searching too quickly :)
mmr
Depends what you search for. Search for "wix prerequisite" gets nothing worthwhile, search for "wix detect" gets this. And that's where I stopped searching.
Anthony
A: 

Just like mmr said: http://blogs.msdn.com/astebner/archive/2008/07/07/8705318.aspx the almighty google to the rescue

See "A note for WiX users" at the bottom of the page and follow directions.

tom
A: 

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.

Bo Skjoett