How can I list / list all installed applications in Windows XP?

When I say “installed application”, basically I mean any application visible in [Control Panel] → [Add or Remove Programs].

I would prefer to do this in Python, but C or C ++ is fine too.

+6
c ++ python enumeration winapi
source share
6 answers

If you mean the list of installed applications, shown in the "Add or Remove Programs" section of the control panel, you can find it in the registry section:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall 

more information about how the registry tree is structured can be found here .

You need to use the winreg API in python to read values ​​from the registry.

+10
source share

Check out the Win32_Product class WMI (Windows Management Instrumentation). Here is a tutorial on using WMI in Python.

+10
source share

The control panel uses the Win32 COM api, which is the official method (see Google Groups, Win32)
Never rely on the registry.

+8
source share

The Microsoft Script repository has a script to print all installed software .

 import win32com.client strComputer = "." objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator") objSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2") colItems = objSWbemServices.ExecQuery("Select * from Win32_Product") for objItem in colItems: print "Caption: ", objItem.Caption print "Description: ", objItem.Description print "Identifying Number: ", objItem.IdentifyingNumber print "Install Date: ", objItem.InstallDate print "Install Date 2: ", objItem.InstallDate2 print "Install Location: ", objItem.InstallLocation print "Install State: ", objItem.InstallState print "Name: ", objItem.Name print "Package Cache: ", objItem.PackageCache print "SKU Number: ", objItem.SKUNumber print "Vendor: ", objItem.Vendor print "Version: ", objItem.Version 
+6
source share

The best registry implementation I've seen is written by Chris Wright (chris128), available at http://www.vbforums.com/showthread.php?t=598355 . It uses several registry keys and is much more complicated than any of the answers posted here. It seems to give identical results to the Add or Remove Programs application and, like the ARP application, also provides the ability to enable updates.

Although implemented in VB.NET, it is easy to convert to other .NET languages ​​such as C # or IronPython. I assume that converting to IronPython should make porting to regular Python fairly simple first if that is what you want, but I only converted it to C # and then cleared the code a bit.

Only one small mistake: GetUserInstallerKeyPrograms () does not add the version for user programs to the list, although it does extract it. It is easy to fix, though.

+4
source share

C # .net code to get a list of installed software using WMI in xp and win7 (wmi is the only way in win7)

  WqlObjectQuery wqlQuery = new WqlObjectQuery("SELECT * FROM Win32_Product"); ManagementObjectSearcher searcher = new ManagementObjectSearcher(wqlQuery); foreach (ManagementObject software in searcher.Get()) { Console.WriteLine(software["Caption"]); } 
+3
source share

All Articles