MSI.ApplyPatch

boolean MSI.ApplyPatch ( 

string PatchPath,

string InstallPackage,

number InstallType,

string CommandLine = "" )

Description

Calls the MsiApplyPatch function to invoke an installation and set the PATCH property to the path of the patch package for each product listed by the patch package as eligible to receive it.

Note: You must set the REINSTALL property on the command line when applying a small update or minor upgrade patch. Without this property, the patch is registered on the system but cannot update files. For patches that do not use a Custom Action Type 51 to automatically set the REINSTALL and REINSTALLMODE properties, the REINSTALL property must be explicitly set with the CommandLine parameter. Set the REINSTALL property to list the features affected by the patch, or use a practical default setting of "REINSTALL=ALL". The default value of the REINSTALLMODE property is "omus". Beginning with Windows Installer version 3.0, the REINSTALL property is configured by the installer and does not need to be set on the command line.

Parameters

PatchPath

(string) The full path to the patch package.

InstallPackage

(string) If InstallType is set to INSTALLTYPE_NETWORK_IMAGE, this parameter should be the full path to the product that is to be patched. To make the installer apply the patch to every eligible product listed in the patch package, set this parameter to an empty string ("") and InstallType to INSTALLTYPE_DEFAULT.

If InstallType is set to INSTALLTYPE_SINGLE_INSTANCE, the installer applies the patch to the product specified by this parameter. In this case, other eligible products listed in the patch package are ignored and the this parameter should contain the a string representing the product code of the instance to patch. This type of installation requires the installer running Windows Server 2003 or Windows XP.

InstallType

(number) The type of installation to patch. Choose from:

CONSTANT

VALUE

DESCRIPTION

INSTALLTYPE_DEFAULT

0

Searches the system for products to patch. In this case, InstallPackage must be an empty string ("").

INSTALLTYPE_NETWORK_IMAGE

1

Specifies an administrative installation. In this case, InstallPackage must be set to a package path.

INSTALLTYPE_SINGLE_INSTANCE

2

Patch the product specified by InstallPackage. InstallPackage is the product code of the instance to patch. This type of installation requires the installer be running Windows Server 2003 family or Windows XP SP1. For more information see the MSDN topic, Installing Multiple Instances of Products and Patches.

CommandLine

(string) The command line property settings to use.

Returns

(boolean) Returns true if the action was successful, or false if it failed. You can use Application.GetLastError to determine whether this action failed, and why.

See also:  Related Actions