Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2004

Tip: Looking for answers? Try searching our database.

Detect which Framework is installed (including language)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Thomas Jespersen - 23 Sep 2004 08:36 GMT
How do I detect which language the .NET framework is installed with?

I want to know this because we have an error related to .NET 1.0, which is
corrected in SP3 of the framework. I want to detect if the client is running
.NET 1.0 without SP and offer a download link. But if my client is running
.NET 1.0 US it should be a link to the US SP3 and if the client is running
.NET 1.0 Danish, then the link should point to the Danish SP.

I know I could tell them to run Windows update, but I want to use our own
high-speed servers.

Thomas


Locke Nash Cole - 28 Sep 2004 21:06 GMT
Method 1:

1.) Under HKLM\SOFTWARE\Microsoft\.NETFramework\policy\ check to see if the
version you want is installed (for example, look for the v1.1 folder and
4322 for the version number to detect the released version of V1.1)

2.) Under HKLM\Software\Microsoft\.NETFramework\InstallRoot get the path
where the Framework is installed. Create a directory string by concatenating
the install root and the version under policy. E.g.
"C:\WINDOWS\Microsoft.NET\Framework\" + "v1.1" + "." + "4322"

3.) Look at the directory, if mscorlib.dll (or another critical .dll to the
.NET framework is there) the runtime is installed.

Method 2:

There's a caveat to this method in that the shim gets left behind when we
uninstall if there is more than one version of the CLR on the machine, but
it still can be useful depending on what version you're looking for:

LoadLibrary("mscoree.dll"); - if this fails then there's no runtime
installed

GetProcAddress("CorBindToRuntime"); - if this fails there's no runtime
installed

CorBindToRuntime("GetRequestedRuntimeInfo");

GetRequestedRuntimeInfo(xxxx); where xxxx is the build number.

This posting is provided "AS IS" with no warranties, and confers no rights.

-L
Thomas Jespersen - 29 Sep 2004 08:33 GMT
Hello

Hmm. Maybe I didn't express my self clear.

I know for a fact that my clients has .NET framework (otherwise they would
not be able to run my program).

What I want to check, is whether they have the latest SP (I know how to do
that), and if they don't I want to detect whether they should be offered the
Danish or US Service Pack.

So my question is: How do I detect which language (US or Danish) of the .NET
framework is installed.

Thomas

> Method 1:
>
[quoted text clipped - 30 lines]
>
> -L

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.