Folder attributes

Reference information
Project page Files and Folders
Related topics Working with attribute panes

Introduction

A Folder object represents a folder for installation or removal. You can add or remove folders, and you can optionally remove all their subfolders and files as well.

Installation or removal of a folder is controlled by its component. If the component is installed, the folder's Install action is executed (which may actually remove the folder); if the component is removed, the Remove action is executed. If a folder is not linked to a component, its Install action is executed during installation of your product, and its Remove action when the product is removed.

In addition to the explicit installation and removal actions, folders are automatically created if a subfolder, file, or shortcut is installed under the folder, and removed if they become empty (unless Remove action is set to Do not remove).

The following table summarizes the relation between the folder actions, its component's actions, and the overall run mode.

Component? Situation Folder action Comments
No (Tarma Installer) Run mode=Installer
Run mode=Repair
Install action The install action may either create or remove the folder; see Install action below.
Run mode=Uninstaller Remove action The remove action may remove or keep the folder; see Remove action below.
Run mode=other Implicit The folder is only created if a file, shortcut, or subfolder is installed in it.
No (Windows Installer) n/a Implicit
Yes No component action Implicit
Component is installed or updated Install action The install action may either create or remove the folder; see Install action below.
Component is removed Remove action The remove action may remove or keep the folder; see Remove action below.

MSI note Windows Installer requires that all folders with actions other than Create on demand and Remove if empty are linked to components; Tarma ExpertInstall will issue a BLD:E0072 diagnostic message if this is not the case.

Warning Folder removal warning

Removing a non-empty folder is potentially a dangerous operation, even more so if its subfolders are also removed. During the removal process, all files under the folder (and potentially under its subfolders) are removed regardless of their installation status. This may cause serious problems on the target system. If at all possible, you should selectively remove files and shortcuts by using file and shortcut installation and removal actions (see File and Shortcut).

Watch lists

A watch list designates a variable group of source files that must be installed in the folder. Each member of the watch list contains a file filter (i.e., a file path with wildcards in the file name) and all matching source files are automatically added to the folder. If new source files are added, they are included as well; if any source files are removed from the development system, they are removed from the folder as well.

Each folder can have multiple file filters associated with it; you can edit or remove them through the Watch Lists dialog box that appears when you click the Advanced... button (see below).

Watch lists are re-evaluated under the following circumstances:

The watch lists do not monitor the Windows file system, so any changes to the files on the watch lists are not detected until one of the previous events takes place.

Installation actions

The installer can create or remove the folder and its contents during product installation. The effect of the actions differs somewhat between Tarma Installer and Windows Installer, because Windows Installer does not support the full complement of installation actions.

Install action Tarma Installer Windows Installer
Create on demand The folder is created, if it does not already exist, when its first file, shortcut, or subfolder is installed. Same
Create always The folder is created if it does not already exist, regardless of any files or subfolders under it. This allows you to create empty folders. Same
Remove if empty If the folder exists but has no files or subfolders, it is removed. If it contains one or more files or subfolders, it is left as-is. Same
Remove folder and files If the folder exists, its files (but not subfolders) are removed. If it contains no subfolders, the folder itself is then removed. If it does contain one or more subfolders, the folder is retained (but its files are gone). Same
Remove folder and subfolders If the folder exists, its files and all of its subfolders are removed recursively, then the folder itself is removed. Not supported. Behaves as Remove folder and files.

Removal actions

The installer can remove or retain the folder during product removal. The effect of the actions differs somewhat between Tarma Installer and Windows Installer, because Windows Installer does not support the full complement of removal actions.

Remove action Tarma Installer Windows Installer
Do not remove The folder is left as-is. This only applies to folders that were created through Create always or on demand for a file or shortcut installed in it. Folders created on demand because a subfolder was created are always removed. Not supported. Behaves as Remove if empty.
Remove if empty See Remove if empty in previous table. Same
Remove folder and files See Remove folder and files in previous table. Same
Remove folder and subfolders See Remove folder and subfolders in previous table. Not supported. Behaves as Remove folder and files.

Attributes

This pane contains the following attributes and options.

Attribute Description
Folder name Enter the name of the folder. You may use symbolic references in the name; they will be resolved when the folder is installed.
Alias

Enter the alias for the folder. This alias must be unique in the project; it is used as a key in the Windows Installer database. Both Tarma Installer and Windows Installer use the alias as if it were a symbolic variable; for example, you can use expressions like <folder_alias> to retrieve the folder's installation path.

Note: Windows Installer can also use [folder_alias], but the Tarma <folder_alias> syntax is preferred while working in Tarma ExpertInstall because it allows better preflight checking. The Tarma <folder_alias> syntax will automatically be converted to [folder_alias] when you build a Windows Installer configuration.

Install action Select the desired installation action from the drop-down list. The installation action is executed when the folder's component is installed. If the folder is not linked to a component, the action is executed when the product as a whole is installed. See Installation actions above for a full list of actions.
Remove actions Select the desired removal action from the drop-down list. The removal action is executed when the folder's component is removed. If the folder is not linked to a component, the action is executed when the product as a whole is removed. See Removal actions above for a full list of actions.
Advanced...

Click this button to open the Watch Lists and Folder Traits dialog box. These dialog boxes allows you to set some advanced folder options.