Command-line switches for packages

Paquet Builder brings you several tools to define command-line switches for your packages and uninstallers.

It doesn’t provide standard ready-to-use switches. You must define them. We provide several action templates to do so.

Accessing the command line for packages and uninstallers

Paquet Builder defines several variables that you can use within your custom actions.

Variable nameWhat it contains
%PARAMCOUNT%Number of command line parameters passed to the package. Defines the number of %PARAMx% variables.
%PARAM%Command line first parameter passed to the package (if any) - blank if none.
%PARAM2%Command line second parameter passed to the package (if any) - blank if none.
%PARAM3%Command line third parameter passed to the package (if any) - blank if none (replace 2 by 3 for third if any - and so on…).
%PARAMx%Command line xth parameter passed to the package (if any) - blank if none (replace x by the position of the argument in command line) - x from 2 to %PARAMCOUNT%.
%PARAMS%Entire command line passed to the package.

Examples

MYPACK.EXE /s
  • %PARAMCOUNT% = 1
  • %PARAM% = /s

Other %PARAMx% variables will have blank values.

MYPACK.EXE /LCID 1024 /d "C:\My Documents\Data"
  • %PARAMCOUNT% = 4
  • %PARAM% = /LCID
  • %PARAM2% = 1024
  • %PARAM3% = /d
  • %PARAM3% = C:\My Documents\Data
As you can see, spaces must be enclosed in quotes. Paquet Builder removes quotes automatically.

Defining command-line switches

Thanks to the custom action “Find one string within another”, you can detect whether a switch is specified in the command line. We have several ready-to-use samples available as action templates.

For instance, you can create a switch to activate the silent mode (no dialog boxes, no messages…). Look at the Enable Silent Mode from Package Command Line template.

Command-line

© G.D.G. Software 2018. All rights reserved.