Skip to main content

PatchInstallation Class

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

Methods

MethodDescription
GetPatches(patchCode, targetProductCode, userSid, context, states)Enumerates patch installations based on certain criteria.

Properties

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.1+2f00cbe680fb01ab485d56f16de9cd19b133f875

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

Enumerates patch installations based on certain criteria.

Declaration

public static IEnumerable<WixToolset.Dtf.WindowsInstaller.PatchInstallation> GetPatches(
string patchCode,
string targetProductCode,
string userSid,
UserContexts context,
PatchStates states
)

Parameters

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.

Remarks

Win32 MSI APIs: MsiEnumPatchesEx

AllPatches Property

Enumerates all patch installations on the system.

Declaration

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

Remarks

Win32 MSI API: MsiEnumPatches

DisplayName Property

Get the registered display name for the patch.

Declaration

public string DisplayName { get; set; } 

InstallDate Property

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

Declaration

public System.DateTime InstallDate { get; set; } 

IsInstalled Property

Gets a value indicating whether this patch is currently installed.

Declaration

public bool IsInstalled { get; set; } 

IsObsoleted Property

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

Declaration

public bool IsObsoleted { get; set; } 

IsSuperseded Property

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

Declaration

public bool IsSuperseded { get; set; } 

Item Property

Gets information about a specific patch installation.

Declaration

public string Item[
string propertyName
] { get; set; }

Parameters

ParameterTypeDescription
propertyNamestringThe property being retrieved; see remarks for valid properties.

Remarks

Win32 MSI APIs: MsiGetPatchInfo , MsiGetPatchInfoEx

Exceptions

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

LocalPackage Property

Gets the cached patch file that the product uses.

Declaration

public string LocalPackage { get; set; } 

MoreInfoUrl Property

Gets the registered support information URL for the patch.

Declaration

public System.Uri MoreInfoUrl { get; set; } 

PatchCode Property

Gets the patch code (GUID) of the patch.

Declaration

public string PatchCode { get; set; } 

ProductCode Property

Gets the ProductCode (GUID) of the product.

Declaration

public string ProductCode { get; set; } 

State Property

Gets the installation state of this instance of the patch.

Declaration

public PatchStates State { get; set; } 

Exceptions

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

Transforms Property

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

Declaration

public string Transforms { get; set; } 

Remarks

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

Uninstallable Property

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

Declaration

public bool Uninstallable { get; set; } 

Remarks

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.