SetPackageProperty

The SetPackageProperty function sets a property value for the specified package.

BOOL SetPackageProperty(
HPACKAGE hPackage, // handle to package file
UINT uPropertyId, // property number
LPCTSTR lpValue // property string value
);

Parameters

hPackage
[in] Handle to an open package file.
 
uPropertyId
[in] A numeric identifier which specifies the property value that is being changed.
 
One of the following values may be used:
Value Description
PACKAGE_PROPERTY_COMPANY_NAME The name of the company that has produced the package.
PACKAGE_PROPERTY_COMPANY_EMAIL The e-mail address of the company that has produced the package. It is recommended that this address use the standard Internet address format, although no restrictions are placed on the actual format of the address string.
PACKAGE_PROPERTY_COMPANY_URL The URL for the company that has produced the package.
PACKAGE_PROPERTY_PRODUCT_NAME The name of the product that this package was created for.
PACKAGE_PROPERTY_PRODUCT_VERSION The version of the product that this package was created for. The string is not restricted to numeric values and does not have to correspond to the value returned by the GetPackageVersion function.
PACKAGE_PROPERTY_PRODUCT_BUILD The build identifier for the version of the product that this package was created for. The build string is not restricted to numeric values and does not have to correspond to the value return by the GetPackageVersion function.
PACKAGE_PROPERTY_PRODUCT_URL The URL for the product that this package was created for.
PACKAGE_PROPERTY_PRODUCT_KEY The registry key under HKEY_LOCAL_MACHINE that is used to store product installation and configuration data.
PACKAGE_PROPERTY_PRODUCT_DESCRIPTION A brief description of the product.
PACKAGE_PROPERTY_PRODUCT_COPYRIGHT The copyright for this product.
PACKAGE_PROPERTY_PRODUCT_TRADEMARK The trademark for this product.
PACKAGE_PROPERTY_PRODUCT_LICENSE Licensing information for this product.
PACKAGE_PROPERTY_PRODUCT_COMMENTS Any additional information about the package.
lpValue
[in] A pointer to a null-terminated string that will contain the updated package property value. If this parameter is NULL, the property value is removed from the package.

Return Values

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

Properties are stored as compressed string resources in the package file. The maximum length of a property value is approximately 2 billion characters.

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.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP.

See Also

GetPackageProperty, GetPackageVersion