Auto Updating

JExpress employs a simple, yet elegant, autoupdate feature. It insures your customers are using your latest technology without requiring them to maintain an extra background task. Although your customers may be eager for your latest version, they usually don't want to waste their resources nor complicate their operation just to stay up-to-date.

With JExpress, there's no API needed; no programming required; no background task to maintain. A simple selection in JExpress configures your web site and your customers' machines to manage updates seamlessly.

You can configure JExpress to check your web site, or a network drive, every time your customers start your Java program or only when they have time. When JExpress installs your app, it also configures your customers' machines to handle autoupdates. If you configured JExpress to check your web site every time your app starts, then the menu item used to launch your app actually starts the JExpress Updater which in turn loads your app after applying any updates. If you prefer only having customers update their system on demand, then JExpress adds an Update menu item which they can use whenever they'd like to verify they have the latest version.

The JExpress Updater quickly connects to your web server and compares cryptographically strong digests of all your app's files. This verification process can be very fast when all your customers' files are up-to-date. If your user only has a dial-up connection to the Internet, then if the user has their system configured to automatically connect whenever an online resource is needed, the auto update still works as expected.

If JExpress discovers any new or modified files, then it downloads only those files to a temporary directory. After all the updated files are on your customers' machine, then it copies the updates to the application directory. It removes any old files that were in the previous release and no longer included in this release. The Updater never removes files that weren't originally distributed by a JExpress installer, unless you customize the Updater to do so. If your web server is unavailable when JExpress Updater attempts connection, then it simply launches your app.

When your customer installs your app on a modern Windows machine (i.e, Windows 7, Windows 8, or Windows Vista) or Mac, then the auto-updater runs in 2 stages if your app was installed in a protected directory (e.g., Program files and Applications). The advantage to your users is that if your app doesn't need to be run as an administrator, then the updater can check your site to see if there are any new updates without requiring an administrator password. The end user only has to enter their admin password if there are updates so those updates can be written into the protected directory.

You can even enhance the Updater with custom classes. If you want existing customers to receive any updates to the Updater, then be sure to set the "Update JExpress Updater" checkbox on the Auto-update panel (only available in the Advanced interface of JExpress Builder). Whenever the Updater is updated, then the user must exit the Updater after it installs a new Updater and then restart your app.

Custom classes that are included "after list of updated files" to the Updater are only invoked if there are updates. In other words, if you include a custom class "After updater", it is only activated if the Updater gets any new or modified files.

If some of your customers still use dial-up connections to the Internet, then you may want to either create a custom class which increases the maximum time to download a file or inform them how to do this manually. Look for the MaxMinsToDownloadFile method for more details.

Important: The JExpress Updater does not support updates for multiple target directories installers. If you are updating a multi-installer or multiple component installation, you will need to add a custom class to the Updater so it restricts which classes will be updated based on the component(s) or installed type(s) installed. Or, alternatively, you could write a custom class which sets each Updater to use a unique URL based on the component/install type name and then upload the updated files to the matching URL.

Secure Updates

Your customers can connect to your server using an SSL/TLS connection, if the JVM that your product requires is Java 1.5 or later. Additionally, you must have a certificate that is recognized by a well known authority and popular browsers. If you'd like to use a self-signed certificate, then you would need to purchase an Updater or All source license and modify 1 line in the code and recreate the updater. Our engineers will be happy to tell you which line.

Password Protected Updates

You can store your updates in a password protected web directory if your web server supports this type of restriction. You'll simply need to send each of your users that you want to receive updates a plain text file called update.control with their name and password. Your customers simply place this file in their application's JExpress subdirectory.

The update.control file must contain the 2 AV pairs for the userName and password (case is important). For example, if a valid user id is joe and the matching password is secret, then the update.control file would look like:

            userName=joe
            password=secret
            

You can have as many unique user names and passwords as your web server supports.

If you would like to configure the user's system during the install process to authenticate the user when the Updater operates, then you can adapt the AuthenticateUpdatePanel.java in the Samples subdirectory.

Proxy Server

If you want to get updates for JExpress through a proxy server, click here.

If your customers are using a proxy server to connect to the Internet, they must change the menu/script to start the updater or your app. They should add the following switches before the -cp switch:

-DproxySet\=true -DproxyHost\=[proxy_host] -DproxyPort\=[proxy_port]
example: -DproxySet\=true -DproxyHost\=myhost.com -DproxyPort\=1234

(replace [proxy_host] and [proxy_port] with the information for your configuration). Also, note that characters such as equals signs, back slashes, and colons must be escaped if those characters are in the value (i.e., right of the equal sign that separates the AV pair).

If the updater was installed on a Windows machine, then the settings to start the updater are probably in a .properties file in the JExpress subdirectory of the application's installation directory. For example, customers using JExpress on Windows will find the settings to launch the updater in UpdateJExpress.properties.

If the updater was installed on a Unix machine, then the launch script is in the application's installation directory and is called update. On a Mac OS machine, the updater is called update.command.

If the proxy server requires a user id and password, then you need to add the following 2 properties to the update.control file that's located in the JExpress subdirectory of the application's directory:

proxyUserName=
proxyPassword=

 

Proxy Server with JExpress

If you use a proxy server when you connect to DeNova's site for updates of JExpress, then you'll need to modify the update.control file that's located in the JExpress subdirectory of the JExpress's install directory. Add the following 2 properties:

proxyHost=
proxyPort=

If the proxy server also uses an id and password, then add the proxyUserName and proxyPassword AV pairs.

 

Large updates over slow connections

If you have individual files that are very large (e.g., over 3-4 meg per file) and your customers use dial-up connections to reach the web server with the updates, then you should consider adding the following setting to the update.control.

maxMinsToDownloadFile=

This is the maximum number of minutes you expect any single file to take to download.

Silent Updates

If you'd like the updater to run silently, then add a -q switch in the command directly after the Updater's main classname and before any other command line parameters. For example, if it's an update on-demand, then the command would look like this:

java -jar JExpress/JExpressUpdater.jar -q
An example of a silent auto-update, could look like this:
java -jar JExpress/JExpressUpdater.jar -q Hello