Detecting Installed Framework Version

  • Thread starter Thread starter Sean Malloy
  • Start date Start date
S

Sean Malloy

Hi,

I'm just wondering what the recommended way of detecting the version of the
framnework a user has installed is?

I'm building an application installer using Inno Setup. I'm kind of hoping I
can check using the registry or something. Or should I make a call out to
%windir%\Microsoft.NET\Framework\ or something.

Like I said, the recommended way.

Regards,

Sean
 
Scott,
I'm building an application installer using Inno Setup

Which is a windows app. Not a web application. I'm looking for a call to a
registry key or something.

BTW: If you need to do framework sniffing on web clients,
Request.Browser.ClrVersion is probably easier to use than doing your own
parsing of the USER_AGENT string.
 
Sean,

There are some keys in the registry, but I seem to remember that the most
reliable way to get the CLR versions is to parse the directories below the
Windows\Microsoft.Net\Framework path.

You can also look at:

lcVersion =
loAPI.Readregistrystring(HKEY_LOCAL_MACHINE,"Software\Microsoft\ASP.Net","Ro
otVer")

which if I recall right is the highest installed version of the framework.

Interestingly enough I have the above code in some self registration code
for COM Interop in a Visual FoxPro app so the need there is similar to your
<g>...

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/blog/
 
Back
Top