Click here to Skip to main content
15,881,173 members
Articles / Programming Languages / Visual Basic

Program Update DLL

Rate me:
Please Sign up or sign in to vote.
2.71/5 (3 votes)
4 Dec 2009Ms-PL3 min read 31.6K   1.1K   28   3
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:

VB
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:

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

You can then download the update, by calling:

VB
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, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 1 Pin
|[awx]|2-Oct-11 22:35
|[awx]|2-Oct-11 22:35 
GeneralSource code Pin
juan321121-Jan-10 9:06
juan321121-Jan-10 9:06 
Generalok article Pin
Donsw5-Dec-09 17:22
Donsw5-Dec-09 17:22 
Can go a little deeper, more detail maybe

cheers,
Donsw
My Recent Article : CDC - Change Data Capture

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.