Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to get the installed software Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
Get the installed software Display Name and UninstallString. 02-Aug-04
Category
System
Language
Delphi All Versions
Views
423
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
Lauridsen, Tobias
Reference URL:
			1   
2   {
3    The installed software information is stored in the Registry.
4   
5     Installed on All Users
6      Rootkey : HKEY_LOCAL_MACHINE
7      Path : SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
8   
9     Installed on Current User
10     Rootkey : HKEY_CURRENT_USER
11     Path : SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
12  
13   DisplayName is the title of the program.
14   UnistallString is the path used for uninstallation of the software.
15   If DisplayName and UnistallString exists it is a installet program.
16  }
17  
18  //This example shows how to get the installet software for all users.
19  unit Unit1;
20  
21  interface
22  
23  uses
24    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
25    Dialogs, StdCtrls,Registry;
26  
27  type
28    TForm1 = class(TForm)
29      ListBox1: TListBox;
30      Button1: TButton;
31      procedure Button1Click(Sender: TObject);
32    private
33      { Private declarations }
34    public
35      { Public declarations }
36    end;
37  
38  var
39    Form1: TForm1;
40  
41  implementation
42  
43  {$R *.dfm}
44  
45  procedure TForm1.Button1Click(Sender: TObject);
46  var
47    Reg : TRegistry;
48    Keys : TStringlist;
49    I : Integer;
50  begin
51    Keys := TStringlist.Create;
52    Reg := TRegistry.Create;
53    { Change the rootkey to HKEY_CURRENT_USER to get the installed software for the 
54  current user.}
55     Reg.RootKey := HKEY_LOCAL_MACHINE;
56      Reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall', False);
57       Reg.GetKeyNames(Keys);
58      Reg.CloseKey;
59    for I := 0 to Keys.Count-1 do
60      begin
61        if 
62  Reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\'+Keys.Strings[I], 
63  false) then
64          begin
65            if Reg.ValueExists('DisplayName') and Reg.ValueExists('UninstallString') 
66  then
67             ListBox1.Items.Add(Reg.ReadString('DisplayName')+' | 
68  'Reg.ReadString('UninstallString'));
69            Reg.CloseKey;
70          end;
71      end;
72    Reg.Free;
73    Keys.Free;
74  end;
75  
76  
77  end.
78  


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC