| ActivePatch Developer's Guide - PackageFile Object | ||
|
The PatchFile object references an individual file in the package and is a member of a PackageFiles collection. Whenever an application needs to obtain information about a specific file or needs to modify the contents of the package (such as adding, renaming or deleting a file), it must reference the PackageFile object. |
||
| Extract Method | ||
|
The Extract method in the PackageFile object is used to extract the file contents from the package and store it in a file on the local system. This method requires a single argument which is the name of the file to create or overwrite. An important distinction between extracting an individual file and applying the contents of the package is that when a file is extracted, ActivePatch makes no attempt to ensure that the correct version of a given file is being created or overwritten. If the contents of the package file is actually a patch, not a complete file, then a patch file is created and can be used with the PatchFile control. |
||
| Delete Method | ||
|
The Delete method in the PackageFile object is used to remove a specified file from the package. Note that this does not cause the file to be removed from the target system (the Store method in the PackageFiles collection object provides this functionality) but rather, the file is removed from the package itself and as a result, is not updated on the target system. In addition to these methods, the PackageFile object also provides a number of properties which return information about the specific file. Examples are the Checksum, Created, and Flags properties. These properties are read-only and cannot be modified by the application. However, there are some properties which can be modified which in turn modifies the contents of the package. |
||
| Directory Property | ||
|
The Directory property returns the installation directory for the specified file. Changing the value of this property will change the installation directory used for this file when applying the package. As with creating or updating a package, this property can be set to an empty string to use the default installation directory, reference an absolute path, or make use of folder macros. For a complete list of available folder macros, see Appendix A. To resolve any folder macros which may be specified by the Directory property, use the LocalDirectory property. For example, if the installation directory for a given file is "[WINSYSDIR]", then this is the value that will be returned by the Directory property. To determine what the actual directory is on the local system, the LocalDirectory property can be read, which in this case may return "C:\WINDOWS\SYSTEM". Note that while the Directory property can be modified, the LocalDirectory property is read-only. |
||
| FileName Property | ||
|
The FileName property returns the name of the file stored in the package. Changing the value of this property has the effect of renaming the file. The name may include relative path information such as "Programs\Widgets.exe". |
||