Registriert seit: 17. Jan 2007
907 Beiträge
Delphi XE2 Professional
|
AW: Installed Software function
24. Mai 2011, 11:13
War ja klar, dass ich was vergessen musste
Delphi-Quellcode:
procedure GetUninstallList(AList: TStrings);
const
UNINSTALL_PATH = 'Software\Microsoft\Windows\CurrentVersion\Uninstall\';
DISPLAY_NAME = 'DisplayName';
var
LIndex: Integer;
begin
If Assigned(AList) then
begin
AList.BeginUpdate;
try
AList.Clear;
With TRegistry.Create do
try
RootKey := HKEY_LOCAL_MACHINE;
If KeyExists(UNINSTALL_PATH) and OpenKeyReadOnly(UNINSTALL_PATH) then
begin
GetKeyNames(AList);
CloseKey;
end;
LIndex := 0;
While LIndex < AList.Count do
begin
If not (OpenKeyReadOnly(UNINSTALL_PATH + AList[LIndex]) and
ValueExists(DISPLAY_NAME)) then AList.Delete(LIndex)
else begin
AList[LIndex] := ReadString(DISPLAY_NAME);
Inc(LIndex);
end;
CloseKey;
end;
finally
Free;
end;
finally
AList.EndUpdate;
end;
end;
end;
Besser so?
Chris Die Erfahrung ist ein strenger Schulmeister: Sie prüft uns, bevor sie uns lehrt.
|