Article Preview
Buy Now
FEATURE
Update Yourself
Adding a self-updating feature to your application
Issue: 3.3 (January/February 2005)
Author: Marc Zeedar
Author Bio: Marc is the publisher of
Article Description: No description available.
Article Length (in bytes): 14,431
Starting Page Number: 26
Article Number: 3312
Resource File(s):
3312.zip Updated: 2013-03-11 19:07:58
Related Web Link(s):
http://www.rbdeveloper.com/downloads/appos9.sit<
http://www.rbdeveloper.com/downloads/apposx.sit<
http://www.rbdeveloper.com/downloads/appwin.zip>
http://www.rbdeveloper.com/updates/selftest.xml
http://www.rbdeveloper.com/
Excerpt of article text...
In the old days, getting a new version of a program meant going to a store and buying a box with a disk in it. Then the internet came along and we could just go to the company's website and download an update. Today, most programs have a self-update feature which will automatically alert you when there's a new version. You might have thought adding such a feature to your own projects would be difficult, but I'm pleased to tell you that REALbasic 5.5 makes it frightfully simple.
A Simple Approach
There are dozens of ways to implement a self-updating feature; many are complex because they require a client-server architecture, requiring a program running on your website.
However, for basic updating -- alerting your app that a new version exists -- I've chosen a simple approach. This may not offer all the features you require, but it will satisfy most needs.
What's nice about this simple method is not just that it's easy to program, but that it's easy to reuse: all the self-updating code is maintained in a single window so you can simply drag the window into new projects to add a self-updating feature to any program.
The approach I take is to post a special XML file on my website. This XML file includes the version number of the current release, a brief description of the update, and download URLs for each platform my app supports. Then my self-updating code simply downloads the XML file, parses it, and compares the version number of the running app to the version in the XML file. If they don't match, we offer the user the option of downloading the new version. Simple!
...End of Excerpt. Please purchase the magazine to read the full article.