Click here to Skip to main content
Click here to Skip to main content

Program Update DLL

, 4 Dec 2009 Ms-PL
Rate this:
Please Sign up or sign in to vote.
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, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)

Share

About the Author

Twaitsey

United Kingdom United Kingdom
No Biography provided

Comments and Discussions

 
GeneralMy vote of 1 Pinmember|[awx]|2-Oct-11 22:35 
no source code
GeneralSource code Pinmemberjuan321121-Jan-10 9:06 
Generalok article PinmemberDonsw5-Dec-09 17:22 

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

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

| Advertise | Privacy | Mobile
Web01 | 2.8.141022.1 | Last Updated 4 Dec 2009
Article Copyright 2009 by Twaitsey
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid