?
Solved

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

Posted on 2007-11-27
10
Medium Priority
?
298 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 2000 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month12 days, 3 hours left to enroll

752 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