Click here to Skip to main content
15,113,057 members
Articles / Programming Languages / C#
Posted 10 Mar 2006


193 bookmarked

WebUpdate: Keep All Your Fat Client or Single User Applications Up To Date Simply!

Rate me:
Please Sign up or sign in to vote.
4.85/5 (58 votes)
26 Apr 2006CPOL3 min read
A simple way to keep all your fat client or single user applications up to date, easy to add to your projects and much easier than any other product to put online an update!
Sample Image - WebUpdate.jpg


Automatically deploying your applications/resources/related files is a common and recurring problem that every developer making software for a large audience has to face!
WebUpdate offers a real easy and fast way to add a self-update ability to your application!

  • Update any kind of file based on date check
  • Each file can be updated individually (no need to redownload a full version if only one little file has changed)
  • No need to make a configuration file and specify manually each file that requires an update
  • All communications between the client and the Web service (the webupdate server part) are compressed to gain up to 60 % of bandwidth and update time!
  • Threaded
  • Reconstructs files and directories that have been deleted by the user
  • Easy to add to any project (less than 5 minutes!!!)
  • Easy to add a new update (put or overwrite files to be added/updated in the update folder on the server)
  • Automatically starts at startup or shutdown of your application
  • Ability to update the updater software!


Before starting the development of webupdate (2004), I searched if someone had made something similar and I discovered Microsoft's application blocks : "Updater Application Block" which does the same thing but has some limitations:

  • The block relies on absolute path links being provided in the configuration file. This reliance causes big problems, because you can't always guarantee that users will install your application to a specific location.
  • When you want to add a new file to be updated, you have to modify a manifest file to set the file path for each file!
  • You have to play with a public/private RSA key. :(
  • A version is a set of files. So, if you want to update just one file you have to prepare a new update folder with a new manifest!
  • Every time the Updater downloads a new version of your application to the client, it creates a new folder to contain the new version; unfortunately, it leaves the folder(s) for the outdated version of your application and all its files intact. That's untidy. It leaves open the possibility for users to run an older version, and bloats the disk space requirements for your application.

Hopefully those limitations can be removed by extending the updater block with the interfaces IValidator, IPostProcessor and IDownloader but that is not the subject of this article.;)

The Update Process

A user starts your application, your application launches WebUpdate.exe.
WebUpdate asks the update server if WebUpdateClient.exe was updated and updates it if necessary. Webupdate.exe starts webupdateclient.exe which is the real updater. WebUpdateClient asks the server (a Web service installed on a Web server) for all file info about an appname (paths, sizes, last modifications) and compares the results to the local folder. Finally WebUpdateClient.exe asks for the required files. The server sends in response the required files through a compressed soap message. All updated files are updated or added to the application folder.

Using the Code

Given below is the code to add to your existing application Load method:

System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
psi.Arguments = "check";
psi.FileName = Application.StartupPath + "\\WebUpdate.exe";
psi.WorkingDirectory = Application.StartupPath + "\\";
psi.UseShellExecute = true;

System.Diagnostics.Process.Start( psi );

How To Install the Demo?

  1. Unzip
  2. Create a virtual Web site for the folder WebUpdateWS
  3. Place some files to be updated or added on all clients computer in the folder WebUpdateWS\Updates\YOUR_APP_NAME_HERE\
  4. Edit the webupdateclient\bin\Debug\WebUpdate.ini file and set the line "Version=" to "Version=YOUR_APP_NAME_HERE"
  5. You can directly run a webupdate by launching webupdateclient\bin\Debug\WebUpdate.exe

Of course in a real application, you just need to xcopy all the contents of webupdateclient\bin\Debug\ near your main EXE and modify WebUpdate.exe.config and WebUpdateClient.exe.config to set the real Internet webupdate server HTTP address.

About the Compression

I used the library SharpZipLib and the excellent SoapExtender CompressionExtension from Saurabh Nandu.

