Use this constructor for an application based on the AWT UI that does not
need a proxy server to download the update information or use the previous
constructor and pass null for the proxy_server.
public AlwaysUptodate( Frame parent_frame, String application_name,
String version_file_URL, String current_version, String base_dir,
String update_dir )
Use this constructor for an application based on the Swing UI that needs a
proxy server to download the update information.
public AlwaysUptodate( Frame parent_frame, String application_name,
String version_file_URL, String current_version, String base_dir,
String update_dir, String proxy_server, String port, String user_id,
String password )
Use this constructor for an application based on AWT graphics that does not
need a proxy server to download the update information or use the previous
constructor and pass null for the proxy_server.
public AlwaysUptodate( Frame parent_frame, String application_name,
String version_file_URL, String current_version, String base_dir,
String update_dir )
The parameters to the AlwaysUptodate() constructors are defined as:
To check to see if the application was updated, use the getUpdatePerformed()
method. This method will return false if there was no need to update, the
update was refused by the user or an error occurred while updating. Otherwise,
this method will return true.
public boolean getUpdatePerformed()
To check to see if an error occurred while updating, use the
getErrorOccurred() method. Always Uptodate displays its own error dialogs, so
you do not need to worry about that.
public boolean getErrorOccurred()
To check to see if there was an update available, but the user chose not to
update the application, use the getUpdateRefused() method.
public boolean getUpdateRefused()
If an update occurred (getUpdatePerformed() returns true), you can get the
new version number by using the getNewVersion() method.
public String getNewVersion()
It is highly recommended that you force the application to be restarted after an update since changes to classes may cause program instability since most Java virtual machines load classes on an as-needed basis. Updating a running application is completely safe except for a couple of potential problems that can easily be avoided (see Additional Notes below).
If you prefer not to embed Always Uptodate directly into your application, you can create a separate Java application to do the updating for you. It is recommended that you create some kind of mechanism to prevent a user from updating the application if it is already running.
If you prefer a hands-on approach, take a look at our AWT and Swing examples to see how easy it is to use Always Uptodate in your Java applications. We include all of the files from our website that are used to configure Always Uptodate.
The Versions File resides on your website and serves only to show the
different versions of your application. The only real limitation of the
version numbers is that they have to be of increasing value when evaluated as
a Java "String" type. For example: 1.00.00 followed by 1.00.00a followed by
1.00.01 is a valid set of increasing version numbers. Note that in the
Versions File, the versions are listed in order from most recent to
least recent. So, you will add new versions to the top of the file causing
the versions to be in decreasing order in the Versions File. This file
is designed to be very small since it is the file that will be downloaded
from your web site each time a check is made for a new version. If there is
no new version available, the application will know in just a few seconds.
The Versions File should contain nothing but version numbers. Each
version number should appear on its own line. Do not include comments or
anything else in the Versions File. View a sample Versions File
here.
The Release Notes files allow you to tell your users what modifications
have been made in each release of your software. There is one Release
Notes file for each version you release. The Release Notes file
must be named "version_number".relnotes (e.g. 1.00.relnotes) and must match a
version number from the Versions File. There is no need to provide a
Release Notes file for the very first version of the application.
The Release Notes files must be located in the same directory as the
Versions File. Do not place any comments or anything else in your
Release Notes files that you do not want your users to see when a new
update is available. Hint: We recommend that you use spaces in your release
notes instead of tabs since the tabs may be displayed differently on different
platforms. View a sample Release Notes file
here.
The Affected Files files define which files need to be updated to
upgrade the application from the previous version to the new version.
These files have a strict format that must be followed in order to work
properly. For each file that needs to be updated, there are three elements:
the File Name, the File URL and the File Destination.
The File Name is the name of the file only (no path information). The
File URL is where the file can be downloaded from. This is a complete
URL with full path and file name. The file name in the URL does not have to
match the File Name. The File Destination is a relative path
to the file's final location once installed. The path is always relative to
the base_dir passed in when the AlwaysUptodate object was created. Comments
can be added to the Affected Files files using a "#" in the first
character of a line. There is no need to provide an Affected Files
file for the very first version of the application. The Affected Files
file must be named "version_number".files (e.g. 1.00.files) and must be
located in the same directory as the Versions File. View a sample
Affected Files file here.
The files to be updated can basically be located anywhere you want on your
website (or anywhere on the net). The Affected Files file designates
the URLs to download the files from. We highly recommend that you maintain
complete control of the all of files needed for Always Uptodate by keeping
them on your own web site where you can be sure that the files have not been
modified by any other party. Always Uptodate is as safe and secure as you
make your web site.
Once you have created and installed the files for Always Uptodate, you need
only pass the URL of your Versions File to the AlwaysUptodate object to
begin checking for updates.Configuing Always Uptodate
The configuration of Always Uptodate on the web server consists 4 parts: the
Versions File, the Release Notes files, the Affected Files
files and the files to be updated.