| ActivePatch Developer's Guide - Package Information and Resources | ||
|
When a patch package is created for a given collection of files, there may be a need to provide the updating application with additional information about the update. This information may be used simply to provide the end-user with details about the update or it may be used for some application specific purpose. ActivePatch supports two types of application-specific metadata. This metadata is stored in the package itself in a compressed form, not as an external file. The first type of metadata is referenced using the Information property and is used to store data such as the name of the company which produced the package, a contact e-mail address, product URL, version and build strings, as well as other types of related information. These values are also used by ActivePatch when it needs to determine the default installation directory for a given package. Combinations of the company name, product name, product version, and registry key names are used when searching for the directory that a given product has been installed under. |
||
| Information Property Array | ||
|
The Information property array is used to set and return application specific data about the package file. The index into the array is used to identify what information is being stored in the package. The following constants are defined:
For example, to set the company and product information for a given package, code like this could be used: Package1.Information(apCompanyName) = "WidgetWorx, Inc." Package1.Information(apProductName) = "DynaWidgets" Package1.Information(apProductVersion) = "3.23 Rev A12" Package1.Information(apProductBuild) = "1821 (Service Pack 2)" Note that the product version and build information may contain any characters, not just numbers. Typically these values are used for display purposes. To remove information from the package, simply set the property value to an empty string. In addition to the data returned by the Information property array, there is also a more generic type of metadata called a resource. Package resources are completely user defined and may contain any type of data including binary data. Resources are associated with a numeric value that is assigned by an application and has meaning only to the application that has stored it in the package. For example, a developer may wish to store a bitmap image in the package which is displayed when the package is applied. The bitmap is loaded into memory, a numeric ID of the developer's choice is associated with the image, and then the image is stored in the package using that ID. To extract the bitmap from the package, the developer simply uses that same ID and provides a variable which will contain the image data. Valid resource IDs are in the range of 0000h through EFFFh. The Resource property array is used to manage package resources. |
||
| Resource Property Array | ||
|
The Resource property array returns data for a resource with the specified ID. If no resource exists with the specified ID, an error is returned. To store a resource in the package, simply set the Resource property array to the desired value, with the index value as the desired resource ID. If the resource ID references a resource that already exists, that resource is replaced. For example, the following code stores the current date in the package as resource and associates the string with the numeric value 1234: Package1.Resource(1234) = Date This information can then be referenced by an application written to apply the package. For example: If CDate(Package1.Resource(1234)) = Date Then
' This package was created today
End If
The resource ID and data is completely application specific and is not used by ActivePatch during the process of applying the package. It is important to remember that although the resource metadata is compressed in the package, it will increase the overall size of the resulting package file. |
||