GetPackageOptions

The GetPackageOptions function returns the options that have been selected for the specified package file.

BOOL GetPackageOptions(
HPACKAGE hPackage, // handle to package file
LPDWORD lpdwOptionFlags // package options
);

Parameters

hPackage
[in] Handle to an open package file.
 
lpdwOptionFlags
[out] A pointer to a DWORD value that contains the current package option flags when the function returns.
 
One or more of the following options may be set:
Value Description
PACKAGE_OPTION_MULTIPLE_VERSIONS 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.
PACKAGE_OPTION_FIND_FILE When the patch package is applied to the target system, search for files using the standard Windows pathing rules.
PACKAGE_OPTION_OVERWRITE When the patch package is applied to the target system, overwrite all files even if the file is not expected to exist. This option must be specified if one or more of the target files will have the read-only attribute set, otherwise the application process will fail with an error.
PACKAGE_OPTION_IGNORE_MISSING When the patch package is applied to the target system, ignore any missing files.
PACKAGE_OPTION_IGNORE_EXISTING 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 PACKAGE_OPTION_OVERWRITE, and ensures that the existing file is not modified.
PACKAGE_OPTION_BACKUP_FILE 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.
PACKAGE_OPTION_COMPARE_FILETIME 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.
PACKAGE_OPTION_COMPARE_VERSION 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.
PACKAGE_OPTION_IGNORE_FILETIME 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.
PACKAGE_OPTION_IGNORE_VERSION 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.
PACKAGE_OPTION_IGNORE_ATTRIBUTES Ignore the updated file attributes when the patch is applied on the target system and use default attributes instead.
PACKAGE_OPTION_IGNORE_READONLY Ignore the read-only file attribute when applying the patch. If the updated file has this attribute set, it will be cleared.
PACKAGE_OPTION_IGNORE_SIGNATURE 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 flag is specified, no attempt is made to authenticate the signature. This flag has no effect on files that are not digitally signed.

Return Values

If the GetPackageOptions function succeeds, it will return a non-zero value.

If the function fails, it will return a value of zero. To get extended error information, call GetLastError.

Remarks

To change the package options that were specified when the package was created, use the SetPackageOptions function.

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.

Requirements

Windows NT/2000/XP: Requires Windows NT 4.0 SP3 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Include apatch.h.
Library: Use apatch32.lib.

See Also

SetPackageOptions