Finding .NET CLR version and SP numbers

K

Kevin R

Hi All,

I need to establish that the machine on which my user intends to run
my program is at least .Net version 1.1 SP2 and am having a little
trouble figuring out how to do this.

I don't want the user to have to mess about with the Administrative
tools, or mmc.exe. I just need my program to figure out on first run
whether the environment supports a particular action.

I see that there is a property of the Environment class
called Version, which on my machine returns the numbers
1.1.4322.2032
It's not clear from this what the service pack is.

Microsoft say in KB318785 to look for a registry key

HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework
Setup\NDP\v1.1.4322

and the SP revision is given there.

This is great while .Net is still on version 1.1, but what happens
when it becomes version 1.2 ? That registry key probably won't
exist anymore. I don't want to have to distribute another version
of my program.

Is there a way I can find out whether the CLR version is
equal to or greater than Version 1.1 SP2 ?

Thanks for any suggestions.

Kevin R
 
D

Dave

I suggest, if possible, using a Setup and Deployment project if your using VS.NET. Before installation the .msi will ensure that
the framework is installed, and is the version that your project was built against.

The installer itself places a default message telling users that they should manually insure that they have the latest service packs
installed and provides a link (if i remember correctly) to a place of download.

It doesn't seem likely that there is a version-indepent way of checking for a particular framework version/service pack comibination
since the installer doesn't even check for service packs.

At least using an installer will be a nice way of letting them know that your program requires the latest framework service pack and
that the user should ensure that their computer meets the base requirements of your software.

hope it helps
 
K

Kevin R

That sounds sensible.
I had considered shipping my small utility program as a single
executable, which the user would then put wherever they like.
It does make more sense to use an installer I think.

Thanks,

Kevin R.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top