Relative paths in projects
Suppose that you want to store some installation files in the same folder as a .ci project file. They can be image or temporary files or files of the application itself. This is useful when you need to move the project and create the installation on other computers. Just copy the necessary directory where the project is located, and run it on another machine. In this case, you want to use relative paths (sufolder\*.*, ..\subfolder2\myfile.txt), but when the CreateInstall installer makes your installation, the current directory is not the same as the folder of the project file, and it also can be changed during the installation.
To solve this problem it is necessary to use the global variable $prjpath$, which corresponds to the full path to the file of the current project. Global variables have two features:
- Global variables are substituted before the creation of the installation.
- They can be used in any field of your project.
For instance, you have the following directory of the project file
c:\myprojects\myapp myapp.ci myappext.g images\myimage.jpg images\logo.png source\myapp.exe source\myapp.dat
In this case, you can specify the graphics for the dialogues as
$prjpath$\images\myimage.jpg $prjpath$\images\logo.pngSource files of your application can be specified in the Installation Files command as
$prjpath$\source\*. * or $prjpath$\source\myapp.*
Suppose the file myappext.g contains additional source code for your installation script in the Gentee programming language. For example, it could be some functions for dialog boxes. In this case, specify the following code in the Source Code command
include: $"$prjpath$\myappext.g"
You can copy or move the folder myapp to any location on your PC or other computers and CreateInstall will work with your project correctly.
Similarly, you can use other global variables: $exepath$ - the full path to the CreateInstall folder, $userpath$ - user directories.