Installer plug-ins and package installation commands

Package installation commands

Software package downloads are handled completely by built-in Service Agent functionality. Because installation varies depending on the platform and device, the Service Agent uses an "installer plug-in" to process the installation. The commands specified for a software package depend on the installer plug-in and will vary from plug-in to plug-in. The table below defines the package installation commands.

NOTE: The failure of any command will halt the package processing.

Installer plug-in and package installation commands

Command

Used to

Pre-download

Determine if a download can start.

Post-download

Perform any post-download processing required.

Pre-install

Determine if an installation can start.

Install

Install the software package on the device. (Required for the Service Agent Standard Installer plug-in, described below.)

Recover

Recover from a failed installation of the software package.

Post-install

Perform any post-installation processing required.

Pre-activate

Determine if the software package can be activated.

Activate

Activate the software package on the device.

Post-activate

Perform any post-activation processing required.

The default installer plug-in provided by Questra with the Service Agent is the Standard Installer, a shared library (DLL) designed to work on supported Windows NT family and UNIX-like systems. The Service Agent Standard Installer preprocesses the package Install, Pre-, Post-, and Activate commands and sends them to the system command interpreter (the Bourne shell for UNIX-like systems and, generally speaking, CMD.EXE on Windows).

Commands that can be used at the command interpreter may be used by the package installation commands. Multiple commands may be used simply by inserting the command interpreter command separator in each of the commands.

The preprocessing performed is string substitution for the following keywords:

NOTE: Make sure you consider spaces in path and directory names, including those that are substituted using the keywords.


Best Practice for  package installation commands

The Service Agent Standard Installer does not add quotes, so always use double quotes around the commands or keywords that may contain spaces (i.e., PKGFILE, PKGDIR, and SWDDIR).

The return codes of the commands are interpreted by the Service Agent Standard Installer and translated into return codes to the Service Agent. The interpretation of the command return codes varies depending on which commands they are. The return codes for the package commands have the meanings in the following tables.

Service Agent Standard Installer return codes for the Install and Activate commands

Return code

Meaning

0

Success, operation complete.

2

Success, operation not complete.

All others

Failure.

Service Agent Standard Installer return codes for all other commands

Return code

Meaning

0

Success, operation complete.

All others

Failure.

Examples

To illustrate the package installation commands that might be used with the Service Agent Standard Installer, consider the following two examples.

Example 1: In this example, the Service Agent Update feature is used to update the Service Agent itself on a Windows XP system, and automatically clean up the package file. To perform this operation, the package commands in below would be used.

Command

Value

Pre-download

 

Post-download

 

Pre-install

 

Install

"SWDDIR\bin\saupdate" –pkg "PKGFILE" –device "DEVICENAME" –pkgid PKGID –reqid REQID > "PKGDIR\DEVICENAME\REQID.log" 2>&1

Recover

 

Post-install

del "PKGFILE"

Pre-activate

 

Activate

 

Post-activate

 

Example 2: In this example, a fictitious installation program handles all phases of the installation process for a UNIX system. To perform this operation, the package commands below would be used.

Command

Value

Pre-download

"PKGFILE" -predownload

Post-download

"PKGFILE" -postdownload

Pre-install

"PKGFILE" –preinstall

Install

"PKGFILE" -install > "PKGDIR/DEVICENAME/REQID.log" 2>&1

Recover

 

Post-install

"PKGFILE" –postinstall

Pre-activate

"PKGFILE" –preactivate

Activate

"PKGFILE" –activate

Post-activate

rm -f "PKGFILE"