Adding an external command to a BLPackage
Using the BLPackage editor, you can add an external command to a package. An external command is any type of command that can be issued on a command line interface.
For example, if you are deploying a package to a web server, you might include an external command to restart the web server, as shown in this example.

An external command can be positioned in a BLPackage so it executes at the time items in the BLPackage are processed. For example, you can create one external command positioned at the beginning of a BLPackage that stops Windows services before the BLPackage is installed. Then you can create a second external command positioned at the end of the BLPackage that starts Windows services after the BLPackage is installed.
The following commands are additional examples of commands that you might find useful in your BLPackage:
- After restarting the web server, set the JAVA_HOME environment variable:
SET JAVA_HOME=C/Java - Install a JRE that you previously downloaded:
cd /tmp/download;jre6.msi
To add an external command
- Right-click in the hierarchy view and select Add > External Command from the pop-up menu.
In the right pane, enter a value for any of the following:
- Name — optionally provides a name for the command.
- Cmd — provides the command or script to be executed when the BLPackage is deployed.
- UndoCmd — provides the command or script to be executed when the BLPackage deployment is undone.
When entering a longer command or script, you can click Browse
to display an Edit window. It provides a larger space for entering text. You can also use the Edit window to import an existing script.
While entering the text of an external command, you can include a reference to a property value that is resolved when the script runs. To do this, enter a variable for the property, bracketed with double question marks (such as ??WINDIR??/rsc). Alternatively, you can click Select Property
to find and enter the appropriate property.- If necessary, enter a value for ActionOnFailure (see Setting-action-on-failure).
- Move the external command to the correct position in the BLPackage (see Moving-an-object-within-a-BLPackage).