Command-line switches for packages¶
Paquet Builder allows you to define custom command-line switches for your packages and uninstallers. These switches can be used to enhance the flexibility and functionality of your packages.
Warning
Paquet Builder does not include pre-configured command-line switches. You must define them manually. However, action templates are available to help you set them up quickly.
Accessing the command line for packages and uninstallers¶
Paquet Builder provides several predefined variables that can be used in conjunction with custom actions to process command-line arguments.
Variable name | Description |
---|---|
%PARAMCOUNT% | Number of command-line parameters passed to the package. Defines how many %PARAMx% variables are available. |
%PARAM% | First command-line parameter passed to the package (if any); blank if none. |
%PARAM2% | Second command-line parameter passed to the package (if any); blank if none. |
%PARAM3% | Third command-line parameter passed to the package (if any); blank if none. Replace 3 with the desired parameter position (up to %PARAMCOUNT% ). |
%PARAMx% | x-th parameter passed to the package (replace x with the position of the argument); blank if none. Valid values for x range from 2 to %PARAMCOUNT% . |
%PARAMS% | Entire command line passed to the package. |
Examples¶
Example 1:¶
Command:
MYPACK.EXE /s
Values: - %PARAMCOUNT%
= 1 - %PARAM%
= /s
- Other %PARAMx%
variables are blank.
Example 2:¶
Command:
MYPACK.EXE /LCID 1024 /d "C:\My Documents\Data"
Values: - %PARAMCOUNT%
= 4 - %PARAM%
= /LCID
- %PARAM2%
= 1024
- %PARAM3%
= /d
- %PARAM4%
= C:\My Documents\Data
Warning
Arguments with spaces must be enclosed in quotes. Paquet Builder automatically removes these quotes when processing the command line.
Defining command-line switches¶
You can define custom switches using the custom action "Find one string within another". This allows you to detect and process specific switches included in the command line.
Action Templates¶
Paquet Builder provides action templates for common use cases. For example:
- Enable Silent Mode from Package Command Line: This template activates silent mode, suppressing all dialog boxes and messages when a specific switch is detected.
Example:¶
To detect and process a /silent
switch, use the provided template or create a custom action to parse %PARAMS%
for the switch.