Groups | Blog | Home
all groups > dotnet faqs > june 2006 >

dotnet faqs : How to know if .Net framework is installed on the machine?



Kumar Bhogaraju
6/10/2006 12:00:00 AM
I am a newbie to .Net environment. I am writing a small network program in
C#. How can I make sure that the end user machine has .Net framework?
Because if it doesn't my program probably won't even run.

Thanks
Kumar
Joanna Carter [TeamB]
6/10/2006 12:00:00 AM
"Kumar Bhogaraju" <kumar@unosofttech.com> a écrit dans le message de news:
C0B03BDE.486%kumar@unosofttech.com...

|I am a newbie to .Net environment. I am writing a small network program in
| C#. How can I make sure that the end user machine has .Net framework?
| Because if it doesn't my program probably won't even run.

If you mean, can your program detect whether the framework is installed,
then you would need to have a "bootstrap" program written for Win32 without
..NET that checks for the framework and then launches your real .NET program.

Otherwise your .NET only program would not even run to check for the
framework, because the framework isn't there.

I suppose the ultimate check is, if it doesn't run, the framework isn't
installed :-))

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer

Tom
6/11/2006 8:46:30 PM
The NET runtime installs a registry key, you can check it.

For example,
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v1.1

for version 1.1.

-- Tom



[quoted text, click to view]

Roman
6/12/2006 9:21:46 PM
[quoted text, click to view]

for more information, look at this example:
http://msdn2.microsoft.com/en-us/library/ydh6b3yb.aspx


Jon Shemitz
9/4/2006 9:48:48 PM
[quoted text, click to view]

Indeed. One simple solution is to write a console app that does
nothing but return a non-zero result code. If you can run this, and
get the right result, the framework is installed.

This seems (to me) to be simpler than looking for the right registry
key.

--

..NET 2.0 for Delphi Programmers www.midnightbeach.com/.net
Wolf
9/5/2006 12:00:00 AM
I have the same question
"Kumar Bhogaraju" <kumar@unosofttech.com>
??????:C0B03BDE.486%kumar@unosofttech.com...
[quoted text, click to view]

Michael Nemtsev
9/6/2006 12:00:00 AM
Hello wolf,

See my article about this http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!393.entry

w> I have the same question
w> "Kumar Bhogaraju" <kumar@unosofttech.com>
w> ??????:C0B03BDE.486%kumar@unosofttech.com...
[quoted text, click to view]
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

AddThis Social Bookmark Button