Test if .NET is installed

  • Thread starter Thread starter Michael A. Covington
  • Start date Start date
M

Michael A. Covington

What is the best way to test whether .NET 1.1 is installed on someone's
machine? I'd like to give him a small program to run to test this, and
based on the answer, he'll download either the big version (with
dotnetfx.exe) or the small version of the install package for the app we're
distributing.

Test for existence of a directory under %WINDIR%?
 
Theres a bunch of information below on how to do it - I never wrote it and I
cant recall who did, but credit to them. Best tip is probably the uninstall
registry setting, as thats the most lieky indicator that the framework
runtime is actually still installed.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director



There are lot of ways you can check for .NET framework installation.

The registry actually contains this information. It is located somewhere
like this:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework
Setup\NDP\v1.1.4322\1033

The .NET Framework 1.0 is version 1.0.3705
The .NET Framework 1.1 is version 1.1.4322

1033 means English, so you can also check which languages of the Framework
are also present on the machine.

You could check the registry. The location
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
contains a registry key for each program installed. This information is
listed in Add/Remove Programs in Control Panel.

The key for Microsoft .NET Framework is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B433
57AA-3A6D-4D94-B56E-43C44D09E548}

I suppose you can check the subkeys under
HKLM\Software\Microsoft\.NETFramework or
HKLM\Software\Microsoft\ASP.NET
registry key. There should be seperate subkeys for each version.

Also check this links

HOW TO: Detect Which Version of the .NET Framework Is Installed in a
Deployment Package
http://support.microsoft.com/?id=315291

http://support.microsoft.com/default.aspx?scid=kb;[LN];315291

http://www.microsoft.com/indonesia/msdn/net_bootstrapper.asp

Also you can check for the .NET framework installation folder presence in
the windows\microsoft.net\framework..but checking it from the Registry is
more accurate.
 
Michael said:
What is the best way to test whether .NET 1.1 is installed on someone's
machine? I'd like to give him a small program to run to test this, and
based on the answer, he'll download either the big version (with
dotnetfx.exe) or the small version of the install package for the app
we're distributing.

Test for existence of a directory under %WINDIR%?

How about running csc --version
 
Just a quick question, if you are going to give him a program to test if he
has the .NET system wont he need the .NET system to run the test application
anyway? I'm looking into the distriution of .NET applications and trying to
see which files need to be distributed and when. Thanks for the info
 
David Pendrey said:
Just a quick question, if you are going to give him a program to test if
he has the .NET system wont he need the .NET system to run the test
application anyway? I'm looking into the distriution of .NET applications
and trying to see which files need to be distributed and when. Thanks for
the info

Obviously, the program to perform the test will have to be written in a
non-.NET framework. If I proceed with this, I'll probably use Delphi.
 
Take a look at the "Stand Alone EXE" thread.

Thinstall is really what you need.

Jim Hubbard
 
Hi John,

I am developing a set up programm for my web application using
InstalledShield. Before set up starts, I want to check if .net framework
installed or not? So how can I check this from my installedshied script?

Plz guide me.
 
I have no idea unfortunately. I'm sure it has facilities that allow you to
evaluate certain criteria for an install, I would check with their site.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
Back
Top