Creating CID-Enabled Installations

by Andrei Malacinski, Ken Greenlee, and Ernie Lovenhouse

Using the right combination of products, you can create an automated and unattended environment for software installation. Products supporting IBM's Configuration, Installation, and Distribution (CID) architecture allow installation and configuration of software on client workstations from code residing at a server, freeing you from the time-consuming tasks of inserting diskettes and responding to installation prompts and messages at each client workstation. CID minimizes, and often eliminates, the need for human intervention at the client machine. CID-enabled software is typically distributed by a software distribution manager (SDM), such as NetView Distribution Manager/2 (NvDM/2) or LAN CID Utility (LCU), a component of Network Transport Services/2 (NTS/2).

This article presents an overview of the CID architecture, followed by installation scenarios that use Software Installer in combination with both NvDM/2 and LCU, which exploit this architecture.

Creating a CID-Enabled Software Program
The controlling mechanism within CID is the SDM. The SDM starts the installation, determining if the installation was successful, and then repeats the process on multiple workstations. Some SDMs can even schedule the installation to occur after employees have gone home for the day.

However, the SDM does not actually install and configure the software. This task is left to the product's installation program.

For an installation program to be CID-enabled, the program must support:
 * Transfer of product files to a repository
 * Response files
 * Command-line parameters
 * Support of any network (redirected) drive
 * Progress information
 * Return codes

Transfer of Product Files to a Repository
Because the software will be installed without user intervention, the software files must be made available to the installation program in a repository, such as a network drive. Do this using OS/2's XCOPY command on the software diskettes.

Response Files
Typically, the installation of software requires the user to answer questions, specifying such things as target drive or LAN user ID. Because your software will be installed without user intervention, response files are used to supply the answers to the questions. Supply a sample response file with the software, so an administrator can make modifications if necessary.

Command Line Parameters
The SDM calls the software's installation program to install and configure the software. CID defines a set of command-line parameters. Some of the parameters are:
 * /S:
 * Source repository directory


 * /R:
 * Location and name of the response file


 * /T:
 * Target drive of the installation


 * /TU:
 * Location of the CONFIG.SYS to update during the installation


 * /Lx:
 * Location and name of the log files; x can be any number from 1-5.

Support of Any Network Drive
Because the software files are stored in a repository, the installation program must be able to perform the installation using the files in the repository. The repository is accessed as a network redirected drive. Installation programs can no longer assume that all files are being installed from the A: drive.

Progress Information
During the installation and configuration of the software, the installation program captures progress information in a log. At a minimum, the installation program must capture error and history information. The administrator uses these logs to diagnose errors.

Return Codes
The installation program must be able to return information to the SDM indicating the status of the installation using return codes. CID defines a set of return codes to indicate success and several reasons for a failure. CID also defines a set of return codes to indicate whether the workstation that the software is being installed on needs to be rebooted. The return codes also indicate whether the installation program needs to be restarted to complete the installation of the software. The SDM can perform the reboot of the workstation.

Figure 1 provides an overview of the CID architecture.



Figure 1: Overview of CID Architecture

The next section describes how you can use Software Installer to create a CID-enabled installation for your application. Use either NvDM/2 or LCU for an unattended install.

Software Installer and NvDM/2 Scenario
An application that uses Software Installer as its installation is CID-enabled and can be distributed in an unattended mode using the NvDM/2 SDM. The programmer, who has installed the NvDM/2 Change Control (CC) Server with the recommended directory structure, uses the XCOPY command, with the /S parameter, to transfer the contents of the application's diskettes to the server. In this example, use the following information to build the change file profile that will be used to test the installation of Software Installer onto a single NvDM/2 CC Client in the test configuration: Component name length = 5 Target Directory = DEXE Parameters = /SDAT Working directory LogFile 1 = SBL1 LogFile 2 = SBL2 ''Sample Code 1. Installation of Software Installer by NvDM/2 Change File Method''

After you build and catalog the change file profile, schedule the unattended installation of the application. Checking the log file reveals that the installation has completed successfully.

Software Installer and LCU Scenario
You can also distribute the installation in an unattended mode using the LCU SDM if you use Software Installer. After you install the LCU server with the recommended directory structure, use the XCOPY command with the /S parameter to transfer the contents of the application's diskettes to the server. In this example, use the information in Sample Code 2 to edit the sample command file CASSKEL.CMD shipped on the NTS/2 Utilities diskette. After modifying the command file, run the file from a single LCU client in the test configuration to install Software Installer.

Note: Only the sections of the command file that can be modified are documented.  /* REXX command file to Install SI using LCU                */ /*---*/ /* DO NOT MODIFY THE NEXT EIGHT LINES                        */ /*---*/ parse ARG client logfile additional QUEUE_REBOOT = 0 CALL_AGAIN = 0 Call AddDLLFunctions x.0.instprog = '' x.0.rspdir  = '' x.0.statevar = 'SI' x.0.default = '' /*---*/ /*             MODIFICATIONS START HERE                      */ /*---*/ /*******************************************/  /*                 SRVATTCH SECTION        */ /*******************************************/ 'SRVATTCH Z: \SERVER1'        /* More SRVATTCHs can be added here   */ /* 'SRVATTCH Y: SERVER2'*/   /* They can be placed before specific */ /* Run Install statements too if you */ /* want to attach to a special server */ /* right before a specific install. */

/*************************************************************/ /*                 VARIABLES SECTION                         */ /*************************************************************/ /*         DO NOT REMOVE THE NEXT FOUR LINES                 */ /*             (They may be modified)                       */ /*---*/ bootdrive = 'CSYS'   /* Fully qualified path to CONFIG.SYS    */ exepath  = 'Z*************/ x.install   = 1                          /* Structure index                      */ x.1.name    = 'SOFTINST'                 /* Product name                         */ x.1.statevar = 'SI'||x1.name             /* State variable name                  */ x.1.instprog = exepath || '\INSTALL.EXE', /* Fully qualified install program name */ '/TLOG',                      /* Client error log file                */ '/L2LOG',                     /* Client history log file              */ '/RDAT'                       /* Fully qualified response file name   */ x.1.rspdir  = '' x.1.default = '' /*---*/ /*  NUMBER OF PROGRAMS SET UP IN THE */ /*         PRODUCT DATA SECTION     */ /*---*/ NUM_INSTALL_PROGS = 1 /**/ /*  DO NOT MODIFY OR REMOVE THE NEXT LINE     */ /**/ OVERALL_STATE = GetEnvironmentVars

/*************************************************************/ /*                  INSTALL SECTION                          */ /*************************************************************/ Do Forever Select when OVERALL_STATE = 0 then do       if BootDriveIsDiskette == YES    then iterate /* Check if booted from diskette*/ /* If it was, then goto state 1 */ if RunInstall(x.install) == BAD_RC   then exit /* Install Software Installer   */ Call CheckBoot                                 /* Reboot if it was requested   */ end when OVERALL_STATE = 1 then do       if RunInstall(x.install) == BAD_RC    then exit /* Install Software Installer   */ Call CheckBoot                                 /* Reboot if it was requested   */ end end exit  ''Figure 3. REXX command file to Install SI using LCU''

Having made the appropriate changes to the REXX command file, execute the file from the client. The successful completion of the install is reported in the log file on the server.

Summary
Software Installer for OS/2 provides a rich, functional installation and maintenance program for your application. With its support for CID installations, it can be used in combination with NvDM/2 or LCU to create an unattended installation environment.

A demo of Software Installer is available on your accompanying CD-ROM.