About INSTALLDIR and PRIMARYFOLDER
All predefined InstallMate projects contain the symbolic variables INSTALLDIR and PRIMARYFOLDER. This article explains what they are used for.
- The folder alias of the predefined product installation folder.
- A symbolic variable that defines which folder (alias) is considered to be the "main" installation folder. The main installation folder is the one whose path is recorded in the product's Uninstall information on the target system and is used to calculate the approximate installation size. (This does not preclude the use of other folders for installation.) The current PRIMARYFOLDER folder is indicated in red in the folders tree on the Files and folders page: or
How to use INSTALLDIR and PRIMARYFOLDER
INSTALLDIR is a folder alias and can therefore be used as a symbolic variable:
<INSTALLDIR> - By default, resolves to C:\Program Files\YourProductName or similar
The PRIMARYFOLDER symbol is not a folder alias itself; it contains the name of a folder alias. (This is inherited from MSI; a clearer name for this variable would have been PrimaryFolderAlias or something like that.) This means that obtaining the actual main installation folder path requires a double indirection, like this:
<PRIMARYFOLDER> - By default, resolves to INSTALLDIR <<PRIMARYFOLDER>> - By default, resolves to C:\Program Files\YourProductName or similar
Using the Indirect symbol option
Most actions and dialog controls that are linked to a symbolic variable contain an Indirect symbol check box. If you use the PRIMARYFOLDER variable in those actions or controls, then you should use the Indirect symbol option instead of enclosing the variable name in < and > (see screen shot).
Changing INSTALLDIR or PRIMARYFOLDER
As with all other aspects of an InstallMate project, you are free to change what INSTALLDIR or PRIMARYFOLDER refer to. For example, you can:
- Mark a different folder as the Primary folder (using the Set as Primary Folder command from the folder's context menu). The Primary folder should be the folder that acts as the root of your product's installation subtree or that is otherwise most representative of your product's installation location.
- Move the folder (using drag & drop) with the INSTALLDIR alias around in the folders tree on the Files and folders page.
- Assign the INSTALLDIR alias to a different folder altogether (assuming that you do not assign these aliases to more than one folder at a time).
However, you should only make changes if you understand how the installer uses these elements (see next section).
Where INSTALLDIR and PRIMARYFOLDER occur in a project
INSTALLDIR and PRIMARYFOLDER appear in various places throughout a typical InstallMate 9 project, as shown below.
|Files and folders page
|INSTALLDIR corresponds to the Target System\Program Files (32-bit)\<ProductName> folder; you can move (drag & drop) this folder to a different location depending on your needs.
|Set as Primary Folder
(folder popup menu)
|Sets the value of PRIMARYFOLDER to the alias of the currently selected folder.
|The top-level <ProductName> component uses <PRIMARYFOLDER> as its Linked folder. (Note that this contains the required indirection.)
|Uses indirection to set the value of the folder alias retrieved from <PRIMARYFOLDER>.
|Defaults to INSTALLDIR
|Stores the path given by <<PRIMARYFOLDER>> as the InstallLocation.
|Insert Installation folder
(various popup menus)
|This command inserts the string <<PRIMARYFOLDER>> in the current field.