How the Base Directory is Converted to %AppDir%

When files are added to a Setup Factory project, Setup Factory tries to set a "best guess" value for the destination folder of each file. It does this by comparing the file's path to the base directory for the tab the files were added to.

The base directory is the path on your system that corresponds to the path where your application will be installed. In other words, it's the local representative of %AppDir%. (%AppDir% is the built-in variable that gets set to the installation path when the user selects an install folder at run time.)

Setup Factory automatically picks a base directory for you the first time you add any files to your project. If you add a single file, Setup Factory chooses the folder that the file is located in as the base directory. If you add multiple files at the same time, Setup Factory chooses the first folder that all of the files have in common as the base directory.

Once a base directory is set, whenever a file is added to a Setup Factory project, any part of the source path that matches the base directory is replaced with "%AppDir%".

For instance, if the current project's base directory for the Archive tab was C:\Projects\Widget Designer and you added the following files to the Archive tab:

C:\Projects\Widget Designer\Widget Designer.exe

C:\Projects\Widget Designer\Data\Parts.dat

C:\Projects\Widget Designer\Docs\Widget Designer.html

...the destination paths for the files would be set to:

%AppDir%\Widget Designer.exe

%AppDir%\Data\Parts.dat

%AppDir%\Docs\Widget Designer.html

If you add a file that isn't located somewhere beneath the base directory-so the path to the base directory isn't found in the path to the source file-Setup Factory sets the file's destination path to just "%AppDir%".

NOTE

 

The base directory is reset (i.e. cleared) whenever you remove all the files from a tab. In other words, the base directory for the Archive tab is reset when you remove all the files from the Archive tab, and the base directory for the CD-ROM tab is reset when you remove all the files from the CD-ROM tab. This means that if you remove all the files from one of the tabs, and then proceed to add files to it again, Setup Factory will pick a new base directory based on the files you just added.

TIP

 

You can also set the base directory manually. This can be helpful if you have two different directory structures that you want to install to the same place on the user's system.

For example, you might have two different versions of your software installed in two different directory structures on your system (a full version and a demo version, perhaps). If you wanted to install them both to the same place on the user's system, you could add the files from the first directory structure, change the path of the base directory to point to the second directory structure, and then add the files from the second directory structure to your project. (Once the files were added, you could assign them to packages to control which version is installed at run time.)

To set the base directory manually, select Project | Settings from the menu, and edit the appropriate path on the Directories tab of the Project Settings dialog.

 

See Also: Base Directories