Using the Directory Table

[This is preliminary documentation and subject to change.]

The Directory table indicates the layout of your application. The following is an example of a Directory table.

Directory Directory_Parent DefaultDir
TARGETDIR SOURCEDIR
EXEDIR TARGETDIR App
DLLDIR EXEDIR Bin
DesktopFolder TARGETDIR Desktop

Each row of the Directory table indicates a directory both at the source and the target. For example, assume the installation package resides at \\applications\source\. Because the Directory_Parent field of the first row is Null, this record indicates the root directories for both the source and the target. For the source, the value of this directory is given by the DefaultDir field. The SOURCEDIR property defaults to the location of the installation package. Thus, unless the SOURCEDIR property is overridden, the root source directory is \\applications\source\.

The Directory field of the first record indicates the location of the root target directory. In this case, the value of the TARGETDIR property indicates this directory. Typically, the value of the TARGETDIR property is set at the command line or through a user interface. In this case, assume the TARGETDIR property is set to C:\Program Files\Target\.

For the second record, the Directory_Parent field is not Null. Therefore, this record indicates a non-root directory for both the source and the target. For a non-root source directory, the source directory indicated by the record described in the Directory_Parent field is the parent directory. For the second record, the Directory_Parent field is TARGETDIR. As shown earlier, the source directory indicated by the TARGETDIR record resolved to \\applications\source\. Thus, the source directory indicated by the second record is \\applications\source\App\.

A similar process works for the target directory. The value of the parent directory for the target directory described in the second record is the target directory resolved by the Directory_Parent field. Again, the Directory_Parent field contains the value TARGETDIR. This indicates the first record that resolves to a target directory of C:\Program Files\Target\. The Directory field contains an author-defined property called EXEDIR. If this property is set, then its value gives the full path of the directory. Thus, if this property is set to C:\Data\Common\, the value of the target directory indicated by the second record is C:\Data\Common\. If it is not set, the target directory takes the name given by the DefaultDir field. In this case, the target directory is C:\Program Files\Target\App\.

The same process works for the third record. If EXEDIR and DLLDIR are not set, the target directory is C:\Program Files\Target\App\Bin, and the source directory is \\applications\source\App\Bin\.

The fourth record uses the DesktopFolder property. If the location of the user's desktop is C:\Winnt\Profiles\User\Desktop\, the target directory resolves to C:\Winnt\Profiles\User\Desktop\. The source directory resolves to \\applications\source\Desktop\.

There are two additional syntax features that can be used in the DefaultDir column of the Directory table. For a non-root source directory, a period (.) entered in the DefaultDir column indicates that the directory should be located in its parent directory without a subdirectory. To specify different source and target directory paths, separate the target and source paths in the DefaultDir column with a colon as follows: [targetpath]:[sourcepath]. These features can be used together to add levels to either the source or target paths for a single directory. For example, consider this example of a Directory table.:

Directory Directory_Parent DefaultDir
TARGETDIR SOURCEDIR
MyAppDir TARGETDIR MyApp
BinDir MyAppDir Bin
Binx86Dir BinDir .:x86
BinAlphaDir BinDir .:Alpha

The source and target paths resolve for the MyAppDir, BinDir, Binx86Dir, and BinAlphaDir rows as follows.

Record Target Paths Source Paths
MyAppDir: [TARGETDIR]MyApp [SOURCEDIR]MyApp
BinDir: [TARGETDIR]MyApp\Bin [SOURCEDIR]MyApp\Bin
Binx86Dir: [TARGETDIR]MyApp\Bin [SOURCEDIR]MyApp\Bin\x86
BinAlphaDir: [TARGETDIR]MyApp\Bin [SOURCEDIR]MyApp\Bin\Alpha