| Windows Installer |
The MsiProvideQualifiedComponent function returns the full component path for a qualified component and performs any necessary installation. This function prompts for source if necessary, and increments the usage count for the feature.
UINT MsiProvideQualifiedComponent( LPCTSTR szComponent, LPCTSTR szQualifier, DWORD dwInstallMode, LPTSTR lpPathBuf, DWORD* pcchPathBuf );
| Value | Meaning |
|---|---|
| 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. |
| combination of the REINSTALLMODE flags | Call MsiReinstallFeature to reinstall the 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, it returns ERROR_FILE_NOT_FOUND. This mode only checks that the component is registered and does not verify that the key file exists. |
If lpPathBuf is null, pcchBuf can be null.
| Value | Meaning |
|---|---|
| ERROR_INDEX_ABSENT | The component qualifier is invalid or absent. |
| 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. |
Upon success of the MsiProvideQualifiedComponent 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.
| Version | Requires Windows Installer 1.0 or later on Windows Server 2003, Windows XP, Windows 2000, Windows NT 4.0 SP6a, and Windows Me. |
|---|---|
| Header |
Declared in Msi.h. |
| Library |
Link to Msi.lib. |
| DLL | Requires Msi.dll. |
| Unicode |
Implemented as MsiProvideQualifiedComponentW (Unicode) and MsiProvideQualifiedComponentA (ANSI). |
Component-Specific Functions, Error Codes, Displayed Error Messages, Initialization Error