MsiReinstallProduct Function

Windows Installer

MsiReinstallProduct Function

The MsiReinstallProduct function reinstalls products.

Syntax

C++UINT MsiReinstallProduct(
  __in  LPCTSTR szProduct,
  __in  DWORD dwReinstallMode
);

Parameters

szProduct [in]

Specifies the product code for the product to be reinstalled.

dwReinstallMode [in]

Specifies the reinstall mode. This parameter can be one or more of the following values.

Value Meaning
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 a different version.

REINSTALLMODE_FILEVERIFY

Verify the checksum values and reinstall the file if they are missing or corrupt. This flag only repairs files that have msidbFileAttributesChecksum in the Attributes column of the File table.

REINSTALLMODE_FILEREPLACE

Force all files to be reinstalled, regardless of checksum or version.

REINSTALLMODE_USERDATA

Rewrite all required registry entries from the Registry Table that go to the

HKEY_CURRENT_USER

or

HKEY_USERS

registry hive.
REINSTALLMODE_MACHINEDATA

Rewrite all required registry entries from the Registry Table that go to the

HKEY_LOCAL_MACHINE

or

HKEY_CLASSES_ROOT

registry hive. Rewrite all information from the Class Table, Verb Table, PublishComponent Table, ProgID Table, MIMET Table, Icon Table, Extension Table, and AppID Table regardless of machine or user assignment. Reinstall all qualified components.

When reinstalling an application, this option runs the RegisterTypeLibraries and InstallODBC actions.

REINSTALLMODE_SHORTCUT

Reinstall all shortcuts and re-cache all icons overwriting any existing shortcuts and icons.

REINSTALLMODE_PACKAGE

Use to run from the source package and re-cache the local package. Do not use for the first installation of an application or feature.

 

Return Value

Return code Description
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_PRODUCT

The product code does not identify a known product.

 

For more information, see Displayed Error Messages.

Requirements

VersionWindows Installer 5.0 on 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, Windows XP, and Windows 2000. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.
HeaderMsi.h
LibraryMsi.lib
DLLMsi.dll
Unicode and ANSI namesMsiReinstallProductW (Unicode) and MsiReinstallProductA (ANSI)

See Also

Installation and Configuration Functions
REINSTALLMODE Property
Multiple Package Installations

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.