Java Reference
In-Depth Information
4.
Lastly, when the installer has finished, the application (class
App.java
contained in the
app.jar
file) is executed, using items contained in the resources our installer down-
loaded.
Preparation
For this example, we have two JNLP files and two Java classes plus some JAR files.
First, we examine the main JNLP file,
app.jnlp,
shown in Listing 8.7. It declares in lines
18-21 that it needs four JAR resources (namely, the files
app.jar
,
first.jar
,
second.jar
,
third.jar
), plus a custom installer (described in the other JNLP) named
splash.jnlp
(lines
14-17 in Listing 8.7).
L
ISTING
8.7
The
app.jnlp
File
<?xml version=”1.0” encoding=”utf-8”?>
<jnlp spec=”1.0+”
codebase=”http://server/b2/c8/splash/”>
<information>
<title>A User-Friendly App</title>
<vendor>Mauro Inc.</vendor>
<homepage href=”home.html”/>
<description>Install Your programs via the Web, quickly and
effectively!</description>
<description kind=”short”>An example of a simple Java-launched
Installator</description>
<offline-allowed/>
</information>
<resources>
<j2se version=”1.3+”/>
<extension
name=”Splash Window”
href=”splash.jnlp”>
</extension>
<jar href=”app.jar”/>
<jar href=”first.jar”/>
<jar href=”second.jar”/>
<jar href=”third.jar”/>
</resources>
<application-desc/>
</jnlp>
The
splash.jnlp
file is interestingly new. It is called an
extension descriptor
(line 16 in
Listing 8.8), in that it doesn't describe an application—like
app.jnlp
—rather, it describes an
extension
to that application—in this case, a custom installer. We will see these type of JNLP