Ich möchte in der Registry (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Cur rentVersion\App Paths) allen installierte Programme
auflisten.Habe folgenden Code gefunden.Das Memofeld bleibt aber leer.
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
AppInfo: String;
TempStrings: TStringList;
I: Integer;
begin
TempStrings := TStringList.Create;
Memo1.Lines.Clear;
AppInfo := '';
with TRegistry.Create do
begin
RootKey := HKEY_LOCAL_MACHINE;
OpenKey('\Software\Microsoft\Windows\CurrentVersion\App Paths', True); //Open specific key...
GetKeyNames(TempStrings);
CloseKey;
for I := 0 to TempStrings.Count - 1 do
begin
OpenKey('\Software\Microsoft\Windows\CurrentVersion\App Paths\' + TempStrings[I], True);
AppInfo := 'File path: ' + ReadString('') + #13#10;
if ValueExists('Path') then AppInfo := AppInfo + 'Path: ' + ReadString('Path') + #13#10;
if ValueExists('Version') then AppInfo := AppInfo + 'Version: ' + ReadString('Version') + #13#10;
AppInfo := AppInfo + '--------------------------------------';
Memo1.Lines.Add(AppInfo);
CloseKey;
end;
Free;
end;
TempStrings.Free;
end;