AutoUpdate unit for Delphi/Indy

Download it

Using this unit, you can easily create an auto update feature for your programs. The unit can read the version number out of any win32 PE file and will compare it against the version information located on a simple text file on the web. The grogram doesn't handle the download of the update itself but it can automatically download an additional "Version information" file.

The program comes with a fully-functional demo that can be used as well to create the version information text file.

The two following functions, defined in the AutoUpdateimpl.pas unit, will do all the work:

AutoUpdate_CheckEXE will do all the verification for you. It takes the following parameters:

EXEFileName : String
Place the full path and name of the file to check for version information here. You can also leave it blank for have it automatically use the current executable. Note that it can point to the name of any win32 PE file (dll, exe, bpl, etc) not just EXE files. It cannot, however, work properly with device drivers.
VersionInfoURL: String; 
Fill this parameter with the complete URL to use for checking the file version. If you want to use HTTPS URL, you need only to distribute the Indy SSL libraries.
Var UpdateURL: String
This parameter will be filled with the URL to be used to get the file update (It's always fillled in, whether or not an update it available)
Var NewVersionInfo: String; 
This will be filled with the new version info text pointed in the web repository. Use that to display the "What's new" in this version.
Var CurrentVersion: TFileVersionInfo; 
This structure will be filled with the version info found in the local file pointed by the EXEFileName parameter.
Var Latestversion: TFileVersionInfo; 
This structure will be filled with the version info from the web repository.

The second version of the function takes these additional parameters:

ProxyServer: string;
This optional parameters should be filled with the web proxy server IP or host name (should the user need one)
ProxyUsername: string; 
If the user's proxy server requires authentication, place the proxy user name here.
ProxyPassword: string;
Password for the proxy user.
ProxyPort: Integer
Port number of the proxy server.

AutoUpdate_WriteEXEVersionInfoFile If the function you use to generate the text file to be placed on the web for version checking. It takes the following parameters:

EXEFileName: string
Full path of the file containing the version information to use. See AutoUpdate_CheckEXE for details.
TargetFileName: string
Full path and name of the file to write the informations to.
UpdateURL: string
URL to be used to update the package.
NewVersionInfo: string
If you want to place the "What's news" information directly in the version check file, fill this parameter. Single line only.
NewVersionInfoURL: string
If you want the "What's news" information to be located in a different file on the web server (for example, a "readme.txt" file), leave the previous parameter blank and place the full URL of the file here.