Administer > Content utilities > IDK scripts > Installation scripts

Installation scripts

The installation scripts reside in the pad subdirectory. Like installation hooks, the installation scripts are run at specific stages during the installation and uninstallation of an application on a managed server.

Differences between installation scripts and hooks

Although they serve a similar purpose, installation scripts and hooks have several differences, as noted in the following table.

Differences between installation scripts and hooks

Installation scripts

Installation hooks

Displayed by the Properties of the package in the SA Client.

Displayed by the Contents of the package in the SA Client. (Only RPMs are displayed.)

Reside in the pad subdirectory.

Reside in the ism/pkg subdirectory.

Stored in Model Repository (after an upload).

Bundled in the control package, installed on the managed server in the directory specified by ctlprefix.

Run by the Server Agent.

Run by the native packaging engine.

Can be defined for each package in the ISM.

Defined for the entire ISM.

Creating installation scripts

Although the ISMTool creates the pad subdirectory structure, it does not create default installation scripts. For each package created with --build or added with
--addPassthruPkg, the ISMTool creates a subdirectory as follows:

pad/<package-name>/scripts

For example, on Linux the --build command would create the following subdirectories for an ISM named ntp-1.4.2:

pad/ismruntime-rpm-2.0.0-1.i386.rpm/scripts
pad/ntp-ism-4.2.1-1.i386.rpm/scripts
pad/ntp-4.2.1-1.i386.rpm/scripts

With a text editor, you create the installation scripts in the scripts subdirectory. For example, you could create installation scripts for the ntp-4.2.1-1.i386.rpm package as follows:

pad/ntp-4.2.1-1.i386.rpm/scripts/
	preinstallscript
	pstinstallscript		
	preuninstallscript
	pstuninstallscript	


The file names of the installation scripts must match the preceding example. For example, the script invoked immediately after the installation must be named pstinstallscript.

Invocation of installation scripts and hooks

If an ISM has both installation scripts and hooks, when an application is installed on a managed server, Server Automation performs tasks in the following order:

  1. Installs the ISM runtime package.
  2. Installs the ISM control package.
  3. Runs preinstallscript (installation script).
  4. Runs ism_pre_install (installation hook).
  5. Installs the application package (the application bits).
  6. Runs ism_post_install (installation hook).
  7. Runs ism_configure (control script).
  8. Runs ism_start (control script).
  9. Runs pstinstallscript (installation script).

During the uninstallation of an application on a managed server, Server Automation performs actions in the following order:

  1. Runs preuninstallscript (uninstallation script).
  2. Runs ism_pre_uninstall (uninstallation hook).
  3. Runs ism_stop (control script).
  4. Uninstall the application package (the application bits).
  5. Runs ism_post_uninstall (uninstallation hook).
  6. Runs pstuninstallscript (uninstallation script).
  7. Uninstalls the ISM control package.
  8. Uninstalls the ISM runtime package.