Frequently Asked Questions
Previous Topic  Next Topic 

1.  How do I save relative paths for the files in my install project?


Most installers give you the option of a check box that allows you to save all of the files in your project as relative paths.  Relative usually being relative to the location of the project file itself.  This is an extremely useful feature since most developers don't usually put their work in the same locations on their own machines.


Instead of just a simple check box for saving paths as relative, InstallJammer allows you the ability to completely re-map the location of any file in your project.  This is done through the Location property for directories and files.  If you select a file or directory in your project, you will see a standard property called Location.  This property tells InstallJammer where to find this file or directory on the local system.  If you click the Location property, you see a browse button that opens a popup for specifying the location.



InstallJammer lets you specify the location as a directory that can be stored back into the project file itself or one that you can store in your own local copy of your InstallJammer preferences.


If the location is specified for a directory, it is the actual location of that directory, not the directory that contains that directory.  If the location is specified for a file, it is the directory that contains that file.


Locations can be specified as a full directory path, a relative directory path or virtual text.  A relative directory path is relative to the location of the project file itself.  Virtual text can contain a full or relative path and will be substituted at build time to get the file location.


For example, you could specify the Location of your main application directory as <%BaseDir%>.  Then, in your Virtual Text Strings table, create a new virtual text variable BaseDir with the location of your application.  Then, you can actually build from the command-line with a different location by specifying -DBaseDir /path/to/your/application.



2.  Where is the best place to put my project file so that it is part of my application directory?


Many developers wish to put their InstallJammer project files somewhere within their application structure so that the project file can be easily included when packaging the application itself and so that the project file can be maintained in the same source repository as the application itself.


It's best to put your project file in its own subdirectory because InstallJammer uses the project file location as a base for creating a build/ and output/ subdirectory.  So, the best place to put your project file so that it is part of your application directory is in a subdirectory off the main application directory.  An installer/ subdirectory would do nicely.


With this in place, you can easily specify the Location of your main application directory as ".." and have all of your application files be relative to your project file.  Since relative Locations are relative to the project file, a Location of .. means that the files are located one directory down.



3.  How do I build from the command-line with a different location for my application?


This is easily done by giving the directories in your install project a virtual text Location.  If the Location of a directory is specified as virtual text, you can then specify a new value for that virtual text on the command-line when you build.


Let's say you have a main application directory, and you specify the Location of that directory as <%BaseDir%>.  Then, in your project file, you can create a new virtual text variable called BaseDir with a value of /my/application/is/here.  Now, you want to build from the command-line with a different directory location for your application, so you do:


installjammer -DBaseDir /path/to/my/application /path/to/my/project.mpi


The -D option lets you specify a virtual text variable and a value that will be overridden in the install project before the installer is built.  The last argument on the command-line is always the path to your project file.  Using the above command, your project will be built with your application files located in /path/to/my/application.