TsuArguments

InstallMate sets this variable to the concatenation of the installer's command line arguments, excluding the initial program name. Note that the arguments will differ between sessions: an uninstall session will typically include the /remove command line argument, for example, whereas a regular installation session does not.

Individual arguments are separated by spaces; if an argument contains one or more internal spaces or one or more characters that have special meaning for Windows command line use (i.e., any characters from the set &<>[]{}^=;!'"+,`~), the argument will be "quoted".

The final set of command line arguments consists of, in order:

  1. [Installation only] Any installer arguments preset in the Default args field of the package;
  2. [Installation only] Any piggy-backed command line arguments;
  3. [Always] Any arguments passed on the installer's command line.

Usage

You can refer to this variable as <TsuArguments>. To retrieve individual arguments, use the $part() runtime function; to check for the presence of a specific argument, use the $instr() function.

Examples

<TsuArguments>
Retrieves the entire list of command line arguments in a single string.
<$part(<TsuArguments>,,2)>
Returns the second individual command line argument, or an empty string if less than two arguments were present.
<$instr(1, <TsuArguments>, /myopt)>
Returns a nonzero (True) value if /myopt appears among the command line arguments, or zero (False) if not. Note that the $instr() function will match partial strings as part of longer strings, so a command line that contains a longer version of the search string, for example /myoption=somevalue, will also be matched by this test.

Related topics

TsuPath, Internal variables