|
|
|---|
ASTA Http Upgrade Example |
|
|
This is all easy to do and takes no code, but the result is, for servers that support many users, that the ASTA database server gets occupied in streaming down 1+MB client EXE's when new releases are made available. There is a tutorial on the standard ASTA autoupgrade tecnnique that includes a word document detail the process. A better solution is to make upgrades available from an http server and the ASTA server merely sends down the location of the new version to the remote ASTA client who then download that version from a WebServer rather than the ASTA server, freeing up bandwidth of the ASTA server to server database clients. This demo is available with full source code and includes an ASTA Server, Client and even a compiled client exe on the ASTA web site that can be used for testing. Server Side The example ASTA Server codes the AstaServerSocket.OnAstaClientUpgradeDecide event. In the normal ASTA upgrade process, the location of the client EXE on the server is stored in the registry. Instead of doing that, this technique sets the Var AllowUpgrade:Boolean to false to bypass the normal ASTA update process and then sends a CodedParamList back to the remote client that contains the Host where the new Version resides and the file location.
Client Side On the client side, the client needs to login to the server of course as the login process is what triggers the events on the server to send back upgrade information. Make sure the AstaClientSocket.AutoLoginDlg is set to anything other than ltNoChallenge. The client must code the AstaClientSocket.OnCodedParamList to respond to an upgrade message from the server.
This triggers the call to GetUpdate which calls UpgradeHttpDownload which is included with full source in the tutorial zip file. It uses the plain Borland TClienetSocket with a blocking call to grab the file from a remote http server. After the file is download, a batch file must be executed to stop the current application, rename the streamed file to the current application's EXE name and relaunch it. The full source for BatchFileForUpdate is included in the tutorial. The ultimate solution is to combine this technique with some Binary Patch Technology like the ASTA BinaryPatcher. This allows for Delta Patches to be created and applied with small console EXE so that only the changes are sent down to client applications. Zero Administration is an important design goal for ASTA clients and by using these techniques, remote ASTA clients, can always be assured to have the absolute most current version fo their applications available. These same concepts are available on all ASTA clients including Palm and Wince Clients.
|
|
|
|
|
Asta Technology Group, Inc. |
|