Deployment Tools Foundation
DetermineApplicablePatches Method (product, patches, errorHandler, userSid, context)
Deployment Tools Foundation Namespaces ► Microsoft.Deployment.WindowsInstaller ► Installer ► DetermineApplicablePatches(String, array<String>[]()[][], InapplicablePatchHandler, String, UserContexts)
Determines which patches apply to a specified product and in what sequence. If
the product is installed, this method accounts for patches that have already been applied to
the product and accounts for obsolete and superceded patches.
Declaration Syntax
C# | Visual Basic | Visual C++ | F# |
public static IList<string> DetermineApplicablePatches( string product, string[] patches, InapplicablePatchHandler errorHandler, string userSid, UserContexts context )
Public Shared Function DetermineApplicablePatches ( product As String, patches As String(), errorHandler As InapplicablePatchHandler, userSid As String, context As UserContexts ) As IList(Of String)
public: static IList<String^>^ DetermineApplicablePatches( String^ product, array<String^>^ patches, InapplicablePatchHandler^ errorHandler, String^ userSid, UserContexts context )
static member DetermineApplicablePatches : product : string * patches : string[] * errorHandler : InapplicablePatchHandler * userSid : string * context : UserContexts -> IList<string>
Parameters
- product (String)
- The product that is the target for the set of patches. This may be either a ProductCode (GUID) of a product that is currently installed, or the path to a an MSI file.
- patches (array<String>[]()[][])
- An array of strings specifying the patches to be checked. Each item may be the path to an MSP file, the path an XML file, or just an XML blob.
- errorHandler (InapplicablePatchHandler)
- Callback to be invoked for each inapplicable patch, reporting the reason the patch is not applicable. This value may be left null if that information is not desired.
- userSid (String)
- Specifies a security identifier (SID) of a user. This parameter restricts the context of enumeration for this user account. This parameter cannot be the special SID strings s-1-1-0 (everyone) or s-1-5-18 (local system). If context is set to None or Machine, then userSid must be null. For the current user context, userSid can be null and context can be set to UserManaged or UserUnmanaged.
- context (UserContexts)
- Restricts the enumeration to per-user-unmanaged, per-user-managed, or per-machine context, or (if referring to an MSI) to no system context at all. This parameter can be Machine, UserManaged, UserUnmanaged, or None.
Return Value
Remarks
If an item in patches is a file path but does not end in .MSP or .XML, it is assumed to be an MSP file.
Passing an InstallContext of None only analyzes the MSI file; it does not consider the current state of the system. You cannot use InstallContext.None with a ProductCode GUID.
Win32 MSI APIs: MsiDetermineApplicablePatchesMsiDeterminePatchSequence
Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller.dll) Version: 3.0.0.0 (3.11.1.2318)