Skip to content

PatchInstallation Class

The Patch object represents a unique instance of a patch that has been registered or applied.

MethodDescription
GetPatches(patchCode, targetProductCode, userSid, context, states)Enumerates patch installations based on certain criteria.
PropertyDescription
AllPatchesEnumerates all patch installations on the system.
DisplayNameGet the registered display name for the patch.
InstallDateGets the date and time when the patch is applied to the product.
IsInstalledGets a value indicating whether this patch is currently installed.
IsObsoletedGets a value indicating whether this patch is marked as obsolte.
IsSupersededGets a value indicating whether this patch is present but has been superseded by a more recent installed patch.
ItemGets information about a specific patch installation.
LocalPackageGets the cached patch file that the product uses.
MoreInfoUrlGets the registered support information URL for the patch.
PatchCodeGets the patch code (GUID) of the patch.
ProductCodeGets the ProductCode (GUID) of the product.
StateGets the installation state of this instance of the patch.
TransformsGets the set of patch transforms that the last patch installation applied to the product.
UninstallableTrue patch is marked as possible to uninstall from the product.
WixToolset.Dtf.WindowsInstaller.dll version 5.0.0+41e11442b2ca93e444b60213b5ae99dcbab787d8

GetPatches(patchCode, targetProductCode, userSid, context, states) Method

Section titled “GetPatches(patchCode, targetProductCode, userSid, context, states) Method”

Enumerates patch installations based on certain criteria.

public static IEnumerable<WixToolset.Dtf.WindowsInstaller.PatchInstallation> GetPatches(
string patchCode,
string targetProductCode,
string userSid,
UserContexts context,
PatchStates states
)
ParameterTypeDescription
patchCodestringPatchCode (GUID) of the patch to be enumerated. Only instances of patches within the scope of the context specified by the and parameters will be enumerated. This parameter may be set to null to enumerate all patches in the specified context.
targetProductCodestringProductCode (GUID) product whose patches are to be enumerated. If non-null, patch enumeration is restricted to instances of this product within the specified context. If null, the patches for all products under the specified context are enumerated.
userSidstringSpecifies a security identifier (SID) that restricts the context of enumeration. A SID value other than s-1-1-0 is considered a user SID and restricts enumeration to the current user or any user in the system. The special SID string s-1-1-0 (Everyone) specifies enumeration across all users in the system. This parameter can be set to null to restrict the enumeration scope to the current user. When must be null.
contextUserContextsSpecifies the user context.
statesPatchStatesThe of patches to return.

Win32 MSI APIs: MsiEnumPatchesEx

Enumerates all patch installations on the system.

public static IEnumerable<WixToolset.Dtf.WindowsInstaller.PatchInstallation> AllPatches { get; set; }

Win32 MSI API: MsiEnumPatches

Get the registered display name for the patch.

public string DisplayName { get; set; }

Gets the date and time when the patch is applied to the product.

public System.DateTime InstallDate { get; set; }

Gets a value indicating whether this patch is currently installed.

public bool IsInstalled { get; set; }

Gets a value indicating whether this patch is marked as obsolte.

public bool IsObsoleted { get; set; }

Gets a value indicating whether this patch is present but has been superseded by a more recent installed patch.

public bool IsSuperseded { get; set; }

Gets information about a specific patch installation.

public string Item[
string propertyName
] { get; set; }
ParameterTypeDescription
propertyNamestringThe property being retrieved; see remarks for valid properties.

Win32 MSI APIs: MsiGetPatchInfo , MsiGetPatchInfoEx

ExceptionDescription
T:System.ArgumentOutOfRangeExceptionAn unknown patch or property was requested
T:WixToolset.Dtf.WindowsInstaller.InstallerExceptionThe installer configuration data is corrupt

Gets the cached patch file that the product uses.

public string LocalPackage { get; set; }

Gets the registered support information URL for the patch.

public System.Uri MoreInfoUrl { get; set; }

Gets the patch code (GUID) of the patch.

public string PatchCode { get; set; }

Gets the ProductCode (GUID) of the product.

public string ProductCode { get; set; }

Gets the installation state of this instance of the patch.

public PatchStates State { get; set; }
ExceptionDescription
T:System.ArgumentExceptionAn unknown patch was requested
T:WixToolset.Dtf.WindowsInstaller.InstallerExceptionThe installer configuration data is corrupt

Gets the set of patch transforms that the last patch installation applied to the product.

public string Transforms { get; set; }

This value may not be available for per-user, non-managed applications if the user is not logged on.

True patch is marked as possible to uninstall from the product.

public bool Uninstallable { get; set; }

Even if this property is true, the installer can still block the uninstallation if this patch is required by another patch that cannot be uninstalled.