About INSTALLDIR and PRIMARYFOLDER

All predefined Tarma Installer 5 projects contain the symbolic variables INSTALLDIR, INSTALL64DIR, and PRIMARYFOLDER. This article explains what they are used for.

Definitions

INSTALLDIR
The folder alias of the predefined 32-bit product installation folder. Present in 32-bit and combined 32-bit and 64-bit installer projects.
INSTALL64DIR
The folder alias of the predefined 64-bit product installation folder. Present in 64-bit and combined 32-bit and 64-bit installer projects.
PRIMARYFOLDER
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 with a heavy black overlay in the folders tree on the Files and Folders page: Primary folder

The predefined INSTALLDIR and INSTALL64DIR folder aliases

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

Notes

  1. The table describes the default situation. If you associate either folder alias with a different folder, the information in the table may no longer represent the situation in your installer.
  2. The folder names are for a typical English version of Windows. Non-English versions and non-standard Windows installations may use different names.
  3. The installation path of the <INSTALL64DIR> folder on 32-bit systems is a Tarma extension. 32-bit Windows systems do not have a predefined 64-bit programs folder, but if you install files or folders in the Target System\Program Files (64-bit) branch on the Files and Folders page, then the installer will create the folder during installation.

How to use INSTALLDIR, INSTALL64DIR and PRIMARYFOLDER

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.

Indirect symbol access

Changing INSTALLDIR, INSTALL64DIR, or PRIMARYFOLDER

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).

Where INSTALLDIR, INSTALL64DIR and PRIMARYFOLDER occur in a project

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.