Solved

How can I check whether .NET Framwork 2.0 is installed or not?

Posted on 2007-11-27
10
296 Views
Last Modified: 2010-04-05
Hi,

How can I check whether .NET Framwork 2.0 is installed or not through a Win32 Delphi app?

Thanks.
0
Comment
Question by:EEssam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 9

Expert Comment

by:unassassinable
ID: 20360305
In control pannel open "add/Remove programs"  the list is in alphabetic order.  Look for Microsoft .Net Framwork
0
 
LVL 9

Expert Comment

by:unassassinable
ID: 20360313
or I could finnish reading the entire question before I hit post...sorry didnt notice the "a Win32 Delphi app?" part.  
0
 
LVL 9

Expert Comment

by:mystics7
ID: 20360329
The NET runtime installs a registry key, you can check it.

For example,
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramewor k\policy\v1.1

for version 1.1.

http://msdn2.microsoft.com/en-us/library/ydh6b3yb.aspx
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:mystics7
ID: 20360335
i should have done the same thing.... finish reading!!!!!
0
 
LVL 18

Accepted Solution

by:
Johnjces earned 500 total points
ID: 20360906
Here is some Delphi code in a button click event.

uses
  Regsitry;
procedure TForm1.Button1Click(Sender: TObject);
var
 Reg : TRegistry;
begin
 Reg := TRegistry.Create;
 Reg.RootKey := HKEY_LOCAL_MACHINE; 
 if Reg.KeyExists('\SOFTWARE\Microsoft\.NETFramework\policy\v1.1') then
  ShowMessage('.NET version 1.1 Found');
 if Reg.KeyExists('\SOFTWARE\Microsoft\.NETFramework\policy\v2.0') then
  ShowMessage('.NET version 2.0 Found');
 if Reg.KeyExists('\SOFTWARE\Microsoft\.NETFramework\policy\v3.0') then
  ShowMessage('.NET version 3.0 Found');
 Reg.Free; 
end;

Open in new window

0
 
LVL 18

Expert Comment

by:Johnjces
ID: 20360910
I have got to check my spelling!

uses
 Registry;

John
0
 

Author Comment

by:EEssam
ID: 20361274
Thanks, it worked but why you're checking "policy" folder not just:

\SOFTWARE\Microsoft\.NETFramework\vXXX

?
0
 
LVL 18

Expert Comment

by:Johnjces
ID: 20361887
Because there is no key there, that I can find, with that designator, I.E.,

\SOFTWARE\Microsoft\.NETFramework\v1.1 does not exist.

Those keys are listed under policy,

SOFTWARE\Microsoft\.NETFramework\policy\v1.1 and does exist.

John
0
 

Author Comment

by:EEssam
ID: 20366609
Are you sure you don't have the key? I have it:

\SOFTWARE\Microsoft\.NETFramework\v1.1.4322

Please check it again.
0
 
LVL 18

Expert Comment

by:Johnjces
ID: 20366973
I do not on my PC here. But I do have

\SOFTWARE\Microsoft\.NETFramework\2.0.40607
and
\SOFTWARE\Microsoft\.NETFramework\2.0.40903
and
\SOFTWARE\Microsoft\.NETFramework\2.0.50727

You should still have the core version listed under policy and I believe that is what you were seeking.

John
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question