How to use Source Paths to allow sharing the same project file on different machines
SummaryThis articles goes over how to use Source Paths to allow sharing project files in different environments
SynopsisYou can use source paths to reference file resources using variable paths instead of absolute paths. If you move your project and source files to a different location, InstallAnywhere can find all of the files by simply updating these source paths. This allows you to share a project file with other team members, even when the file resources are located at different paths on their development systems. Using source paths also enables you to use the same project file on different types of operating systems, such as UNIX-based and Windows-based systems.
DiscussionHow to Use Source Paths
When migrating a project file (.iap_xml) to another machine, opening the project may cause InstallAnywhere to prompt you to verify the location of referenced files. Manually re-referencing all of your source files can be a very costly task. Utilizing Source Paths will help eliminate this process. For example, say your source files are located under a directory called D:\Sources. If you were to create a Source Path called $SOURCEPATH1$ with a value of D:\Sources, all paths that reference D:\Sources in your project will now use $SOURCEPATH1$ instead. For example, if you have an Install File action that references D:\Sources\sample.xml, the path will get resolved as $SOURCEPATH1$\sample.xml. If you open this project on another machine, the path will retain the usage of $SOURCEPATH1$\sample.xml. You will then simply need to update the $SOURCEPATH1$ variable on the new machine to the folder path that contains the source files on the new machine.
How to Add Source Paths
InstallAnywhere supports two different methods for adding source paths to a machine.
To add source paths using the InstallAnywhere Preferences dialog box:
- On the Edit menu, click Preferences. The InstallAnywhere Preferences dialog box opens.
- Click the Source Paths tab.
- Select Enable Source Paths check box.
- Click the Add button. InstallAnywhere adds an empty row to the list of source paths.
- In the Access Path Name column, click the empty box and then enter a variable name for the source path. For example: RESOURCE
- In the Folder column, click the empty box. The Choose Folder dialog box opens.
- Browse to the source path and click the Select button. InstallAnywhere adds the full path to the Folder box.
- Click OK.
For example: $RESOURCE$
To add source paths using system environment variables:
- Access the environment variables on the development system:
- On Windows-based systems, open the System Properties dialog box. On the Advanced tab, click the Environment Variables button.
- On UNIX-based or OS X?based systems, modify the proper shell configuration file or set the variable directly using the shell.
- Add an environment variable for the source path, preceded by the string IA_PATH_. For example, to set the source path SOURCE_PATH, set the environment variable as follows: IA_PATH_SOURCE_PATH
Related KB ArticlesSource Path File Location
Use Source Paths With the InstallAnywhere Ant Build Task
How to Deal with the Path Manager: Source Path Incorrect Message when Opening an Existing Project
Additional InformationSource paths will automatically be substituted for the most complete path possible. For example, suppose you have a project with the following defined source paths:
$SOURCEPATH1$ = D:\Sources\SampleApp\3000
$SOURCEPATH2$ = D:\Sources
When you add a file such as D:\Sources\SampleApp\3000\readme.txt to that project, because $SOURCEPATH1$ has the most complete path match available, this file will be referenced by: $SOURCEPATH1$\readme.txt
If a team member opens this project and the source path is not defined, InstallAnywhere shows a dialog box that requests the location for the source path.
InstallAnywhere also provides some predefined variables for source paths that exist in any project. The values of these variables cannot be changed or edited:
$IA_HOME$ = Location on the system where InstallAnywhere is running. A common location is: C:\Program Files\InstallAnywhere
$IA_PROJECT$ = Location on the system where the InstallAnywhere project is located.
$USER_HOME$ = The User Home folder.