Install Wizard Architecture

The com.sun.install* package set is built on top of the WebStart Wizard API. That is, install wizards have exactly the same architecture as WebStart wizards. This document will describe in some detail the architecture of the install-specific classes.

The Product Tree
The product tree is a set of objects used to describe a specific product. This product description consists of content as well as behavior. The product tree is responsible for the installation and removal of software. The product tree is tied in to the wizard through the use of a ProductTask Task object that is added to the install Sequence.

A product is a set of components. For example, a simple product may have two components: Software and Documentation. The Software component might consist of one or more files (ignoring for the moment the install mechanism for the content of the component) that comprise the portion of the product that the user would execute. The Documentation component might consist of one or more files that comprise the information describing the product and its operation. It is conceivable that the user of this installer might want the Software and Documentation components installed, only the Software component installed, or only the Documentation component installed.

The product tree for this simple product must be able to express the arrangement of the files comprising the Software component as a single element of install. The leaves of the product tree are responsible for software installation and removal. The nodes (non-leaf objects) within the tree provide a structure to the product tree that describes the components within the product.

A product tree that describes the simple product example outlined above could be constructed in the following way:

Graphic of a simple product tree.

The leaves of the product tree are responsible for installing and removing files. The objects representing the leaves of the product trees are called Units. The specific Unit class used must correspond to the install mechanism that will be used to lay down the bits.

For example, the correct mechanism to install bits on the Solaris operating system is the command pkgadd. Within the com.sun.install.products package, there is a PkgUnit class that performs a pkgadd command to install software from an SVR4 package, and performs a pkgrm command to remove the software at uninstall time.

On operating systems that do not use SVR4 packages (for example, Microsoft Windows), files are simply moved onto the file system and registered in the Registry. FileUnit is the class that handles this sort of installation.

Dependencies Within the Product Tree
As described in the previous section, nodes within the product tree are used to group Unit objects into components. Nodes can also be used to omit product components from the installation.

A product that supports more than one platform may have components or files within a specific component that should not be installed on all platforms. For example, a product supporting the Solaris operating system both for the Sparc and Intel platforms should not install the Sparc-specific files or components if the installer is running on an Intel platform. This is an example of a dependency within the product tree. Parts of this example product tree depend on the platform on which the installer is executed.

PlatformDependency is a subclass of InstallNode that only allows its child components or leaves to be installed if a platform condition is met. This platform condition is specified within the wizard builder that creates the install archive.

The simple example presented earlier will be expanded on to demonstrate the use of the PlatformDependency class. The product being installed works on both Solaris Sparc and Solaris Intel platforms. This dual platform support is achieved through a duplication of binary files. One set of binary files works on Solaris Sparc; the other set works on Solaris Intel. There are two ways in which this dependency could be expressed within the product tree.

The first expression of the platform dependency example assumes that the binaries that are platform-specific comprise the set of files within the Software component. In this case, we might create two components which install the Software binaries, as shown in the following diagram:

Graphic of a simple product tree with dependencies.

The second expression of the platform dependency example considers that there may be some unneccessary duplication between the Software component for Solaris-Sparc and the Software component for Solaris-Intel. This duplication may include configuration files, images, audio clips, or other files that work on both platforms. The executables and shared libraries are the parts of the Software component that the dependency should affect. This will result in only one Software component that consists of leaves for the specific platforms, and a common unit with contents that work on both platforms. Following is a diagram that demonstrates this strategy.

Graphic of a simple product tree with dependencies.

The platform dependency is only one example in which sections of the product tree should be omitted. Other dependencies are possible. Dependency classes can be created to key off almost any attribute of the runtime environment by subclassing InstallNode and overriding the updateDependency method.

Install Client Tree
The install client tree defines the set of panels the user experiences during a product installation. Though the developer of an install wizard is free to define any client tree with the Web Start SDK, developers are encouraged to use the client tree designed with the SDK.

The install client tree described in this section is the one demonstrated in the SampleBuilder. This client tree makes installation easier by not requiring the user to enter any information if the default settings are acceptable. This suits the needs of novice users, by not requiring them to manipulate (or even see) every setting in order to install the software. For the advanced user, the install client tree presents additional panels to allow the user more control over the installation.

The install client tree consists of an ordered arrangement of nodes and panels that are designed to guide the user through a product installation.

The following diagram depicts the install client tree:

Graphic of install client tree.

In this diagram, the rectangles depict nodes, subclassed from WizardComposite, and the ovals depict the panels, subclassed from WizardLeaf

The nodes within the client tree are not displayed. They are present to express navigation behavior. Each panel and node within the tree can choose to be visible or invisible, based on the return value of the skip method. If a panel's skip method returns true, that panel is not displayed. If a node's skip method returns true, that node's child panels is not displayed. In this way, a wizard can provide "extra" panels that novice users will not see.

The WelcomePanel within the install client tree is the first panel displayed within the wizard. This panel's purpose is to indicate the purpose of the wizard and set the expectations of the user. The WelcomePanel displays a brief message indicating what product will be installed by this wizard. This allows the user to verify that the correct wizard was executed. This panel is for display only. No information is collected from the user or set into the WizardState object during its execution. The user has the opportunity to exit during the WelcomePanel.

