JInstaller v1.2
by Marcello Balduccini (marcello.balduccini@gmail.com)



Introduction
JInstaller provides a framework for automated installation of programs. JInstaller-based installers usually come as Java Archives, which makes them easy to distribute.


Usage
Installers should extend class JInstall, which belongs to package jinstall. It is recommended to either unpack the JInstaller distribution in the directory of the installer, or to create a symbolic link from directory jinstall to the directory of the installer. The constructor of jinstall lets the programmer specify the full name of the package being installed, a prefix for temporary files, and whether the files to be installed are present locally, or have to be downloaded from the net (if they are present locally, they are assumed to be in subdirectory "DW").

All installation tasks should be queued by overriding method

              public void fillTasks(Vector t)

Vector t must be filled with the list of tasks to be executed. Each task is an instance of class InstallTask, suitably overriding method

              public void run()

When defining installation tasks, the following methods are accessible:

              protected void clearLog()
              protected void println(String s)
              protected void getFile(String web,String path,
                                     String fname,String destdir)
                        throws MalformedURLException,
                               IOException, Exception
              protected void setEnabledAll(boolean s)
              protected String getDestDir()
              protected String getPath(String f,String s)
              protected void abortTasks()
              protected boolean exec(String cmd,String dir,
                                     boolean verbose,boolean use_script)
                        throws Exception
              protected boolean exec(String cmd,String dir,boolean verbose)
                        throws Exception
              protected boolean exec(String cmd) throws Exception
              protected boolean exec(String cmd,String dir) throws Exception
              protected boolean exec_verbose(String cmd) throws Exception
              protected boolean exec_verbose(String cmd,String dir)
	                throws Exception
              protected void deleteRecursive(File f,boolean rmThis)
              protected void deleteRecursive(File f)
              protected static boolean parseArgs(String args[])

Subclasses of jinstall can override method

              protected String getConfirmMessage()

in order to display a confirmation message before installation starts. The default message is:

"The installation process is going to begin.

You most likely have to run this installer as root
in order to install the software out of your home directory.

Do you want to proceed ?"



Subclasses of jinstaller can be compiled and packed in a jar file by running

% jinstall/makejar-sub.sh <classname>

from the directory containing the subclass. The script creates a jar file called "<classname>.jar". If a file called "README" is present in the subclass directory, it will be included in the jar file.

Installers can be executed from any directory. After the installation process is over, the installer can be safely removed.

The installer can be run by typing:

% java -jar <classname>.jar


Requirements
jinstaller has been designed for Unix systems running Java 1.3. In order to check what version of Java you are running, you can type "java -version" at the command line prompt. The program has *not* been tested with Java 1.4.

jinstaller has been tested on NetBSD and Solaris. In principle, it should run on any Unix system with Java 1.3, a standard shell (sh), and the tar and gunzip commands.


Download
JInstall is distributed under the GNU Public License.
Click here to download JInstall. Unpack the file in the directory where your installer classes are going to reside.



Back to my Home Page

Updated:08/15/02
Author:Marcello Balduccini
e-mail:marcello.balduccini@gmail.com