EN RU
Log in
Home
Download
Purchase
Documentation
Support
Contact us
 
Help  /  Examples & tips

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.png
Source 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.

See also

  • Global variables
Eonza automation software - free, open source cross-platform program for easy creation and management of scripts.
  • Help
    • Introduction
    • Get to know CreateInstall
    • Compare installers
    • License Agreement
    • License Light
    • License Free
    • Program features
    • Command Reference
    • FAQ
    • Examples & tips
      • Customizing setup.exe
      • Example of use of the dialog function
      • Global and local variables
      • How to manage the reboot
      • How to use conditional statements
      • How to use the command Dialog - Settings
      • How to wait for an event
      • Relative paths in the projects
      • Tracking exit
      • Functions for variables
      • One project for many applications
      • Open shortcut folder
    • CreateInstall Assistant
    • Problem solving
    • Setup Extractor
Copyright © Novostrim, OOO, 2009-2026 All rights reserved.