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. If your web server is unavailable when JExpress Updater attempts connection, then it simply launches your app.
If you modify the Updater, by adding new custom classes or using an updated version of JExpress, then your customers' Updater will be updated along with your app. If you have created an autoupdater, then the user must exit the Updater after it installs a new Updater and then restart your app.
If for some reason your customers still typically 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 only updates menu items that are "java commands". In other words, the "executable file" in the menu dialog box must be a Java class file. It cannot update Java apps launched through batch files or other methods.
Additionally, the 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.
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're using a proxy server to connect to the Internet, then you will need to change the shortcut to reference the server. If you're using the JRE with the proxy server, then add the following switches before the -cp switch:
(replace [proxy_host] and [proxy_port] with the information for your configuration).
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:
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.
This is the maximum number of minutes you expect any single file to take to download.
Copyright © 1997-2008 DeNova. All rights reserved worldwide.
Privacy policy
Legal notices