Write the Update Script

An update script is a simple text file containing the commands needed to allow the Software Update Wizard to determine whether an update is required, its location, any messages you would like to display to the user or processes you would like to launch either before or after the update etc..

The script resides on your web server.  The Software Update Wizard downloads and parses it in response to a WebUpdate() call from your application.

This page contains a simple, basic script.  There is a lot more flexibility and customisation that you can build in to a script.  The developer help file contains numerous examples of basic and advanced scripts as well as descriptions and examples of all the keywords you can use.

Example script

Line 1 is the script 'section number'.  Each script must start with a section number, which can contain any integer value.  If you have no other basis for determining whether an update is required you can simply use an incrementing 'section number' and omit lines 2 and 4.  The Software Update Wizard will then update if the last run 'section number' is less than the 'section number' in the script.

You can have multiple 'sections' in a script, separated by a single empty line, though for simplicity we only have one here.  You can also update multiple files within a section using the 'AdditionalFiles' keyword, or download all the files in a zip, which the Software Update Wizard with unzip for you.

An update script section must start with a 'section number', but the subsequent lines in the section can appear in any order, providing there are no blank lines.  (A comment line starts with a ';' character.)

Line 2 is required to ensure that the rest of the script is parsed each time.

Line 3 tells the Software Update Wizard the location of your update file on the web server.

Line 4 tells the Software Update Wizard the version number of the new version.  If the version on the user's PC is older than this then an update is required.  There are other keywords available which let you make the update contingent on the datestamp, version number of one or more other files etc..

Line 5 posts a message box like this, to inform the user of the new version:

A message box advising the user of the update

Line 6 makes the update optional to the user.  The update can be made compulsory or optional, and if optional, you can allow the user to set the date they are next prompted to update.  You can also change the graduated title, its text and icon, and the graphic left-side on the dialog.  You can also remove various elements.  The main message area is a web browser control, so you can use any valid html text or even provide the url of a web page that will appear in that area.

Line 7 causes all matching instances of MyApp.exe which are running to close, in order for the update to be made (because Windows cannot replace in-use files).  A WM_CLOSE message is sent to each matching instance.  If the instance does not close within a customisable timeout period then it is forcibly closed.  After the update is completed KillProcess causes the updated version of the application to restart (though if preferred the automatic restart can be 'optioned' out).

Summary

You have now completed the process of integrating the Software Update Wizard and preparing an update.  You followed these simple steps:

3 easy steps to automatic updates

Next Steps!

We hope you can see from these few pages that it really is possible to add sophisticated automatic updates to your application in minutes.

Thousands of computer users all over the world are benefitting from the Software Update Wizard's safe delivery of their software updates.

To see the Software Update Wizard as a user sees it, please click the demo graphic:

Click here for a self-running demo (no sound)

Translate this page: