Previous Contents Index Next |
Setup Util Programmer's Guide |
Chapter 1 Overview of the Setup Util
This chapter introduces the Setup Util and shows you how to install it.
The chapter contains the following sections:
What the Setup Util Is
What the Setup Util Is
The Setup Util is a collection of C++ Application Programmer Interfaces (APIs) used to write programs that install, configure, update, and uninstall server software.
The Setup Util framework is designed to ensure consistent installer interfaces, yet remains flexible enough to accommodate the requirements of different server products. Since it is available for UNIX and Windows NT, you can use it to set up your applications on multiple platforms.
Getting and Installing the Setup Util
To Get and Build the Setup Util
See the Fedora Directory Server Project Setup Util Page.
What the Setup Util Contains
After copying and installing the Setup Util, you should have two directories.
One of these directories contains the Util files. These files are divided into the following subdirectories:
bin, which contains the setup program you ran during installation The second directory was created when you ran the setup program. It contains several files and a subdirectory:
LICENSE.TXT, a sample license
uninstall, a sample uninstall program
setup, which contains information files and logs used during installation. When writing programs with the Setup Util, you will use the files contained in the include and lib directories. When running these programs, you will use customized versions of the files contained in the setup directory.
Key Concepts
This section briefly discusses the important concepts you need to know to use the Setup Util.
Common Install Shell and Information Files
The program used to install server products is called the Common Install Shell. It is launched when the user types setup at the command line. The Common Install Shell cannot install a product unless it is given directions. These directions are stored as plain text in information files.
During a basic installation, the Setup Util uses two or more information files. The first, setup.inf, specifies general installation settings as well as the location of package information files. These additional information files contain the settings used when installing specific server products.
Information files are more fully discussed in Chapter 3 "Information Files."
Installation Modes and Types
The Common Install Shell supports three installation modes: Silent, Binary, and Interactive.
Silent installation allows a user to install one or more servers using an answer script. The installer does not ask any setup questions but does display a progress bar (on Windows NT only). Any results are written to a log file. If an error occurs, the installer writes a message to the log, displays the same message on-screen, and then aborts.
Binary installation is a feature that is only available on UNIX. If you run the Common Install Shell with the -b option (setup -b), the shell will expand all zipped files without performing any configuration. This is helpful for users who just want certain extracted files. If you expose this option, make sure to include tools for configuring the product later.
Interactive installation involves asking the user questions and configuring products based on the collected responses. There are three different types of Interactive installation: Express, Typical, and Custom.
Express installation allows a novice user to install one or more products on a single machine without answering a lot of questions. This gets the user up and running as quickly as possible. In Express mode, default setup options are used as much as possible.
Typical installation is the default setting. It is appropriate for an advanced user who is familiar with his or her operating system and Internet technologies. In Typical mode, an installation program allows a user to select which server components to install. It also allows the user to accept defaults or provide answers to setup questions.
Custom installation allows a power user to select and customize components at installation time. This mode is intended for system administrators who have an advanced knowledge of server products and wish to explicitly provide answers to as many setup questions as possible.
At a minimum, an installation program must support the Express and Typical modes.
Archives
Archives are compressed files that contain the product binaries you want to install. You can create them on UNIX using zip or on Windows NT using a program such as WinZip or InfoZip. Typically, you will have an archive for each product or component that is listed in an information file.
If you want to use different archives depending on a user's environment, you can do so. For details, see Chapter 3 "Information Files."
The Installation Source Repository
The installation source repository contains information files, server packages, components, and pre-installation programs. The repository can reside in a local or network-mounted directory, on a CD-ROM, or on an http server such as Directory Server.
The repository shown above contains a setup.inf file and five subdirectories. Among these subdirectories, the only one that must exist in all installations using the Setup Util is svrcore. The svrcore directory contains two files: svrcore.inf and nssvrcore.zip. The first is a package information file for the basic components involved in the installation. The second is the archive containing these components. Each of the remaining directories contains a package information file and one or more archives. These provide the configuration settings and files used to install servers.
Pre- and Post-Installation Programs
Some products require configuration to take place either before or after installation. The Setup Util supports this functionality through the use of pre- and post-installation programs.
A pre-installation program is typically used to gather answers to all setup questions before copying any files. A post-installation program uses the results of a pre-installation program to configure a server or module.
Pre- and post-installation programs are discussed more fully in Chapter 4 "Writing Pre-Installation Programs."
Installation Cache
Any information that a pre-installation program wants to pass to a post-installation program must be stored in an installation cache. The format of the cache is similar to that of an information file, except that it can include non-Setup Util directives.
The installation cache contains a Global section and one or more Local sections. The Global section stores settings that affect the installation as a whole. The Local sections store settings that are used by individual components. For example, if a user chooses to install a product using the Express mode, the selection is noted in the Global section of the cache. If a user specifies a port number for a specific component, the selection is stored in that component's Local section of the installation cache. Even though they reside in the same file, the Global and Local sections of the installation cache are frequently referred to as the Global cache and the Local cache.
On UNIX, you can use a single method called setupWriteInf to record information in the installation cache. Since the pre- and post-installation programs are stand-alone executables, they can read this data freely. On Windows NT, you must create methods for interacting with the installation cache and then specify their names using the ReadLocalCache, WriteLocalCache, ReadGlobalCache, and WriteGlobalCache directives.
For more information on reading and writing to cache files, see Chapter 3 "Information Files" and Chapter 4 "Writing Pre-Installation Programs."
Log Files
During installation, the Common Install Shell initializes a log file. As files are copied, the Shell records their destinations in this log. If the installation involves any pre- or post-installation programs, they can also write to the log. When a user uninstalls a product, the installation log is read and all the files listed within it are removed.
For more information on logs, see Chapter 12 "Using Log Files."
The next chapter, Quick Start," shows you how these key concepts come into play when installing and configuring server software.
Previous Contents Index Next
Copyright (C) 2005 Red Hat, Inc. All rights reserved.
This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/
Last Updated September 21, 2001