Path Variables are used to specify locations on the file system. The project resources' location may be specified relative to these path variables. In this manner, you can avoid references to a hard-coded location on your file system which are very hard to maintain for every resource.
Global path variables can be used in multiple projects
Changing a path variable on one machine can help you change the path of all the resources that use it. In the end, path variables still resolve to absolute paths.
Do not confuse using path variables with using relative paths. To avoid re-adding resources or worrying about missing resources you have to ensure all paths stay relative to the project root path when moving the project from one computer to another. In this case, you don't need path variables.
An example of using path variables is when your project uses resources from the JRE installation on the development machine. This location can differ from one machine to another. With path variables all you have to do is define a path variable that points to the location of the JRE on your current development machine, then after moving the project make sure you change it to the new location on the new development machine. This way all references to that location can be changed simultaneously just by changing the path variable from this dialog on the new machine.
Path variables are used during the development of your installation project. They do not apply to the target computers where the package is installed. Thus, they cannot be used instead of formatted references.
To convert the existing absolute paths to path variables use the Convert Paths wizard (“Project” -> “Convert Paths...”). This wizard scans your installation project for static paths and changes them to path variables Alternatively the wizard allows you to transform project paths that already use path variables back to absolute by deselecting the locations in the tree.
This field displays the path to the XML file that contains the user-declared path variables.
This combobox contains the following options:
This command enables you to select and import an XML file which contains path variables. Once an XML file is imported the "Path:" field will be populated with its location and the imported variables will appear in the "Path Variables" listbox.
This command lets you save the previously declared path variables. Only the custom declared variables (global variables) will be saved in the generated XML file. Advanced Installer variables and System Folders variables will not be included. If no custom path variable is declared, running this command will not generate an XML file.
The path variables declared in this dialog are actually created once the "Edit Path Variable" Dialog is closed by using the button. Therefore if you want to export them in an XML file it is recommended to first create the variables and then use the "Save To..." command.
This listbox displays all the path variables available to be used in the current project. It contains two fields:
- This field contains the path variable's identification name
- This field displays the location where the variable points at.
- Expanded Value
- This field displays the expended location where the variable points at.
Creating a new path variable
Use the Insert key.toolbar button, the “New Variable...” context menu option or press the
Editing a path variable
Use the Space key.button, the “Edit Variable...” context menu option or press the
Deleting a path variable
Use the Delete key.button, the “Remove” context menu option or press the
- Edit Path Variable Dialog
Create or update a path variable