Options Property

Returns the patch options for the current package, or sets the options for new packages that are created, or overrides options for packages as they are applied.

Syntax

object.Options [= value]

The Options property syntax has the following parts:

Part Description
object An object expression that evaluates to a Package object.
value A numeric value which specifies one or more options which are used during the patch creation and apply process.

Settings

The settings for the Options property are:

Constant Description
apFindFile If the reference file cannot be found on the target system, attempt to locate it using the standard Windows pathing rules. The current directory, system directory and the directories in the PATH environment variable are searched in that order.
apBackupFile Create a backup of the file on the target system before applying the patch. If this flag is not specified, the file is modified in-place without any backup file being created.
apRegisterComponents This option specifies that any self-registering COM libraries and/or ActiveX controls that are included with the package will be automatically registered after the package has been applied. Note that this option is only used with the Apply method. It is ignored by the Create and Update methods.
apOverwrite When the patch package is applied to the target system, overwrite all files even if the file is not expected to exist.
apNoUpdate Do not modify any files on the local system. This option can be used to test a package to ensure that it can be successfully applied on the local system.
apMultipleVersions Multiple versions of the same file may be included in the package. If this option is not specified, a file with the same name will overwrite a previous file in the package.
apCompareFileTime Compare the time that the target file was last modified against that of the reference file. If the target file has a later modification time than the reference file at the time the patch was created, the patch application will fail with the error AP_ERROR_NEWER_FILETIME. In effect this ensures that the updated file must always have a later modification time than the reference file.
apCompareVersion Compare the version of the target file against that of the reference file. If the target file has a later version than the reference file at the time the patch was created, the patch application will fail with the error AP_ERROR_NEWER_VERSION. In effect this ensures that the updated file must always be a later version than the reference file.
apIgnoreFileTime Ignore any differences between the file modification times of the file on the target system and those of the reference file at the time that the patch was created.
apIgnoreVersion Ignore any differences between the version of the file on the target system and the version of the reference file at the time that the patch was created.
apIgnoreAttributes Ignore the updated file attributes when the patch is applied on the target system and use default attributes instead.
apIgnoreReadOnly Ignore the read-only file attribute when applying the patch. If the updated file has this attribute set, it will be cleared.
apIgnoreSignature Ignore any digital signature that may be present. If the updated file has been digitally signed using AuthentiCode, the signature will be authenticated at the time that the patch is applied. If this option is specified, no attempt is made to authenticate the signature. This flag has no effect on files that are not digitally signed.
apIgnoreModified Ignore any files in the package which have been modified on the local system. This option should be used with caution because it specifically prevents the function from returning an error if a modified file is found.
apIgnoreMissing When the patch package is applied to the target system, ignore any missing files.
apIgnoreExisting When the patch package is applied to the target system, ignore any existing files that are not expected to exist. This option is effectively the opposite of the apOverwrite option, and ensures that the existing file is not modified.

Remarks

Because self-registering COM libraries and ActiveX controls can potentially be used to execute arbitrary code on the target system, the Apply method will not register any components included in the package. The option apRegisterComponents must be specified if you wish to automatically register the components after the package has been applied.

A file is "not expected to exist" if the application instructions within the package indicate that the file is to be created on the target system.

If neither apCompareFileTime nor apIgnoreFileTime is specified, then apCompareFileTime is the default. If both apCompareFileTime and apIgnoreFileTime are specified, then apIgnoreFileTime takes precedence.

If neither apCompareVersion nor apIgnoreVersion is specified, then apCompareVersion is the default. If both apCompareVersion and apIgnoreVersion are specified, then apIgnoreVersion takes precedence.

See Also

Create Method, Update Method