All predefined Tarma Installer 5 projects contain the symbolic variables INSTALLDIR, INSTALL64DIR, and PRIMARYFOLDER. This article explains what they are used for.
In all predefined Tarma Installer 5 projects and in projects imported from Tarma ExpertInstall 3.x, the INSTALLDIR and INSTALL64DIR folder aliases are associated with the default installation folders for 32-bit and 64-bit applications, respectively. The following table shows how.
| INSTALLDIR | INSTALL64DIR | |
|---|---|---|
| Associated project folder | Target System\Program Files (32-bit)\<ProductName> | Target System\Program Files (64-bit)\<ProductName> |
| Path on 32-bit system | C:\Program Files\YourProductName | C:\Program Files (64-bit)\YourProductName (see note 3) |
| Path on 64-bit system | C:\Program Files (x86)\YourProductName | C:\Program Files\YourProductName |
INSTALLDIR and INSTALL64DIR are folder aliases and can therefore be used as symbolic variables:
<INSTALLDIR> - By default, resolves to C:\Program Files\YourProductName or similar <INSTALL64DIR> - By default, resolves to C:\Program Files (64-bit)\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
Tip: Most actions and dialog controls that are linked to a symbolic variable contain an Indirect check box. If you use the PRIMARYFOLDER variable in those actions or controls, then you should use the Indirect option instead of enclosing the variable name in < and >. The following screen shot shows an example.
As with all other aspects of a Tarma Installer 5 project, you are free to change what INSTALLDIR, INSTALL64DIR, or PRIMARYFOLDER refer to. For example, you can:
However, you should only make changes if you understand how the installer uses these elements (see next section).
INSTALLDIR, INSTALL64DIR and PRIMARYFOLDER appear in various places throughout a typical Tarma Installer 5 project, as shown below.
Note: As of Tarma Installer 5.0.3000, the use of INSTALLDIR, INSTALL64DIR, and PRIMARYFOLDER in the predefined installer projects has been changed somewhat to deal better with 32-bit versus 64-bit installations. The changes only apply to new projects; existing projects stay as they are. The following table shows both the old and the new usage.
| Usage | 3.x to 5.0.2999 | 5.0.3000 and later |
|---|---|---|
| Files and Folders page | ||
| Folders tree | INSTALLDIR corresponds to Target System\Program Files (32-bit)\<ProductName>; INSTALL64DIR corresponds to Target System\Program Files (64-bit)\<ProductName>. | Same |
| Set as Primary Folder (folder popup menu) |
Sets the value of PRIMARYFOLDER to the alias of the currently selected folder. | Same |
| Features and Components page | ||
| Product feature | The top-level <ProductName> feature uses <PRIMARYFOLDER> as its folder alias. (Note that this contains the required indirection.) | The top-level <ProductName> (32-bit) feature uses INSTALLDIR as its folder alias. (No indirection required or used.) |
| Product64 feature | (not available) | The top-level <ProductName> (64-bit) feature uses INSTALL64DIR as its folder alias. (No indirection required or used.) |
| Action Sequences page | ||
| DoFirstInstall, SetInstallDir action |
Sets the value of the INSTALLDIR folder alias. | Uses indirection to set the value of the folder alias retrieved from <PRIMARYFOLDER>. |
| Symbolic Variables page | ||
| PRIMARYFOLDER variable | Defaults to INSTALLDIR | Defaults to INSTALLDIR for 32-bit only or combined projects; defaults to INSTALL64DIR for 64-bit only projects. |
| Other uses | ||
| Uninstall information | Stores the path given by <INSTALLDIR> as the InstallLocation. | Stores the path given by <<PRIMARYFOLDER>> as the InstallLocation. |
| Insert Installation folder (various popup menus) |
This command inserts the string <INSTALLDIR> in the current field. | This command inserts the string <<PRIMARYFOLDER>> in the current field. |