Installing from CD-ROMs
A common scenario is the installation of Java code from a CD-ROM physically delivered to
end-users. Despite that, a variety of standard tools exist for this popular case; sometimes, vari-
ous particular constraints don't allow for their use. In this example, we will see a simple imple-
mentation of a general-purpose installer utility.
Our CD-ROM Java installer features the basic one-shot installation service.
How It Works
The installation process sequence is the following:
1. A native executable is launched, either from a user's command or automatically. In our
example, an automatically launched Windows script would start the installation when the
CD-ROM is inserted into the CD reader.
2. The native executable launches our Java installer using a JRE on the CD-ROM. We
assume that there is always room for such an auxiliary JRE on our installation CD-ROM.
Note that we don't assume any JRE pre-installed on the client computer.
3. Our Java application works as a normal installer following the instructions contained in a
given configuration file stored on the CD-ROM. By changing this file and modifying the
proposed code it is possible to customize this example to handle a wide range of ad-hoc
In Figure 7.2, there is a screenshot from our installer at work.
F IGURE 7.2
The Installer application initial dialog box.
Users can decide the installation type among three choices: minimal, typical, and custom. The
latter choice will prompt the user with the customization dialog box shown in Figure 7.3.