Java Reference
In-Depth Information
Once we obtained the access on the client hard disk we will save the needed files and launch
the “real” slimmed-down applet. In order to fool the applet container, we can use a custom
classloader, as discussed in the previous chapter. This way, we can implement a “mixed-mode”
deployment solution that will take advantage of the best of both worlds—applets and locally
cached applications—in a fully transparent way. A number of enhancements are possible, such
as some mechanism for detecting newer versions, for example (forcing to reload the local
cache) or directly executing the application once installed, etc.
We are interested in showing a simple usage of the Plug-In utility, so we will not get into such
details. Our basic installer applet is shown in Listing 7.6.
In the provided example pack for the applet installer package, the JRE installation file
is omitted to save download time. In order to download the Plug-In in this example,
be sure to put a JRE installation executable file for Windows substituting the fake
j2re-1_3_1-win.exe “ file. You can use the same file as the CDLauncher example or,
if you haven't already done so, you can download it from
j2se/ . If the Plug-In is already installed on your computer, you can skip the file substi-
tution and run the example.
In order to run this example you should unzip the example pack in a directory installed on your
Web server, likewise all other examples in this topic that require a Web server support, and
open up a Web browser pointing to the following address:
http://server/b2/c7/installer.html ” (If your Web server address and directory structure
are different than the one used in the example you will need to modify accordingly the sup-
plied installer.html page).
L ISTING 7.6 The InstallerApplet Class
package com.marinilli.b2.c7.installerapplet;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;
import java.util.*;
Search WWH ::

Custom Search