Mam pewien problem: Program służy do wyświtlania listy zainstalowanych programów. Pod delphi wszystko działa ale na FreePascalu już nie (Nie wyświetla w ListBoxie zainstalowanych programów). Wie ktoś może co zrobić aby działał również pod freepascalem ? [???] Oto kod:
TUC=class
ucDisplayName,
ucUninstallCommand,
ucRegKey: String;
constructor Create(DisplayName, UninstallCommand, RegKey: String);
end;
constructor TUC.Create(DisplayName, UninstallCommand, RegKey: String);
begin
ucDisplayName:=DisplayName;
ucUninstallCommand:=UninstallCommand;
ucRegKey:=RegKey;
inherited Create;
end;
procedure TFMain.FormShow(Sender: TObject);
var
Reg: TRegistry;
UninstallList: TStringList;
I: Integer;
UnC: TUC;
begin
Reg:=TRegistry.Create;
try
Reg.RootKey:=HKEY_LOCAL_MACHINE;
Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Uninstall',False);
UninstallList:=TStringList.Create;
Reg.GetKeyNames(UninstallList);
Reg.CloseKey;
ListBox1.Items.BeginUpdate;
for I:=0 to UninstallList.Count-1 do
begin
Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Uninstall\' +
UninstallList.Strings[I], False);
if Reg.ValueExists('DisplayName') then
begin
UnC:=TUC.Create(Reg.ReadString('DisplayName'),
Reg.ReadString('UninstallString'),
'Software\Microsoft\Windows\CurrentVersion\Uninstall\' +
UninstallList.Strings[I]);
ListBox1.Items.AddObject(UnC.ucDisplayName, UnC);
end
else
begin
if Reg.ValueExists('QuietDisplayName') then
begin
UnC:=TUC.Create(Reg.ReadString('QuietDisplayName'),
Reg.ReadString('QuietUninstallString'),
'Software\Microsoft\Windows\CurrentVersion\Uninstall\' +
UninstallList.Strings[I]);
ListBox1.Items.AddObject(UnC.ucDisplayName+
' [Warning: Quiet mode detected]', UnC);
end
end;
reg.CloseKey;
end;
ListBox1.Items.EndUpdate;
finally
Reg.Free;
end;
end;
Z góry dziękuje za odpowiedź.