User Guide
322
About Path Variables
About Path Variables
Note
(Visual Studio integrated editor only.) This feature is independent of Visual Studio .NET’s
Configuration Manager feature, which lets you store source files in Release and Debug
directories.
When you add a file to an installation, its source path is stored. During compile, the
source path information is used to find the file and compile it into the .MSI or .EXE. The
Path Variables page lets you define variables to replace commonly-used source paths.
However, it has no effect on files that are already part of the installation. For these files,
see Changing Source Paths in an Installation on page 325. If you add a file, and its
source path matches one of the paths defined on the Path Variables page, the variable
that represents the path is stored instead of the hard-coded path.
Example: Suppose the source files for your test build are in C:\Application\Test, and the
source files for your production build are in C:\Application\Production. You could create
a user-defined path variable named Application_Files and set it to C:\Application\Test. If
you then add the test build source files, their source path would contain the variable
name. You could then change this path variable to C:\Application\Production for your
production build.
Note
Do not create more than one variable that refers to the same path, because only one of them
is used when you add files.
Predefined Path Variables
Commonly used paths, particularly system-related paths, are predefined on the Path
Variables page. By default, they are enabled, which means all files you add from
common folders contain path variables as part of the source pathname. You cannot
modify predefined path variables, but you can turn substitution off; see Turning Path
Variable Substitution On and Off on page 322.
Use to Replace Substrings
You can also use path variables to replace any matching substring in a path. Example: If
files are in C:\Development\Application\Version1.0, you could create a path variable
named Version and set it to Version 1.0. Each time an instance of “Version 1.0” was
found in a path, it would be replaced with [Version].
Options for Creating a Path Variable
! Creating a User-Defined Path Variable on page 323.
! Creating a Path Variable Based on an Environment Variable on page 323.
! Creating a Path Variable Based on a Registry Value on page 324.
Turning Path Variable Substitution On and Off
The Path Variables page lets you define variables to replace commonly-used source
paths. Once these variables are defined, you can turn them on and off.
1. Select Installation Expert > Path Variables page.
2. Mark or clear the checkbox in the Replace column.