![Copy image Copy image](copycode.gif)
![CopyHover image CopyHover image](copycodeHighlight.gif)
Deployment Tools Foundation
ApplyPatch Method (patchPackage, installPackage, installType, commandLine)
Deployment Tools Foundation Namespaces ► Microsoft.Deployment.WindowsInstaller ► Installer ► ApplyPatch(String, String, InstallType, String)
For each product listed by the patch package as eligible to receive the patch, ApplyPatch invokes
an installation and sets the PATCH property to the path of the patch package.
![](collapse_all.gif)
C# | Visual Basic | Visual C++ |
public static void ApplyPatch( string patchPackage, string installPackage, InstallType installType, string commandLine )
Public Shared Sub ApplyPatch ( patchPackage As String, installPackage As String, installType As InstallType, commandLine As String )
public: static void ApplyPatch( String^ patchPackage, String^ installPackage, InstallType installType, String^ commandLine )
![](collapse_all.gif)
- patchPackage (String)
- path to the patch package
- installPackage (String)
- path to the product to be patched, if installType is set to NetworkImage
- installType (InstallType)
- type of installation to patch
- commandLine (String)
- optional command line property settings
![](collapse_all.gif)
The RebootRequired and RebootInitiated properties should be tested after calling this method.
Win32 MSI API: MsiApplyPatch
![](collapse_all.gif)
Exception | Condition |
---|---|
InstallerException | There was an error applying the patch |
Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller.dll) Version: 3.0.0.0 (3.9.1006.0)