Folder

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 Run mode=Installer
Run mode=Repair
Install action The install action may either create or remove the folder; see Installation actions below.
Run mode=Uninstaller Remove action The remove action may remove or keep the folder; see Removal actions below.
Run mode=other Implicit The folder is only created if a file, shortcut, or subfolder is installed in it.
Yes No component action Implicit
Component is installed or updated Install action The install action may either create or remove the folder; see Installation actions below.
Component is removed Remove action The remove action may remove or keep the folder; see Removal actions below.

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

Attributes

The following attributes and options are available.

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.
Folder alias Enter the alias for the folder. This alias must be unique in the project. InstallMate uses 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.
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 below 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 below for a full list of actions.
Keep during updates

Check this box to keep the folder during updates, i.e., when the uninstaller is run in upgrade mode (TsuUpgrade is nonzero). If this box is checked, the Remove action is ignored during upgrades (only) and the folder will remain on the target system.

This option is useful if the folder contains data that must be retained during upgrades of the product, but should be removed during full product uninstallations.

Advanced...

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

Installation actions

The installer can create or remove the folder and its contents during product installation.

Install action Description
Create on demand The folder is created, if it does not already exist, when its first file, shortcut, or subfolder is installed.
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.
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.
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).
Remove folder and subfolders If the folder exists, its files and all of its subfolders are removed recursively, then the folder itself is removed.

*Note: Before removing a folder, the installer will first automatically remove certain hidden files that are created automatically by Windows and some other systems. These files are typically local caches that should be removed if the folder is removed. Currently, the installer will remove the following files automatically:

File name Description
thumbs.db Windows thumbnail cache, created by Windows if the folder contains image files.
.DS_Store Mac OS X desktop information cache, created if a remote Mac OS X system accesses a writable Windows file share.

Removal actions

The installer can remove or retain the folder during product removal.

Remove action Description
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.
Remove if empty See Remove if empty in previous table.
Remove folder and files See Remove folder and files in previous table.
Remove folder and subfolders See Remove folder and subfolders in previous table.

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.

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.

Related topics

Files and folders, Working with attribute panes