Command Line Options
Previous Topic  Next Topic 

The command line options panel allows you to specify the different command-line options that will be available in your (un)installer.  InstallJammer sets up some default options for each new projects, but these can all be removed if you want.


There are a few options that are defined internally during startup that cannot be overriden by your options.  They are:

--help, which displays the usage information for the (un)installer

--temp, which allows the user to specify a temporary directory

--version, which shows version information for the (un)installer

If response files are enabled, the following options are also added to each installer:

--response-file, which specifies a response file to read in

--save-response-file, which specifies that responses should be saved to the given file

InstallJammer automatically defines the character that precedes an option depending on platform, and this cannot be changed.  The characters are removed from the option before processing, so options should be specified without any preceding characters.

Technical Detail

A / is used as the option character on Windows, and -- is used on UNIX, but it really doesn't matter.  InstallJammer will accept either one on either platform, but it will always display the correct one when showing usage information.

Command Line Option Properties


The name of the option not including any preceding option characters.  Options are case-insensitive when specified on the command-line by the user, but they will maintain case when displaying them in the usage information.

Virtual Text

The name of the virtual text (without <% and %>) to store the result of the option into.  What is stored in the virtual text result depends on what type of option is being used.


Each option is of a specific type, and each type behaves differently.  The types are:


A boolean option means that the user must specify Yes or No or some equivalent as the argument to the option.  The virtual text will be set to 0 if the user specified No or 1 if they specified Yes.


A choice is an option that has a list of possible choices the user can choose from.  The choices are all case-insensitive, but the virtual text will be set case-sensitive.  For example, if you had the option check that accepted Foo or Bar, the user could pass /check foo on the command-line, but your virtual text would still be set to Foo eventhough the user passed an all lowercase version.


A prefix option means that the given option is only a prefix that can be specified along with any option after the prefix and a given value.  This can be used to provide a generic option for specifying many things in your installer.  Any option provided to a prefix switch is set as virtual text with the given value.  If the Virtual Text property is not null, it is prepended to the option given.

For example, if you had the prefix option D with Virtual Text CommandLine, the user could pass:

/DFoo bar

On the command-line, and you would have the virtual text <%CommandLineFoo%> set to bar.


A string option means that the user can specify anything they want and no checks are done for validity.  You will have to check the value yourself using an action.  The virtual text will be set to the value of the given string.


A switch means that the option is specified with no argument and simply turns on the option.  The virtual text will be set to 1 if this option is passed on the command-line or not set at all if it is not passed.


This tells InstallJammer whether the given command-line option is meant to be a debugging option or not.  If the option is a debugging option, it will not be included in the options when building without debugging options or when building for final release.


If this property is true, the given command-line option will not appear in the list of option when showing the usage of the (un)installer.  The option will still be included in the build, but the user will not be able to see that it is there.


This property has different meanings depending on the type of option.


If the option is a boolean option, Values can specify a list of two values that translate to Yes and No.  The user will still have to pass Yes or No on the command-line, but if Values is not null, InstallJammer will set the virtual text to the first value if the user specified Yes or the second value if they specified No.


If the option is a choice, Values must contain a list of possible values that are legal for the given option.  The list can be anything you want, but the values themselves will be case-insensitive when the user passes them.


If the option is a prefix, values contains a list of possible options the user can pass.  If values is empty, the user can pass any option they want on the command-line with the prefix.


If the option is a switch, Values can contain a string that will be set in the virtual text if the user passes the option on the command line.  If Values is null, the virtual text will be set to 1.


This is a short description telling the user what this option is meant to do.  When the user passes an incorrect option or specifies --help on the command-line, usage information will be displayed that contains all of the non-hidden options and their descriptions.  The usage information for each option will be different for each option depending on its type, but the description can briefly tell the user what the option is for.