MsiRemovePatchesA function (msi.h)
The MsiRemovePatches function removes one or more patches from a single product. To remove a patch from multiple products, MsiRemovePatches must be called for each product.
Syntax
UINT MsiRemovePatchesA(
[in] LPCSTR szPatchList,
[in] LPCSTR szProductCode,
[in] INSTALLTYPE eUninstallType,
[in, optional] LPCSTR szPropertyList
);
Parameters
[in] szPatchList
A null-terminated string that represents the list of patches to remove. Each patch can be specified by the GUID of the patch or the full path to the patch package. The patches in the list are delimited by semicolons.
[in] szProductCode
A null-terminated string that is the ProductCode (GUID) of the product from which the patches are removed. This parameter cannot be NULL.
[in] eUninstallType
Value that indicates the type of patch removal to perform. This parameter must be INSTALLTYPE_SINGLE_INSTANCE.
Value | Meaning |
---|---|
|
The patch is uninstalled for only the product specified by szProduct. |
[in, optional] szPropertyList
A null-terminated string that specifies command-line property settings. For more information see
About Properties and
Setting Public Property Values on the Command Line. This parameter can be NULL.
Return value
The MsiRemovePatches function returns the following values.
Value | Meaning |
---|---|
|
An invalid parameter was included. |
|
The patch package could not be opened. |
|
The patch was successfully removed. |
|
The product specified by szProductList is not installed either per-machine or per-user for the caller of MsiRemovePatches. |
|
The patch package could not be opened. |
|
The patch package is invalid. |
|
The patch package cannot be processed by this version of the Windows Installer service. |
|
The patch package is not removable. |
|
The patch has not been applied to this product. |
|
Patch removal was disallowed by policy. |
Remarks
See Uninstalling Patches for an example that demonstrates how an application can remove a patch from all products that are available to the user.
Note
The msi.h header defines MsiRemovePatches as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | 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. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version. |
Target Platform | Windows |
Header | msi.h |
Library | Msi.lib |
DLL | Msi.dll |
See also
Multiple-Package Installations
Not Supported in Windows Installer 2.0 and earlier