Feel free to ask me any questions.
Joseph Benguira


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Web Developer
France France
No Biography provided

Comments and Discussions

QuestionPlease update to lastest .net vertion Pin
khoirom23-Jul-13 17:50
Memberkhoirom23-Jul-13 17:50 
GeneralMy vote of 4 Pin
Dan Randolph22-Dec-12 10:05
MemberDan Randolph22-Dec-12 10:05 
Good project, but needs to be updated to at least .NET 3.5. Good use of threading and compressed file transfer. It is too bad Microsoft made so many changes to SOAP since .NET 1.1 to make it almost obsolete now.
QuestionProblems Pin
r0seBa8-Oct-11 5:43
Memberr0seBa8-Oct-11 5:43 
AnswerRe: Problems Pin
jocool25509-Oct-11 2:47
Memberjocool25509-Oct-11 2:47 
GeneralRe: Problems Pin
r0seBa17-Oct-11 3:52
Memberr0seBa17-Oct-11 3:52 
GeneralPerfect Pin
Seungbeom Roh24-Mar-10 23:05
MemberSeungbeom Roh24-Mar-10 23:05 
GeneralOut of the box [modified] Pin
omzig23-Mar-10 13:00
Memberomzig23-Mar-10 13:00 
GeneralSimple and effective, thanks! Pin
Spaceman123-Sep-09 3:06
MemberSpaceman123-Sep-09 3:06 
General{"Response is not well-formed XML."} Pin
jzubear5-Mar-09 9:02
Memberjzubear5-Mar-09 9:02 
GeneralRe: {"Response is not well-formed XML."} Pin
jocool25505-Mar-09 10:28
Memberjocool25505-Mar-09 10:28 
GeneralRe: {"Response is not well-formed XML."} Pin
jzubear5-Mar-09 10:48
Memberjzubear5-Mar-09 10:48 
GeneralRe: {"Response is not well-formed XML."} Pin
jocool25505-Mar-09 11:14
Memberjocool25505-Mar-09 11:14 
GeneralRe: {"Response is not well-formed XML."} Pin
jzubear6-Mar-09 6:02
Memberjzubear6-Mar-09 6:02 
GeneralRe: {"Response is not well-formed XML."} Pin
jocool25506-Mar-09 6:04
Memberjocool25506-Mar-09 6:04 
GeneralRe: {"Response is not well-formed XML."} Pin
jzubear9-Mar-09 7:43
Memberjzubear9-Mar-09 7:43 
GeneralRe: {"Response is not well-formed XML."} Pin
jocool25509-Mar-09 7:56
Memberjocool25509-Mar-09 7:56 
QuestionAdministrator rights needed? Pin
BBiales27-Feb-09 7:09
MemberBBiales27-Feb-09 7:09 
AnswerRe: Administrator rights needed? Pin
jocool255027-Feb-09 10:42
Memberjocool255027-Feb-09 10:42 
GeneralAssembly does not allow partially trusted callers Pin
shawn3215-Jan-09 7:47
Membershawn3215-Jan-09 7:47 
GeneralRe: Assembly does not allow partially trusted callers Pin
jocool255015-Jan-09 8:29
Memberjocool255015-Jan-09 8:29 
GeneralRe: Assembly does not allow partially trusted callers Pin
shawn3215-Jan-09 9:01
Membershawn3215-Jan-09 9:01 
Generalusing the client on a web site Pin
gedw9922-Oct-08 10:29
Membergedw9922-Oct-08 10:29 
QuestionHow to implement? Pin
DuBro30-Mar-08 7:08
MemberDuBro30-Mar-08 7:08 
AnswerRe: How to implement? Pin
jocool25501-Apr-08 3:12
Memberjocool25501-Apr-08 3:12 
GeneralMD5 Hash instead of file time Pin
Jacquers30-Jan-08 22:25
MemberJacquers30-Jan-08 22:25 

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.