.Net Framework 3.5 Checker

.Net Framework 3.5 Checker

Old forum URL: forums.lhotka.net/forums/t/4786.aspx


SouthSpawn posted on Thursday, May 01, 2008

Is there a way to check an see what versions of the .Net Framework installed on the client's machine?

I am assuming something would have to be written in C++ to do this.

Michael Hildner replied on Thursday, May 01, 2008

Probably isn't fool proof, but you can look at the Windows\Microsoft.NET\Framework folder and see what is installed. All the frameworks begin with a "v" e.g. v2.0.50727.

Although I can't remember what the variable is, in a web app, you can also check the request variables. "SERVER_VARIABLES" or something like that lists all the frameworks installed on the client machine.

Now that I think about that, must be an API or somethng somewhere to populate that. No idea though.

SouthSpawn replied on Thursday, May 01, 2008

Well,

I don't have any experience with C++, so I am looking for a component or something to check that.

Michael Hildner replied on Thursday, May 01, 2008

Was looking around because I was curious, didn't find an API real quick, but this program seems nifty, and free.

http://www.tmgdevelopment.co.uk/versioncheck.htm

SouthSpawn replied on Thursday, May 01, 2008

Michael Hildner:

Was looking around because I was curious, didn't find an API real quick, but this program seems nifty, and free.

http://www.tmgdevelopment.co.uk/versioncheck.htm

 
Michael,
 
I ran into this program, but it doesn't seem to support the 3.5 framework yet :(

Michael Hildner replied on Thursday, May 01, 2008

Ah, I saw it but didn't try it. Does just looking at the folders work for you? You could make a simple batch file like

DIR /AD %systemroot%\Microsoft.NET\Framework
PAUSE

SouthSpawn replied on Thursday, May 01, 2008

Michael Hildner:

Ah, I saw it but didn't try it. Does just looking at the folders work for you? You could make a simple batch file like

DIR /AD %systemroot%\Microsoft.NET\Framework
PAUSE

 
How would I loop through the result set to find the 3.5 framework, than if it is not found, to download the framework from the internet?.
 
If it is found, run the program instead.
 
This is my problem.

Michael Hildner replied on Thursday, May 01, 2008

I see what you're getting at. Sorry I haven't done that. Been spoiled by ClickOnce.

Paul Czywczynski replied on Thursday, May 01, 2008

You could use this as a starting point:

http://www.codeproject.com/KB/cs/frameworkversiondetection.aspx

ajj3085 replied on Friday, May 02, 2008

You could also check the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP

As for installing the framework, VS can build a package that will do the necessary steps for you.  Try creating an installer project.  Alternately, ClickOnce can also do those tasks as well. 

SouthSpawn replied on Friday, May 02, 2008

I believe VS2008 already has what I am looking for.
 
http://weblogs.asp.net/scottgu/archive/2008/02/19/net-3-5-client-product-roadmap.aspx

bobfox replied on Thursday, May 01, 2008

1024x768 Clean Clean 21 false false false DE-AT X-NONE X-NONE MicrosoftInternetExplorer4

This is a batch file which checks for all installed .NET versions:

http://www.dzaebel.net/Downloads/netversions.zip

 

regards, Robert

 

SouthSpawn replied on Thursday, May 01, 2008

bobfox:

This is a batch file which checks for all installed .NET versions:

http://www.dzaebel.net/Downloads/netversions.zip

 

regards, Robert

 

 
Bob,
 
This may check it, but how would I tell it to download a particular version of .Net, else run the .Net exe.
 
Thanks,
Mark

Joffies replied on Friday, May 02, 2008

Why not consider using Click Once?

If you use netversions as per link above for checking and then either

  1. Navigate the user to microsoft downloads to download and install the required framework version or
  2. include the framework redistributable package in your installation package and launch it if the check fails

Copyright (c) Marimer LLC