stableUpdate is a tool for creation, detection, downloading, installation and removing of the service packs

stableUpdate is a tool for advanced user who wants to know, which part of the application will by touched by the newly released update, accept the decission about necessity to install the update and, if needed, be able to remove the previously installed update. It is written is java and is supposed to be called from inside java application. From a server stableUpdate only needs possibility to download files via http. The only file that must keep its location is a short xml document. Changing this document, you can easily manage the list of secondary servers that provide the actual update files. It also holds release notes and mini announcement desk. In older versions you needed write this file manually. Since 1.0.2 stableUpdate will generate (or update) it for you, and you only need to upload it to one or better servaral primary servers. If you want, you can still look at the commented example of this file.

In stableUpdate, the updates are stored in .jar files. Each such update upgrades between the two versions. The version names need not match exactly your official versions. For example, you may officially release 1.1 and 1.2, but 1.1 can have subsequent updates from 1.1.1 to 1.1.2, then to 1.1.3 and so on. The update .jar file contains the changed single files and the changed entries of .jar and .zip archives. Since stableUpdate 1.0.3 the size and checksum of this .jar are verified after download.

If needed, the updates can be uninstalled in reverse order as they were installed. The user may need to uninstall the update if one discovers that some needed feature is actually working worse (or not working at all) in a newer version. The "uninstall" feature is available since the stableUpdate 1.0.1.

The version number is stored in the root folder of the content being updated, in the second line of the file aupVersion.txt, for example:

/** This file is required for installation of subsequent updates. Please do not edit. */

The update is generated by comparing two folders, one containing the old installation and another the new installation. The generator is invoked as the main default class of autoupdater.jar (type java -jar autoupdater.jar) and has some very simple user interface. The created .jar archive consists of changed individual files, changed files in .jar or .zip archives and deleting instructions, used to remove files present in the old, but absent in the updated version. *.bat, *.sh, Log/*, Cache/* , autooutdate/* (the folder for uninstall information) and jre/* will be ignored. .bat and .sh files usually contain installation specific information, and java virtual machine cannot be updated while running.

Some agreements about the file locations must be followed. The autoupdate.jar must be stored in the subfolder bin/ of the application being updated. It must be invoked from the class, loaded from another .jar archive, also present in this folder:

Your application must have at least one .jar archive in this folder, containing the class org.gnu.amSpacks.user.Update (present in the source of the distribution) or equivalent. This class will find and call autoupdate.jar. When the update process proceeds till installation, the current application is closed and the current jre is restarted with autoupdate.jar as the application file. After this restart other files in your application folder are not locked by java runtime environment and can be updated. The URL's, needed to get download information, are currently hard-coded inside this class:

package org.gnu.amSpacks.user;

import (...)

/** This class must be present as part of your package in the folder /bin, 
 *  same folder where autoupdate.jar must be placed. */

public class Update {

  /** main demonstrates how to start the update. */
  public static void main(String[] args) {
    try {

      Update autoupdater = new Update();

      URL[] servers =
          new URL[] {
          /** The locations, where the main configuration file can be found. */
          new URL(""),
          new URL(""),
          new URL("")
    catch (MalformedURLException ex) {
      assert false:"Should never happen.";

  /* The rest of the code does not require your attention  */

stableUpdate was developed as part of the Sight Web agent generator project. However it is rather independent module, and we decided to release it separately. Sight uses many GPL licensed libraries that are not required by stableUpdate. Because of that, it is possible to release stableUpdate under LGPL license. The future of this program depends on how pupular it will become.

The development of stableUpdate have just started. It is possible to turn in many work direction. You can help us to choose the right way by checking boxes in this web form.

Audrius Meskauskas Logo