MsiReinstallFeature

[This is preliminary documentation and subject to change.]

The MsiReinstallFeature function validates or corrects problems with features.

UINT MsiReinstallFeature(
  LPCTSTR szProduct,       // product code
  LPCTSTR szFeature,       // feature ID
  LPCTSTR dwReinstallMode  // one or more REINSTALLMODE modes
);
 

Parameters

szProduct
Specifies the product code for the product containing the feature to be reinstalled.
szFeature
Identifies the feature to be reinstalled.
dwReinstallMode
Specifies what to install. This parameter can be one or more of the following values.
Value Meaning
REINSTALLMODE_REPAIR Repair any defects encountered.
REINSTALLMODE_FILEMISSING Reinstall only if the file is missing.
REINSTALLMODE_FILEOLDERVERSION Reinstall if the file is missing or is an older version.
REINSTALLMODE_FILEEQUALVERSION Reinstall if the file is missing or is an equal or older version.
REINSTALLMODE_FILEEXACT Reinstall if the file is missing or is not an exact version.
REINSTALLMODE_FILEVERIFY Check sum executables, and reinstall if they are missing or corrupt.
REINSTALLMODE_FILEREPLACE Reinstall all files regardless of version.
REINSTALLMODE_USERDATA Insure required user regular entries.
REINSTALLMODE_MACHINEDATA Insure required machine regular entries.
REINSTALLMODE_SHORTCUT Validate shortcuts and progman items.

Return Values

ERROR_INSTALL_FAILURE
The installation failed.
ERROR_INVALID_PARAMETER
An invalid parameter was passed to the function.
ERROR_INSTALL_SERVICE_FAILURE
The installation service could not be accessed.
ERROR_INSTALL_SUSPEND
The installation was suspended and is incomplete.
ERROR_INSTALL_USEREXIT
The user canceled the installation.
ERROR_SUCCESS
The function completed successfully.
ERROR_UNKNOWN_FEATURE
The feature ID does not identify a known feature.
ERROR_UNKNOWN_PRODUCT
The product code does not identify a known product.

Remarks

The MsiReinstallFeature function can also verify registry entries and shortcuts.

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

Installation and Configuration Functions