GetPackageVersion

The GetPackageVersion function returns version information for the specified package file.

BOOL GetPackageVersion(
HPACKAGE hPackage, // handle to package file
LPDWORD lpdwVersionMS, // most signficant version number
LPDWORD lpdwVersionLS // least significant version number
);

Parameters

hPackage
[in] Handle to an open package file.
 
lpdwVersionMS
[out] A pointer to a value which will contain the most significant portion of the package version number.
 
lpdwVersionLS
[out] A pointer to a value which will contain the least significant portion of the package version number.

Return Values

If the GetPackageVersion 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

The GetPackageVersion function is useful for determining if an update has already been installed on the local system. The current version of the application can be stored on the local system, typically in a registry key value, and then compared against the version information for the package.

To change the package version use the SetPackageVersion function.

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

GetPackageProperty, SetPackageVersion