Checking for a 4.0 Framework Install
How can I tell whether a machine has the 4.0 framework installed?
Checking for the presence of the installation registry value is still a straightforward way of doing this reliably. A slight complication is that in 4.0 there has been a split into the full and client framework profiles. Installing the full profile includes a copy of the client profile but the client profile might be used and updated independently. A limited subset of WCF is available in the client profile.
The registry keys for the client and full profiles are:
Software\Microsoft\NET Framework Setup\NDP\v4\Client
Software\Microsoft\NET Framework Setup\NDP\v4\Full
If the corresponding profile is installed, then these keys will contain a value named Install set to 1.
For the historically curious, here are the corresponding registry keys to check for older versions of the framework:
Software\\Microsoft\\.NETFramework\\Policy\\v1.0
Software\\Microsoft\\NET Framework Setup\\NDP\\v1.1.4322
Software\\Microsoft\\NET Framework Setup\\NDP\\v2.0.50727
Software\\Microsoft\\NET Framework Setup\\NDP\\v3.0
Software\\Microsoft\\NET Framework Setup\\NDP\\v3.5
The name and location of the installation registry value varies from version to version a bit. However, the same test as used for 4.0 does work for 1.1, 2.0, and 3.5.
Comments
Anonymous
June 29, 2009
You don't happen to have similar information to detect the location of the corresponding SDK?Anonymous
June 29, 2009
Hi Gert, Try here: http://blogs.msdn.com/windowssdk/archive/2008/05/29/windows-sdk-registry-keys.aspx.