Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Program Update DLL

0.00/5 (No votes)
4 Dec 2009 1  
A DLL that provides support to update your application.

Introduction

This handy little DLL uses two files stored on an HTTP/HTTPS server to update your application. This DLL uses LudioSoft.ConfigurationFile.dll I found on this site! Thanks to the author for that code! Probably the most useful DLL I have found so far on this site: Link to the article.

The DLL comes either as a single package, along with the LudioSoft DLL, or in with a program that can be used to create the update files.

Using the DLL

Using the code in this DLL is really simple. Reference the DLL in your project (do not declare the subs, this may have an adverse effect on some of the properties in the DLL).

To perform an update, two subs must be called in a specific order. First, check for updates by calling:

TCi.Update.Updater.CheckForUpdates(CurrentVersion as String, TargetFolder as String)        

CurrentVer is, I suspect, the current version of the application. The DLL does not store this locally after your application closes down.

TargetFolder is the location to get the update files from. Must be a URL, in string format, to an HTTP/HTTPS folder (for example: "http://www.mywebsite.com/update/"). The DLL adds the file and file type to get.

This sub exits without any notification. Upon exit, one of the properties will change to reflect the update status, as follows:

TCi.Update.Updater.CurrentVersionStatus = VersionStat.UpToDate
'Otherwise
TCi.Update.Updater.CurrentVersionStatus = VersionStat.NewVersionAvalible

You can then download the update, by calling:

TCi.Update.Updater.DownloadLatestVersion(TargetFolder as String)

TargetFolder has the same meaning as TargetFolder on CheckForUpdates. The reason for not storing it locally - the developer may want to store the update package in a different folder.

Two properties change during the run-out period of this sub - DownloadStatus and PatchStatus. DownloadStatus changes to display the download status: either DownloadStat.Ready, DownloadStat.GettingVersion, or DownloadStat.GettingDownload. PatchStatus changes to either PatchStat.UpdateRunning, PatchStat.UpdateComplete, or PatchStat.DeletingTemp.

The DLL downloads, extracts, and then installs the update, and deletes the temporary files before ending the sub.

Using the Update Creator

The Update Creator allows the developer to create a TCi update package. The software outputs two files, lv.tuf and patch.tuf, both of which can be uploaded to your HTTP server or HTTPS server.

Using the update creator is simple; just fill out all the boxes and radio buttons, and click Create Package.

At this point, the update system supports a couple of packages for command-line extraction, with more on the way. IExpress (it is on every Windows computer, type IExpress into the RUN / SEARCH box on the Start menu) and 7Zip SFX archives (7Zip is also free, download it from http://www.7-zip.org) are both supported, with support for Windows Installer (*.msi) on the way soon. You can use your own package too, but it must be able to launch the installer on its own, without command line support.

History

  • DLL version 1.00, Update Creator Version 1.00 - Starting out! Created the DLL and Update Creator. Supports two packages, plus custom setup.
  • Update Creator Version 1.01 - Changed a bug in the Update Creator - outputting the patch definition changed from lc.tuf to lv.tuf, which the DLL recognizes. Also changed some of the text in the installer. Changed some other installer settings, icons etc.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here