MsiGetComponentPath

[This is preliminary documentation and subject to change.]

The MsiGetComponentPath function returns the full path to an installed component. If the key path for the component is a registry key then the registry key is returned.

INSTALLSTATE MsiGetComponentPath(
  LPCTSTR szProduct,   // product code for client product
  LPCTSTR szComponent, // component ID
  LPTSTR lpPathBuf,    // returned path
  DWORD *pcchBuf       // in/out buffer character count
);
 

Parameters

szProduct
Specifies the product code for the client product.
szComponent
Specifies the component ID of the component to be located.
lpPathBuf
Pointer to a variable that receives the path to the component. This parameter can be NULL.
pcchBuf
Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the lpPathBuf parameter.

If lpPathBuf is NULL, pcchBuf can be NULL.

Return Values

ERROR_INSTALL_NOTUSED
The component being requested is disabled on the computer.
INSTALLSTATE_ABSENT
The component is not installed.
INSTALLSTATE_BAD_CONFIGURATION
The configuration data is corrupt.
INSTALLSTATE_INVALIDARG
One of the function parameters is invalid.
INSTALLSTATE_LOCAL
The component is installed locally.
INSTALLSTATE_SOURCE
The component is installed to run from source.
INSTALLSTATE_SOURCEABSENT
The component source is inaccessible.
INSTALLSTATE_UNKNOWN
The product code or component ID is unknown.

Remarks

Upon success of the MsiGetComponentPath function, the pcchBuf parameter contains the length of the string in lpPathBuf.

The MsiGetComponentPath function might return INSTALLSTATE_ABSENT or INSTALL_STATE_UNKNOWN, for the following reasons:

QuickInfo

  Windows NT: Requires version 4.0 or later. Available as a redistributable for Windows NT 4.0.
  Windows: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in msi.h.
  Import Library: Use msi.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Component-Specific Functions