How can I tell what version of .NET is installed?
-
If I programmatiacally want to determine whether .NET framework is installed on a computer and if so what version of .NET, how do I do this? The project can not use .NET naturally since it also has to run on computers where .NET has not yet been installed. I've looked in the registry and found that I can use "RegOpenKeyEx()" on the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.0", but there must be a better way, since this call will fail if the user is running v1.1 . So how can I decide if and what version of .NET is installed on a computer? Regards /EnkelIk
-
If I programmatiacally want to determine whether .NET framework is installed on a computer and if so what version of .NET, how do I do this? The project can not use .NET naturally since it also has to run on computers where .NET has not yet been installed. I've looked in the registry and found that I can use "RegOpenKeyEx()" on the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.0", but there must be a better way, since this call will fail if the user is running v1.1 . So how can I decide if and what version of .NET is installed on a computer? Regards /EnkelIk
If you app is being accessed or downloaded from the web, you can check the user agent of the request object. .Net adds the clr and version number to the user agent. Check out http://www.asp.net/webmatrix/download.aspx?tabindex=4 download section which uses the user agent to detect whether or not .net is installed. It's quick and simple. Hope this helps.
-
If I programmatiacally want to determine whether .NET framework is installed on a computer and if so what version of .NET, how do I do this? The project can not use .NET naturally since it also has to run on computers where .NET has not yet been installed. I've looked in the registry and found that I can use "RegOpenKeyEx()" on the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.0", but there must be a better way, since this call will fail if the user is running v1.1 . So how can I decide if and what version of .NET is installed on a computer? Regards /EnkelIk
On the client-side, check out whether mscoree.dll exists (it's in <winsysdir>). That's the first thing a .NET app loads (to host the CLR). Regarding the .NET version, you can lookup the registry : HKLM\Software\Microsoft\NET Framework Setup\Product\xxx with values defined as for instance : Package="Full" ProductLanguage="1033" Version="v1.0.3705" Version is like this 1 : major 0 : minor 3705 : build
She's so dirty, she threw a boomerang and it wouldn't even come back.
-
If I programmatiacally want to determine whether .NET framework is installed on a computer and if so what version of .NET, how do I do this? The project can not use .NET naturally since it also has to run on computers where .NET has not yet been installed. I've looked in the registry and found that I can use "RegOpenKeyEx()" on the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.0", but there must be a better way, since this call will fail if the user is running v1.1 . So how can I decide if and what version of .NET is installed on a computer? Regards /EnkelIk
You could also check the for the existence of the path: %windir%\Microsoft.NET\Framework\v1.0.3705 Ragards Chris