I use the search in the register and the Win32_Product class to get the list of the programs installed on the computer, but it doesn’t give all the programs, I’ve seen programs in C ++ that give the same results as in the programs and components of the control panel. Is there any api for python that can give me the same result. Here is the code for c ++ https://www.codeproject.com/Articles/6791/How-to-get-a-list-of-installed-applications That's what i use: 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("Name: ", objItem.Name)
And whis registry:
aReg = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
for i in range(1024):
try:
asubkey_name = EnumKey(aKey, i)
asubkey = OpenKey(aKey, asubkey_name)
val = str(QueryValueEx(asubkey, "DisplayName"))
b = "!@#$,01'"
for char in b:
val = val.replace(char, "")
r = len(val)
val = str(val[1:r - 2])
val2 = str(QueryValueEx(asubkey, "DisplayIcon"))
if s.lower() in val.lower():
r = len(val2)
val2 = str(val2[2:r - 5])
# print(val2)
subprocess.Popen(val2)
break
# print(val, val2)
except EnvironmentError:
continue
SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
. Flags areKEY_WOW64_32KEY
to explicitly access the 32-bit branch andKEY_WOW64_64KEY
to explicitly access the 64-bit branch. – Attic