Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine highest .NET Framework version [duplicate]

I need to determine the highest .NET framework version installed on a desktop machine from C\C++ code. Looks like I can iterate the folders under %systemroot%\Microsoft.NET\Framework, but that seems kind of error prone. Is there a better way? Perhaps a registry key I can inspect? Thanks.

like image 858
Charles Avatar asked Oct 08 '08 13:10

Charles


2 Answers

Use the Windows Registry location HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP.

like image 82
chills42 Avatar answered Oct 22 '22 23:10

chills42


Registry keys for the .NET Framework start like this:

HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\

Depending on the version, the rest of the key will be different (check this page).

You can look up how to access the registry in MSDN article Using the registry in a C++ application.

like image 21
Luc Touraille Avatar answered Oct 22 '22 23:10

Luc Touraille