The GroupedInstallTypePanel is provided to allow the user to select a "Typical" installation or a "Custom" installation. If the user selects a Typical installation, the wizard will not display panels that query the user for customizations. Instead, default values will be used. The user has the option to go back to this panel and select Custom if they find a need to customize some aspect of the installation. If the user selects a Custom installation, more panels will be displayed to the user prompting for information such as the install location and the specific product components the user wishes to install. The GroupedInstallTypePanel sets a value in the WizardState object that indicates the user's selection. This selection may be read by either client object or server objects.

The SkipNode labeled "custom" displays its child panels only if the Custom button was selected on the GroupedInstallTypePanel . This is accomplished by overriding the skip method, which looks at a value within the WizardState object to determine whether or not to skip its children. Within the install builder, this SkipNode object is wired to the same value as the GroupedInstallTypePanel.

The DirectorySelectionPanel Is only displayed during a Custom installation. This panel enables the user to change the location in which the software will be installed. The default install location is displayed in a java.awt.TextField object. When the user presses the Next button at the bottom of the wizard frame, the location within the TextField object is saved in the WizardState.

The ComponentPanel is only displayed during a Custom installation. This panel enables the user to select which component(s) of the product will be installed. The components are displayed as java.awt.Checkbox objects. The default components will be on when the panel first displays. The user can modify the list of components to install by selecting or deselecting the Checkbox associated with each product component. When the Next button at the bottom of the wizard frame is pressed, the list of selected components is saved in the WizardState.

The VerifyPanel performs disk space checking and allows the user to view the install settings before the installation proceeds. If not enough disk space was found, the user is notified on this panel. The VerifyPanel is the last panel from which the user can go back to make corrections to the install settings before installation. Once the user presses the Install Now button, the installation proceeds.

The WizardComposite labeled "preinstall" is used to present panels specific to the preinstallation of the product or its components. This node is optional, and should only be included if your product has a panel to display prior to installation. One possible use of this preinstall node is to support a panel that uses a task to perform checking before the product is installed. For example if the product is a web server and a different webserver is already installed and running on the system, a child panel of the preinstall node could warn the user and give them the option to install anyway, or to skip the installation of the webserver.

The ProgressPanel displays install progress to the user. When this panel is displayed, it initiates a Sequence that installs the product. The install sequence contains a ProductTask that sends a message to the Product Tree to install the product. When the product installation is complete, the next panel in the install client tree is displayed automatically.

WizardComposite labeled "postinstall" is used to present panels specific to the postinstallation of the product or its components. This node is optional, and should only be included if your product has a panel to display after installation. One possible use of this postinstall node is initial product configuration. For example, if the product being installed is a webserver, this panel might be used to enable the user to select the default port number.

The SummaryPanel is used to indicate installation status to the user. The SummaryPanel indicates "Installed" if the product installation was successful. If the installation failed, this panel will indicate "Failed." Log information describing the nature of the failure is accessable from this panel.

Install Hierarchy
The install client tree shown in the previous section works well for a single product installation. This tree does not address multiple product installation. Use an install hierarchy for this purpose.

The install hierarchy is a set of install wizards that are designed to work together to install more than one product. The user will execute the topmost wizard. The lower-level product wizards will have some of their panels displayed in the upper-level wizard's frame.

The construction of the install hierarchy mirrors that of software development. In software development a team of engineers is responsible for the creation of a suite of software to be released on a compact disk (CD). That team of engineers is usually broken into groups. Each group within the team is responsible for a single product within the suite. Similarly, each group within the team would create a product install wizard that is responsible for installing their piece. The CD is usually created by a release engineer who interacts with each of the groups to get their installable bits. Among those bits is the installer for those bits. There would be an install wizard for each product on the CD. The release engineer would create a CD-level install wizard that connects all of the product-level install wizards into a single user experience.

The CD-level install wizard has an install client tree similar to that of the product-level install wizards discussed in the previous section.

Graphic of CD-level install client tree.

The WelcomePanel, GroupedInstallTypePanel, VerifyPanel, and SummaryPanel are the same panels as in the single product install wizard discussed in the previous section. The only difference is that the VeryfyPanel and SummaryPanel will report all of the products selected for installation, rather than just a single product.

The ProductPanel presents the user with a list of products that can be installed using this CD-level wizard. The list contains the name of the product followed by three radio buttons. With the radio buttons, the user can choose not to install that product, to perform a "Typical" installation of that product, or to perform a "Custom" installation of that product.

The CustomNode is different than the one used within the product install client tree. The CustomNode reads the custom subtrees from the product-level install wizards. This is only done for each product selected for a "Custom" installation within the ProductPanel. The effect is that custom panels from the product-level install wizards will follow the display of the ProductPanel. After all of the products selected for Custom installation have had their custom panels displayed, the VerifyPanel is shown.

The nodes labeled "preinstall", "install", and "postinstall" are of class HierarchyNode. The HierarchyNode reads and displays the subtree of the same name from all child wizards that have been selected. For example, the HierarchyNode labeled install will read the subtree rooted by a noded named install from each selected child wizard. This has the effect of displaying the product-level ProgressPanel within the CD-level installer.


Last modified: Fri Oct 23 13:59:16 PDT