Вниз
Скачать: CL | DM;

реестр   Найти похожие ветки 

← →
гость   (2005-01-22 12:27) [0]

Как вывести список всех инсталлированных программ? можно их деинсталлировать средствами delphi


← →
Knight ©   (2005-01-22 12:33) [1]

Считывай из
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

Имя проги - DisplayName...
Там же - UninstallString


← →
гость   (2005-01-22 12:39) [2]

Ну это понятно. А как считать все DisplayName и UninstallString?


← →
Vasya.ru ©   (2005-01-22 13:21) [3]

в цикле, очевидно, можно еще рекурсией :)


← →
begin...end ©   (2005-01-22 13:25) [4]

> [2] гость   (22.01.05 12:39)

TRegistry.[ReadSections, ReadString]


← →
гость   (2005-01-22 14:33) [5]

Нашел исходник ну чего-то не разберусь.
uses
 Registry;

procedure TForm1.Button1Click(Sender: TObject);
const
 UNINST_PATH = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
var
 Reg: TRegistry;
 SubKeys: TStringList;
 ListItem: TlistItem;
 i: integer;
 sDisplayName, sUninstallString: string;
begin
 {
   ListView1.ViewStyle := vsReport;
   ListView1.Columns.add;
   ListView1.Columns.add;
   ListView1.Columns[0].caption := "DisplayName";
   ListView1.Columns[1].caption := "UninstallString";
   ListView1.Columns[0].Width := 300;
   ListView1.Columns[1].Width := 300;
  }
 Reg := TRegistry.Create;
 with Reg do
 try
   with ListView1.Items do
   try
     BeginUpdate;
     Clear;
     RootKey := HKEY_LOCAL_MACHINE;
     if OpenKeyReadOnly(UNINST_PATH) then
     begin
       SubKeys := TStringList.Create;
       try
         GetKeyNames(SubKeys);
         CloseKey;
         for i := 0 to subKeys.Count - 1 do
           if OpenKeyReadOnly(Format("%s\%s", [UNINST_PATH, SubKeys[i]])) then
           try
             sDisplayName := ReadString("DisplayName");
             sUninstallString := ReadString("UninstallString");
             if sDisplayName <> "" then
             begin
               ListItem := Add;
               ListItem.Caption := sDisplayName;
               ListItem.subitems.Add(sUninstallString);
             end;
           finally
             CloseKey;
           end;
       finally
         SubKeys.Free;
       end;
     end;
   finally
     ListView1.AlphaSort;
     EndUpdate;
   end;
 finally
   CloseKey;
   Free;
 end;
end;


← →
Knight ©   (2005-01-22 15:08) [6]

Ты случайно не тот который "программист"? %)



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.46 MB
Время: 0.024 c
6-1101212900
BFG9k
2004-11-23 15:28
2005.02.06
idFTP - ошибка соединения с сервером


6-1100809826
Nick_
2004-11-18 23:30
2005.02.06
Байты


9-1099606923
wiz
2004-11-05 01:22
2005.02.06
Rust. Внешний вид игрового GUI


1-1106730895
s_ilnar
2005-01-26 12:14
2005.02.06
Считывание файлов в несколько потоков


3-1104335744
denis24
2004-12-29 18:55
2005.02.06
create table "temp.db"......table is busy




   Наверх