Monday, November 17, 2008

Taking inventory of installed products, features, and components

(Short version.)

They’re not at all difficult to find, but some often overlooked MSI API functions to enumerate what’s installed on a system:

  • What products are installed: MsiEnumProducts or MsiEnumProductsEx (in VBScript, Installer.Products or Installer.ProductsEx)
  • What features are installed for a product: MsiEnumFeatures (Installer.Features)
  • What components are installed: MsiEnumComponents (Installer.Components)

Product and component information:

  • Installed product information (install location, date, version, that sort of thing): MsiGetProductInfo or MsiGetProductInfoEx (VBScript Installer.ProductInfo)
  • Installed component information: MsiGetComponentPath (Installer.ComponentPath)
  • Given a component, which products use it: MsiEnumClients (Installer.ComponentClients)

Product, feature, component states (installed? advertised? etc.):

  • MsiQueryProductState, MsiQueryFeatureState, MsiQueryComponentState (Installer.ProductState/FeatureState/ComponentState)

No comments: