• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 300
  • Last Modified:

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

Hi,

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

Thanks.
0
EEssam
Asked:
EEssam
  • 4
  • 2
  • 2
  • +1
1 Solution
 
unassassinableCommented:
In control pannel open "add/Remove programs"  the list is in alphabetic order.  Look for Microsoft .Net Framwork
0
 
unassassinableCommented:
or I could finnish reading the entire question before I hit post...sorry didnt notice the "a Win32 Delphi app?" part.  
0
 
mystics7Commented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
mystics7Commented:
i should have done the same thing.... finish reading!!!!!
0
 
JohnjcesCommented:
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
 
JohnjcesCommented:
I have got to check my spelling!

uses
 Registry;

John
0
 
EEssamAuthor Commented:
Thanks, it worked but why you're checking "policy" folder not just:

\SOFTWARE\Microsoft\.NETFramework\vXXX

?
0
 
JohnjcesCommented:
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
 
EEssamAuthor Commented:
Are you sure you don't have the key? I have it:

\SOFTWARE\Microsoft\.NETFramework\v1.1.4322

Please check it again.
0
 
JohnjcesCommented:
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now