ActivePatch Developer's Guide - Applying Package Files

To apply a package on a target system, the Apply function is used as follows:

' Apply a package file, updating the files in the specified
' installation directory
        
Package1.FileName = "update.pkg"
Package1.Password = "secret"

On Error Resume Goto ApplyFailed
Package1.Apply "<ProgramFiles>\MyProduct", "update.rev"
Exit Sub

ApplyFailed:
MsgBox Err.Description
Exit Sub

The FileName property specifies the name of the package file to create.

The Password property specifies the password that was used to secure the package file when it was created.

The Apply method is then used to apply the contents of the package on the local system. The first parameter specifies the name of the installation directory where the files are installed. In the above example, the directory is specified as a subdirectory under "C:\Program Files". However, because this directory can be named differently on other systems, it is preferable to use the <ProgramFiles> macro which is replaced with the name of the directory where programs are installed by default. There are a number of similar macros which can be used, and are listed in Appendix A of the technical reference. The second optional parameter is the name of an "undo" file, which can be used to reverse the application of a patch package by calling the Undo method. If an undo file is not required, then this parameter may be omitted.