How do I find all the Windows Installer packages installed on my machine?

Question

How do I find all the Windows Installer packages installed on my machine?

Answer

Here’s the APIs and the Properties one would need

MsiEnumProducts(DWORD,LPTSTR) function [Windows Installer]
MsiEnumProductsEx (8 Parameters) function [Windows Installer]

[ProductCode Property

](https://msdn.microsoft.com/library/en-us/vsintro7/html/vxgrfproductcodeproperty.asp)MsiGetProductInfoEx (6 Parameters) function [Windows Installer]
MsiGetProductInfo(LPCTSTR,LPCTSTR,LPTSTR,DWORD) function [Windows Installer]

UpgradeCode property [Windows Installer]

If one were interested in finding the installation location, use

MsiSourceListGetInfo (7 Parameters) function [Windows Installer]
MsiSourceListEnumSources (7 Parameters) function [Windows Installer]
MsiSourceListEnumMediaDisks (10 Parameters) function [Windows Installer]

What would be really cool is to migrate the feature states as well with

MsiQueryFeatureState(LPCTSTR,LPCTSTR) function [Windows Installer]
MsiQueryFeatureStateEx (5 Parameters) function [Windows Installer]

To populate the preselected properties

ADDSOURCE property [Windows Installer]
ADVERTISE property [Windows Installer]
ADDLOCAL property [Windows Installer]

 

[Author: Robert Flaming]

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at https://www.microsoft.com/info/cpyright.htm.