www.astatech.com Manual Central ASTA Users Guide Automatic Client Updates





Asta Technology Group
Welcome to the world of wireless enabled web services
advanced search
ASTA in 60 seconds
ASTA in action
Developer details
Free Internet tools
Demos
Business views
White papers
Tutorial center
Testimonials
Asta online help
ASTA Users Guide

Automatic Client Updates

Key Client Server
Properties AstaClientSocket: ApplicationName, ApplicationVersion  
Methods   AstaServerSocket: RegisterClientAutoUpdate
Events   AstaServerSocket: OnAstaClientUpdate

ASTA provides you with the ability to automatically update AstaClients. Starting with ASTA v 1.91, if you have distributed 50 copies of an AstaClient as version 1.0, you can automatically update them by registering a later AstaClient version, say 1.1 or 2.0, at the server. When a user of version 1.0 logins into the server, he or she will be automatically updated to the latest version of your software. The following narrative describes how you can add AutoUpdate features to your ASTA projects.

When you create an AstaClient program, simply fill in the AstaClientSocket.ApplicationName and ApplicationVersion properties. For our example, lets call the our AstaClient program "MyClient" and assign "1.0" to the ApplicationVersion property and "MyClient" to the ApplicationName property.

Now you can distribute the application, confident that you can update it with ease.

When you have a new version of your software, you simply supply a later version number. If your first release went out as version 1.0, make your update 1.1 or 2.0.

After you compile the program, take the resulting executable file and copy it to the server. If your executable is MyClient.exe, you might want to call it MyClient11.exe so that you can differentiate it from future releases.

At the server, you simply need to call one method to register your new file. In the example below, I have added a TMenu to my AstaServer and I use a "Register Update Client" menu option to call RegisterClientAutoUpdate.

procedure TForm1.RegisterUpdateClient1Click(Sender: TObject);
begin
  AstaServerSocket1.RegisterClientAutoUpdate;
end;

At run time, you can simply register your new executable in the dialog box picture below.

When In this dialog, which allows you to register your new executable at the server, you must supply the ApplicatonName and the ApplicationVersion property values that you have assigned to the AstaClientSocket object in your project.

In this example, we supply: MyClient and 1.1

The "Pick the path to the new client executable" button allows you to specify the phyiscal file that you would like to distribute. In this example, I renamed my file from MyClient.exe to MyClient11.exe so that I can tell that it represents my 1.1 version. It is in the D:\Output directory at the server.

Click OK to close the dialog.

That's all that you need to do. If a user logs into the server using a version prior to 1.1, they will automatically get updated to verion 1.1. At the client side, the original program will get named xxxxxxx.exe.old and the new program will be named xxxxxx.exe. That will preserve any shortcuts or conventions that have been setup at the client side. In our example, the client will have two files after the update, MyClient.exe.old and MyClient.exe. The former will represent the 1.0 release and the latter will reprsent the new release. The "history" trail is only one file deep. So if you release 2.0, then the 1.1 release would become MyClient.exe.old and the 2.0 release would become MyClient.exe.

When the client logs in, a dialog box with a progress bar pops up. It informs them about the need for an update and then the progress bar tracks the status of the update.

If you wish to write a log or record the updates to a database, the AstaServerSocket provides an OnAstaClientUpdate event handler that allows you to record the UserName, ApplicationName and version numbers involved in the Update process:

procedure TForm1.AstaServerSocket1AstaClientUpdate(Sender: TObject;
   UserName, AppName, OldVer, NewVer: String);

It should be noted a one megabyte file takes about five minutes to update on a 28.8Kbps modem connection. It will only take about 5 or 10 seconds on a LAN. Internally, we use a product called "Shrinker" to compress our executables by about 40% - 50% and thereby speed up the update process.

Download a Delphi version of an AutoUpdate Tutorial.

Special Notes: Be certain that you do not confuse your files. If you wish to update the 1.0 version with the 2.0 version, then be certain that the 2.0 version is the executable that you register at the server. If you accidentally register the 1.0 version, you will cause an infinite update loop!

 

Last modified: 5/5/2002 7:32:24 AM
Copyright © 2001-2002 Asta Technology Group, Inc. Terms & Conditions     Privacy Policy     Site Map