Bewerken

Delen via


Enumerating Components

Windows Installer 5.0 running on Windows Server 2008 R2 or Windows 7 can enumerate all components installed on the computer and obtain the key path for the component. A package authored for Windows Installer 5.0 can use the MsiEnumComponentsEx, MsiEnumClientsEx, and MsiGetComponentPathEx functions to search for components and products across user accounts and installation contexts. The MsiEnumComponents, MsiEnumClients, and MsiGetComponentPath functions only return information for components and products installed for the user account that called the function. Multiple calls to these functions, at least once for each user account, are required to collect information for the entire computer.

The MsiEnumComponentsEx function enumerates installed components. The function retrieves one component code each time it is called. The Component Object receives information about an installed component by this function.

The MsiEnumClientsEx function enumerates products that are clients of a specified installed component. The Client Object receives information about a client by this function.

The MsiGetComponentPathEx function returns the full path to an installed component. The function returns the registry key if the key path for the component is a registry key. The ComponentInfo Object receives information about an installed component by this function.

Windows Installer 4.5 or earlier: Not supported. This functionality is available beginning with Windows Installer 5.0 running on Windows 7 or Windows Server 2008 R2.