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

Microsoft Deployment Tools

Deployment Tools Foundation GetPatches Method (patchCode, targetProductCode, userSid, context, states)
Deployment Tools Foundation NamespacesMicrosoft.Deployment.WindowsInstallerPatchInstallationGetPatches(String, String, String, UserContexts, PatchStates)
Enumerates patch installations based on certain criteria.
Declaration Syntax
C# Visual Basic Visual C++
public static IEnumerable<PatchInstallation> GetPatches(
	string patchCode,
	string targetProductCode,
	string userSid,
	UserContexts context,
	PatchStates states
)
Public Shared Function GetPatches ( _
	patchCode As String, _
	targetProductCode As String, _
	userSid As String, _
	context As UserContexts, _
	states As PatchStates _
) As IEnumerable(Of PatchInstallation)
public:
static IEnumerable<PatchInstallation^>^ GetPatches(
	String^ patchCode, 
	String^ targetProductCode, 
	String^ userSid, 
	UserContexts context, 
	PatchStates states
)
Parameters
patchCode (String)
PatchCode (GUID) of the patch to be enumerated. Only instances of patches within the scope of the context specified by the userSid and context parameters will be enumerated. This parameter may be set to null to enumerate all patches in the specified context.
targetProductCode (String)
ProductCode (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.
userSid (String)
Specifies 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 installContext is set to the machine context only, userSid must be null.
context (UserContexts)
Specifies the user context.
states (PatchStates)
The PatchStates of patches to return.
Remarks

Win32 MSI APIs: MsiEnumPatchesEx

Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller) Version: 3.0.0.0 (3.5.1623.0)