<!-- Article Starts - DO NOT ADD HTML/BODY START TAGS-->
<!-- Download Links -->
<!-- Add the rest of your HTML here -->
Almost all programs that are available today have a feature that checks for
software updates using the internet. This is a convenient way for both the user
and the developer: You don't have to contact all the users (if you know them...) when
a new version is available. And the user can be sure to always have the newest
In this article I'd like to focus on small programs (e.g. only 1 executable
and no nescessary installation program) and developers who have just a simple
web space without the possibility to use scripts (only static web pages). Also this code only shows
a web page and does not automatically download or install files.
The basic thing we have to do is very simple: Connect to a web site, ask for
the newest version, compare it to the current version, and in case there is an
update ask the user to download it. You - as the developer - have to use
correct version information in your code and update the internet file whenever
an update is available.
Ever looked at the version block of your code in the resource file? This resource
consists of two major blocks: A language-independent information on the top
containing file version etc. and some blocks where text information can be
stored like the copyright. This code only uses the fixed block (
) at the top of
this resource. Please be sure to update this block any time you want to release
a new version!
What this class does
The new class
has 1 main function: download a web site
and check for updates! If you don't want to change any behaviour you simply use
the class "as is" - that's all (besides adding the language-dependant strings).
The class has two helper function
to get the
applications File version and
which simply opens a web
page in the default browser. I got the code for
on the web, so when you are the author please inform me to put your names
to the credits.
Using the code, allow auto-updates
: Add a new menu item to your application and handle it in your
drived class. This could look like this:
where the string
In case you want to check automatically for updates each time the user start your
application put the lines above in the
InitInstance function. Or
write the last date you checked for updates to the registry and only check once
each week. ....
: Add a few strings to the string table:
|You currently use version %u.%u of this program. The newest version %u.%u is available online. Do you want to see more information?
|No Updates available.
|Unable to check for updates.
: Put a file on your webspace (located as referred in
which has the following syntax:
Major Version|Minor Version|URL for Update page
So when your program has currently the version
and you want
to offer an update to
which is available for download at
the file should be
- The file on your web site has to be less than 512 characters
- Only the two leftmost parts of the version info are used. The lower two numbers
are normally used as a "Build number" and have no effect on this class
- No automatic download is offered, the user has to download the
files from your site and copy/install them
01.11.2003: Initial release