Windows Installer Editor Reference
356
Working With Source Paths
See also:
Using Source Control
on page 348
Adding an Installation to Source Control
on page 349
About Path Variables
Note
(Visual Studio integrated editor only.) This feature is independent of the Configuration
Manager feature in Visual Studio, 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
Source Paths in an Installation
on page 359. 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 path. You cannot modify
predefined path variables, but you can turn substitution off.
See
Turning Path Variable Substitution On and Off
on page 357.
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
z
Creating a User-Defined Path Variable
on page 357.
z
Creating a Path Variable Based on an Environment Variable
on page 357.
z
Creating a Path Variable Based on a Registry Value
on page 358.