One goal of Jar Ajar is to serve as a double-click solution for Java application deployment. Jar Ajar started out as a self-extractor, but it has gradually expanded to cover post-install launching and now repeated launching of applications.
The self-extractor was built on the premise that users of your Java programs would have a Java environment already installed. Users could run the Java-based self-extractor to unzip your program packages, without need for any zip utilities, which weren't widely available when Jar Ajar was first released. Jar Ajar became more of an installer when we added a license page and a post-install page that could launch the program.
One remaining barrier was how the user would launch the program again, after exiting the Jar Ajar installation. Most installers create shortcuts, but they are usually platform-specific, and users are often particular about where shortcuts are placed. The solution being introduced in Jar Ajar 0.5.0 allows users to launch your program by double-clicking the same installer package. The Jar Ajar file identifies where it installed your program and runs its launch command. The JAR package can be moved anywhere on the same platform and still launch the program since the installation is stored in the Java user preferences tree.
Packaging your application is similar with the new launcher as previously. Jar Ajar 0.3 introduced a graphical packager for adding a welcome message, logo, and of course your zipped application. Tool tips give brief summaries of what to add, and a sidebar offers more details and examples about designing your package.
Currently the packager has two panels, one required ("Gottas") and one optional ("Extras"). All the fields in the Gottas tab must be filled, while the Extras tab allows you to add additional installation information, such as license and readme file locations and a post-install launch command.
The only additional packaging parameter for 0.5.0 is a required version string. The self-extractor will use the name and version string to store the installation information.
During extraction, Jar Ajar will store installation information in the Java user preferences tree, part of any Java environment, without touching any system or Windows registries. Installation information is saved under the nodal structure: SelfExtractor > Installations > Name > Version, where the Name and Version strings are set in the corresponding packager fields.
When the user first launches the JAR file, Jar Ajar takes the user through the installation process and concludes by asking whether the user wants to launch the file and read the readme before exiting Jar Ajar. When the user launches the JAR file again, Jar Ajar checks whether a node is found for the packaged application. If so, Jar Ajar attempts to locate the installed files and prompts the user on whether to launch the program or view the readme. Jar Ajar also gives the user to launch the program automatically in the future, without displaying the prompt.
What happens if you install a program using Jar Ajar, choose to launch it without prompting, but then want to re-install the application? There are two ways to reset an installation:
Delete the installed files. Usually this just means deleting a directory containing all the installed files.*
Run the installer with the "--reset" parameter. This means launching the JAR file from the command line followed by the flag, such as, "java -jar MyApp.jar --reset".
The installation information in the Java preferences tree won't be deleted until a new installation overwrites them, so you can always return to your installed state by canceling the installer prior to file extraction.
The new installer+launcher system will hopefully simplify application deployment down to a double-click operation. The preferences storage also allows for the identification of other applications installed through Jar Ajar, paving the way for separate plugin deployment directly into application installation directories.
Jar Ajar actually checks for just the first installed file, so it should be possible to reset an installation simply by deleting this file, but identifying that file is probably more of a pain than it's worth.