procedure TfrmMain.Button1Click(Sender: TObject);
var
f: Textfile;
i: integer;
begin
AssignFile(f,'proba.txt');
Rewrite(f);
for i:= 0 to uList.Items.Count - 1 do
begin
Try
Writeln(f, 'Name:');
Writeln(f, uList.Items[i].Caption);
Writeln(f, 'Publisher:');
Writeln(f, uList.Items[i].SubItems[1]);
Writeln(f, 'Version:');
Writeln(f, uList.Items[i].SubItems[0]);
Writeln(f, 'Uninstall:');
Writeln(f, uList.Items[i].SubItems[2]);
Writeln(f, '**************');
Writeln(f, ' ');
Except;
end;
end;
CloseFile(f);
end;
procedure TfrmMain.btnRefreshClick(Sender: TObject);
var
theRegistry: TRegistry;
uEntries: TStrings;
index: Integer;
item: TListItem;
str: integer;
begin
uList.Clear;
uEntries := TStringList.Create;
theRegistry := TRegistry.Create;
theRegistry.RootKey := HKEY_LOCAL_MACHINE;
theRegistry.OpenKey(UNINSTALLROOT, False);
theRegistry.GetKeyNames(uEntries);
theRegistry.CloseKey;
for index := 0 to uEntries.Count -1 do begin
theRegistry.OpenKey(UNINSTALLROOT + uEntries[index], False);
if theRegistry.ValueExists('DisplayName') then begin
item := uList.items.add;
item.Caption := theRegistry.ReadString('DisplayName');
if theRegistry.ValueExists('DisplayVersion') then
item.SubItems.Add(theRegistry.ReadString('DisplayVersion')) else
item.SubItems.Add('null');
if theRegistry.ValueExists('Publisher') then
item.SubItems.Add(theRegistry.ReadString('Publisher')) else
item.SubItems.Add('null');
if theRegistry.ValueExists('UninstallString') then
item.SubItems.Add(theRegistry.ReadString('UninstallString')) else
if theRegistry.ValueExists('QuietUninstallString') then
item.SubItems.Add(theRegistry.ReadString('QuietUninstallString')) else
item.SubItems.Add('null');
if theRegistry.ValueExists('InstallDate') then
item.SubItems.Add(theRegistry.ReadString('InstallDate')) else
item.SubItems.Add('null');
if theRegistry.ValueExists('EstimatedSize') then
item.SubItems.Add(IntToStr(theRegistry.ReadInteger('EstimatedSize'))) else
item.SubItems.Add('null');
end;
theRegistry.CloseKey;
end;
FreeAndNil(theRegistry);
FreeAndNil(uEntries);
StatusBar.SimpleText := Format('%d Application(s)', [uList.Items.Count]);
end;
procedure TfrmMain.FormActivate(Sender: TObject);
var
f: Textfile;
i: integer;
j: Real;
str: string;
begin
AssignFile(f,'proba.txt');
Rewrite(f);
for i:= 0 to uList.Items.Count - 1 do
begin
Writeln(f, 'Name:');
Writeln(f, uList.Items[i].Caption);
Writeln(f, 'Publisher:');
Writeln(f, uList.Items[i].SubItems[1]);
Writeln(f, 'Version:');
Writeln(f, uList.Items[i].SubItems[0]);
Writeln(f, 'Size:');
if uList.Items[i].SubItems[4] <> 'null' then
begin
j:= StrToInt(uList.Items[i].SubItems[4]);
str:= FloatToStrF((j / 1024), ffNumber, 5, 2) + ' Mb';
Writeln(f, str);
end
else
Writeln(f, 'null');
Writeln(f, 'Date:');
Writeln(f, uList.Items[i].SubItems[3]);
Writeln(f, 'Uninstall:');
Writeln(f, uList.Items[i].SubItems[2]);
Writeln(f, '**************');
Writeln(f, ' ');
end;
CloseFile(f);
end;
procedure TfrmMain.btnRefreshClick(Sender: TObject);
var
theRegistry: TRegistry;
uEntries: TStrings;
index: Integer;
item: TListItem;
str: integer;
begin
uList.Clear;
uEntries := TStringList.Create;
theRegistry := TRegistry.Create;
theRegistry.RootKey := HKEY_LOCAL_MACHINE;
theRegistry.OpenKey(UNINSTALLROOT, False);
theRegistry.GetKeyNames(uEntries);
theRegistry.CloseKey;
for index := 0 to uEntries.Count -1 do begin
theRegistry.OpenKey(UNINSTALLROOT + uEntries[index], False);
if theRegistry.ValueExists('DisplayName') then begin
item := uList.items.add;
item.Caption := theRegistry.ReadString('DisplayName');
if theRegistry.ValueExists('DisplayVersion') then
item.SubItems.Add(theRegistry.ReadString('DisplayVersion')) else
item.SubItems.Add('null');
if theRegistry.ValueExists('Publisher') then
item.SubItems.Add(theRegistry.ReadString('Publisher')) else
item.SubItems.Add('null');
if theRegistry.ValueExists('UninstallString') then
item.SubItems.Add(theRegistry.ReadString('UninstallString')) else
if theRegistry.ValueExists('QuietUninstallString') then
item.SubItems.Add(theRegistry.ReadString('QuietUninstallString')) else
item.SubItems.Add('null');
if theRegistry.ValueExists('InstallDate') then
item.SubItems.Add(theRegistry.ReadString('InstallDate')) else
item.SubItems.Add('null');
if theRegistry.ValueExists('EstimatedSize') then
item.SubItems.Add(IntToStr(theRegistry.ReadInteger('EstimatedSize'))) else
item.SubItems.Add('null');
end;
theRegistry.CloseKey;
end;
FreeAndNil(theRegistry);
FreeAndNil(uEntries);
StatusBar.SimpleText := Format('%d Application(s)', [uList.Items.Count]);
end;
procedure TfrmMain.FormActivate(Sender: TObject);
var
f: Textfile;
i: integer;
j: Real;
str: string;
begin
AssignFile(f,'proba.txt');
Rewrite(f);
for i:= 0 to uList.Items.Count - 1 do
begin
Writeln(f, 'Name:');
Writeln(f, uList.Items[i].Caption);
Writeln(f, 'Publisher:');
Writeln(f, uList.Items[i].SubItems[1]);
Writeln(f, 'Version:');
Writeln(f, uList.Items[i].SubItems[0]);
Writeln(f, 'Size:');
if uList.Items[i].SubItems[4] <> 'null' then
begin
j:= StrToInt(uList.Items[i].SubItems[4]);
str:= FloatToStrF((j / 1024), ffNumber, 5, 2) + ' Mb';
Writeln(f, str);
end
else
Writeln(f, 'null');
Writeln(f, 'Date:');
Writeln(f, uList.Items[i].SubItems[3]);
Writeln(f, 'Uninstall:');
Writeln(f, uList.Items[i].SubItems[2]);
Writeln(f, '**************');
Writeln(f, ' ');
end;
CloseFile(f);
end;
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.