Working with file properties

This feature lets you specify custom properties for each file of the package: custom destination folder, conditional variable and file action-options.

Accessing to the file properties editor

First you need to open the file manager (by pressing CTRL+F for example). Then in the list select the file you want to edit the properties of, and finally press the Properties button to show the editor. You can both edit the properties of a single file or a group of files.

Here is a screen shot of the file properties editor:

Where to extract the selected file(s)?

You can use this field to specify the path to the target folder for the extracted file. If you leave this field blank, the package will unpack the file into the default destination folder or in the corresponding sub-folder if the directory structure is stored into the archive (see the warning below).

To change this target folder, enter the path (no filename) where you want to place the extracted file into. You should always use a variable for this field (absolute paths are not recommended): use the combo box to display the list of available folder variables pointing to system folders ike User Desktop, Common Files, System Folder... See the list of available path variables here.

For example, you can select your shared .DLL files and set their destination folder to %SYS% which refers to the System folder. On the screen shot, the selected files will be unpacked to %COMTEMPLATESDIR%\The templates.

If you enable the "Store Path Information" option and you specify a target folder, then that stored path information will not be restored when extracting files. The target folder actually supersedes the default destination path of its associated files; see this example:

Any path variable can be used; there is a lot of possibilities. For example, you could read the destination path from the Registry in a variable using a custom action, and then use that variable as the target folder.

Is there a condition to extract the selected file(s)?

In some cases you may need to control whether a given file should be extracted or not. For example, if a shared file is missing on the destination computer or in the case you want to install the registered version of your product only if the user has entered the correct registration key...

It is possible to decide at runtime whether a file can be extracted or not. It requires you to associate a variable called Conditional Variable to the file. Thus the file will be extracted or not, depending on the value (Boolean type) of its conditional variable.

Just enter the variable name in the "Conditional Variable" field: you may also use the Variable Manager to select an existing variable by pressing the button.

Before extracting this file, the package will evaluate the value of the associated conditional variable (if any): if its value is set to "0" (false), then the file is ignored.

Now you need to add an action (generally "Perform operation on a variable") to the custom action list (and before the file extraction phase of course) that sets the value of the conditional variable: if the value is equal to 0, then the file will not be extracted. Otherwise it will be unpacked.

To reset the file properties list (clear all changes), right-click on the list to get the context menu and select the option "Clear Files Properties".

Component Variables and Conditional Variables

If files are belonging to a component, then their extraction may depend on the value of the component's variable. If you use the two features (both components + conditional variable) they may interfere: that's why it was decided that conditional variables outclasses the component variables.

Suppose that we have a file belonging to a component and associated to a conditional variable. For example, the component variable is set to 0 (false): if the conditional variable is set to "1", the file will be extracted.

See this diagram:

File Actions

Although all of the following actions may be easily performed with custom actions (and with more control over the result), you can still use the file properties to gain time, especially if you have huge file lists.

Self-register the file (ActiveX, COM...)

Turn on this option to cause the package to register the selected file (it must be an executable or DLL file!).
Please have a look at the similar custom action for further information.

Register the file as shared (ActiveX, COM...)

Turn on this option to cause the package to indicate that the file may be shared by several applications, and therefore should not be removed if still used.
Please have a look at the similar custom action for further information.
Note that this option is automatically turned on if the file is self-registered (option above).

Do not remove the file when uninstalling the package

This option is useful only if you include an uninstaller for the package.

By default the uninstaller will remove any file extracted by the package (except if it was marked as shared). If you do not want the uninstaller to remove the selected file(s), then activate this option.

During uninstall, if a file was previously self-registered (using the option above), the uninstaller first checks whether the file is still used by other applications or not. If yes, the file is left untouched. Otherwise it is first unregistered and then safely removed.


  Paquet Builder Help - Copyright © G.D.G. Software. All rights reserved.