Expand Minimize

MsiProvideQualifiedComponentEx function

The MsiProvideQualifiedComponentEx function returns the full component path for a qualified component that is published by a product and performs any necessary installation. This function prompts for source if necessary and increments the usage count for the feature.

Syntax


UINT MsiProvideQualifiedComponentEx(
  _In_     LPCTSTR szComponent,
  _In_     LPCTSTR szQualifier,
  _In_     DWORD dwInstallMode,
  _In_     LPTSTR szProduct,
  _In_     DWORD dwUnused1,
  _In_     DWORD dwUnused2,
  _Out_    LPTSTR lpPathBuf,
  _Inout_  DWORD *pcchPathBuf
);

Parameters

szComponent [in]

Specifies the component ID that for the requested component. This may not be the GUID for the component itself but rather a server that provides the correct functionality, as in the ComponentId column of the PublishComponent table.

szQualifier [in]

Specifies a qualifier into a list of advertising components (from PublishComponent Table).

dwInstallMode [in]

Defines the installation mode. This parameter can be one of the following values.

ValueMeaning
INSTALLMODE_DEFAULT

Provide the component and perform any installation necessary to provide the component. If the key file of a component in the requested feature, or a feature parent, is missing, reinstall the feature using MsiReinstallFeature with the following flag bits set: REINSTALLMODE_FILEMISSING, REINSTALLMODE_FILEOLDERVERSION, REINSTALLMODE_FILEVERIFY, REINSTALLMODE_MACHINEDATA, REINSTALLMODE_USERDATA and REINSTALLMODE_SHORTCUT.

INSTALLMODE_EXISTING

Provide the component only if the feature exists. Otherwise return ERROR_FILE_NOT_FOUND.

This mode verifies that the key file of the component exists.

INSTALLMODE_NODETECTION

Provide the component only if the feature exists. Otherwise return ERROR_FILE_NOT_FOUND.

This mode only checks that the component is registered and does not verify that the key file of the component exists.

INSTALLMODE_EXISTING

Provide the component only if the feature exists, else return ERROR_FILE_NOT_FOUND.

combination of the REINSTALLMODE flags

Call MsiReinstallFeature to reinstall feature using this parameter for the dwReinstallMode parameter, and then provide the component.

INSTALLMODE_NOSOURCERESOLUTION

Provide the component only if the feature's installation state is INSTALLSTATE_LOCAL. If the feature's installation state is INSTALLSTATE_SOURCE, return ERROR_INSTALL_SOURCE_ABSENT. Otherwise return ERROR_FILE_NOT_FOUND. This mode only checks that the component is registered and does not verify that the key file exists.

 

szProduct [in]

Specifies the product to match that has published the qualified component. If this is null, then this API works the same as MsiProvideQualifiedComponent.

dwUnused1 [in]

Reserved. Must be zero.

dwUnused2 [in]

Reserved. Must be zero.

lpPathBuf [out]

Pointer to a variable that receives the path to the component. This parameter can be null.

pcchPathBuf [in, out]

Pointer to a variable that specifies the size, in characters, of the buffer pointed to by the lpPathBuf parameter. On input, this is the full size of the buffer, including a space for a terminating null character. If the buffer passed in is too small, the count returned does not include the terminating null character.

If lpPathBuf is null, pcchBuf can be null.

Return value

ValueMeaning
ERROR_INDEX_ABSENT

Component qualifier invalid or not present.

ERROR_SUCCESS

The function completed successfully.

ERROR_FILE_NOT_FOUND

The feature is absent or broken. this error is returned for dwInstallMode = INSTALLMODE_EXISTING.

ERROR_UNKNOWN_COMPONENT

The specified component is unknown.

An error relating to an action

See Error Codes.

Initialization Error

An error relating to initialization occurred.

 

Remarks

Upon success of the MsiProvideQualifiedComponentEx function, the pcchPathBuf parameter contains the length of the string in lpPathBuf.

Features with components containing a corrupted file or the wrong version of a file must be explicitly reinstalled by the user or by having the application call MsiReinstallFeature.

Requirements

Version

Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003 or Windows XP. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.

Header

Msi.h

Library

Msi.lib

DLL

Msi.dll

Unicode and ANSI names

MsiProvideQualifiedComponentExW (Unicode) and MsiProvideQualifiedComponentExA (ANSI)

See also

Component-Specific Functions
Error Codes
Initialization Error
Displayed Error Messages
Multiple-Package Installations

 

 

Community Additions

ADD
Show:
© 2014 Microsoft