Previous Topic: sd_registerproduct - Register a PIF Product in the Software Package LibraryNext Topic: Install a Self-Installing PIF Product


lsm—Manage Software Installations on Linux and UNIX Systems

The lsm command lets you manage products of various different packaging formats on target computers. These packaging formats include:

The lsm command provides methods to install, remove, list, backup, check, query installed products, query PIF product files, and update installed products. Therefore, root permission is required on the target computer.

The lsm command has the following formats:

-i prodfile [-r responsefile] [–s] [–F] [–V] [–R]

Installs a PIF, PKG, or RPM packaged product. The full path name of the product must be specified as prodfile. A response file can be added to customize the unattended installation.

The –s option lets the installation run in unattended (silent) mode.

The -F option performs a forced installation; that is, if the backup of an existing product fails, the installation continues.

The -V option instructs the Installer to use the text mode even if Java is installed.

The -R option retains configuration files.

-e prodname [-s] [-R]

Removes the specified installed product.

The -s option lets the removal run in unattended (silent) mode.

The -R option specifies to leave all configuration files unchanged on the system.

-l [-O {pif | rpm | pkg | patches}] [-g prodfamilyname] [-f filename]

Lists all installed products.

Note: If the list command is used during the installation process, further information is printed to the screen.

The -O option lists only products of the specified packaging format or only patch products.

The -g option lists all products that are assigned to the specified product family.

The -f option lists the product that installed the specified file.

-A prodname -d prodfile [-o]

Creates the backup file prodfile of the installed PIF or PKG product prodname.

The -o option overwrites an existing prodfile.

-c prodname

Checks the specified installed product and all depending products for consistency. That is, the files of the product are checked for existence and for proper access, user and owner rights. Checks also if required products are installed.

-C prodname

Configures the specified product. Executes the configuration wizard (first dialog is specified by the keyword #dlgconfig keyword.)

-q prodname [-l] [-ODEPLIST]

Queries the installed product prodname and shows the product properties. The -ODEPLIST option prints the dependency hierarchy (INSTALL_ORDER) for the specified product to the console. The -l option provides a long list including all installed product files.

-Q prodfile [-l] [-ODEPLIST]

Queries the PIF product file prodfile, and shows the file properties. The -ODEPLIST option prints the dependency hierarchy (INSTALL_ORDER) for the specified product file to the console. The -l option provides a long list including all installed product files.

-a prodfile -r responsefile

Runs the installation dialogs and creates a response file using the values entered. The PIF product is not installed.

-v

Prints the version of the Installer used.

-u prodfamilyname -d prodpath

Directs the Installer to scan the system for all matching product packages with the same product family name, and to update those products to the latest version level. The -d option specifies the location where the latest product version is stored. The latest product version can be provided as an update CD or in a local folder.
All product packages are updated to the highest version. Product packages on the update CD that have lower versions than the target packages are skipped during update.

-M textID1[-textID2] -f prototypefile

Refers to a single text (specified by textID1) or a range of texts (specified by textID1-textID2) in the resource section of the specified PIF product prototype file. Each script of a PIF product can use this command option in order to print localized texts.

-x prodfile exportspec [-d directory] [-o] [-s]

Runs through the setup process and extracts a script and the complete environment to execute and test the script. Interviews and the response file are also extracted to let the user change parameters.

exportspec indicates which script environment to export and can have one of the following values:

--exportprestart

Exports the prestart script environment

--exportpreinit

Exports the preinit script environment

--exportpostinit

Exports the postinstall script environment

--exportrmpreinit

Exports the preremove script environment

--exportallscripts

Exports all script environments listed above within one call

The -d directory option specifies the target directory. You must enter -d pwd or -d . (dot) for the current directory.

The -o option specifies that existing files in the target directory are overwritten.

The -s option specifies silent mode, that is, there is no user interaction.

Exit status:

Displays the status of the command execution. The value zero (0) means OK, any non-zero value indicates Error.

Example: Install PIF product on local system

The following command installs the PIF product test-product.Any.@pif on the local system.

lsm -i test-product.Any.@pif

Example: Remove PIF product from local system

The following command removes (uninstalls) the PIF product test-product.Any.@pif from the local system in unattended (silent) mode.

lsm -e test-product -s

Example: Create backup file of PIF product

The following command creates a backup file of the installed PIF product test-product. The backup file has the name test-product.bckp, and is located in the /tmp directory.

lsm -A test-product -d /tmp/test-product.bckp

Example: Update product family

The following command scans the system for all packages with the product family name CCS, and updates them with product packages that are stored in the local folder /tmp/2.0.0.0.

lsm -u ccs -d /tmp/2.0.0.0/

Example: Using lsm -M in a script

In the following example a script of a PIF product uses the lsm -M option to print the localized text with the number 100 from the resource section.

@RESOURCE:
#text: 100 , Dieses ist ein lokalisierter Text ;
@ENDRESOURCE:

The script looks like this:

#!/bin/sh
echo `lsm -M 100 2>/dev/null`
exit 0

Example: Extract the prestart script and its environment for testing purposes

The following lsm command version runs the setup of the PIF product test-product.Any.@pif and extracts the prestart script and creates a "wrapper" script which contains the complete environment information to execute the prestart script for testing purposes. The extracted information also includes dialogs for user interaction and the response file, so that parameters can be updated during the test phase.

The name of the "wrapper" script is constructed by the Installer (lsm command) as start_prestart.sh.

The target directory for the command output is the current working directory.

lsm -x test-product.Any.@pif --exportprestart -d pwd