Delphi Ultra-Fast Way To List Software And Microsoft Products Installed On Windows From Within In Your Delphi Apps

FireWind

Свой
Регистрация
2 Дек 2005
Сообщения
1,957
Реакции
1,199
Credits
4,009
Ultra-Fast Way To List Software And Microsoft Products Installed On Windows From Within In Your Delphi Apps
February 4, 2021 by Anbarasan

Do your need to list down the Software’s installed in your machine programmatically. How to get the Name, Software Version, Installed Date, etc. for each software installed quickly ? Don’t know how to do >Don’t worry. Для просмотра ссылки Войди или Зарегистрируйся System Information Management Suite’s component helps to get these information with less code and we will learn how to use TMiTeC_Software and TMiTeC_MSProduct in this blog post.

Platforms: Windows.

Installation Steps:
You can easily install this Component Suite from GetIt Package Manager. The steps are as follows.
  1. Navigate In RAD Studio IDE->Tools->GetIt Package Manager->select Components in Categories->Components->Trail -MiTec system Information Component Suite 14.3 and click Install Button.
  2. Read the license and Click Agree All. An Information dialog saying ‘Requires a restart of RAD studio at the end of the process. Do you want to proceed? click yes and continue.
  3. It will download the plugin and installs it. Once installed Click Restart now.
How to run the Demo app:
  • Navigate to the System Information Management Suite trails setup, Demos folder which is installed during Get It installation e.g) C:UsersDocumentsEmbarcaderoStudio21.0CatalogRepositoryMiTeC-14.3DemosDelphi3
  • Open the SWView project in RAD studio 10.4.1 compile and Run the application.
  • This Demo App shows how to list down the Installed software’s, enumerate among them and access its properties.
Components used in MSIC PV Demo App:
  • TMiTeC_Software: Enumerates installed software including system updates and system components.
  • TMiTeC_MSProduct: Enumerates installed Microsoft® products and their Product keys and IDs.
  • TTabsheet’s one for viewing Software’s list inTListView and other for viewing Microsoft Products in TListView.
  • TButton to load, save and refresh.
Implementation Details:
  • An instance SW of TMiTeC_Software is created. Add the list of software’s available by loop through the Count property. Retrieves the TInstallRecord for each InstallEntry and shows the installed software name, version, installed uninstall path etc.
  • An instance MS of TMiTeC_MSProduct is created. Add the list of Microsoft Products installed by loop through the ProductCount property. Retrieves the TMSRecord for each Products and shows the Product name, Id, key, Registry Path.
Код:
procedure TForm1.DisplayData;
var
  i: Integer;
begin
  with lv.Items do begin
      BeginUpdate;
      try
        Clear;
        for i:=0 to SW.Count-1 do
          with Add do begin
            Caption:=SW.InstallEntry[i].Name;
            SubItems.Add(SW.InstallEntry[i].Version);
            SubItems.Add(SW.InstallEntry[i].Company);
            SubItems.Add(DateToStr(SW.InstallEntry[i].InstallDate));
            SubItems.Add(SW.InstallEntry[i].Uninstall);
            SubItems.Add(SW.InstallEntry[i].HelpLink);
            SubItems.Add(SW.InstallEntry[i].AboutLink);
            SubItems.Add(SW.InstallEntry[i].InfoLink);
            SubItems.Add(SW.InstallEntry[i].UpdateLink);
          end;
      finally
        EndUpdate;
      end;
    end;
  Tabsheet1.Caption:=Format('Installed Software - %d records',[SW.Count]);
 
  with lvMSP.Items do begin
      BeginUpdate;
      try
        Clear;
        for i:=0 to MS.ProductCount-1 do
          with Add do begin
            Caption:=MS.Products[i].Name;
            SubItems.Add(MS.Products[i].ProductID);
            SubItems.Add(MS.Products[i].ProductKey);
            SubItems.Add(MS.Products[i].RegistryPath);
          end;
      finally
        EndUpdate;
      end;
    end;
  Tabsheet2.Caption:=Format('MS Products - %d records',[MS.ProductCount]);
end;

1612455497158.png
MiTeC SWView Demo
It’s that simple to list down the software’s installed in your machine and access its properties with less code. Use this MiTeC component suite and get the job done quickly.

Для просмотра ссылки Войди или Зарегистрируйся