Skip to main content
Email Password   helpLost your password?
Sample Image - WebUpdate.jpg

Introduction

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!

Background

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:

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 webupdate_src.zip
  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 joseph@z51.biz

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralSimple and effective, thanks! Pin
Spaceman1
3:06 23 Sep '09  
General{"Response is not well-formed XML."} Pin
Joseph Urso
9:02 5 Mar '09  
GeneralRe: {"Response is not well-formed XML."} Pin
jocool2550
10:28 5 Mar '09  
GeneralRe: {"Response is not well-formed XML."} Pin
Joseph Urso
10:48 5 Mar '09  
GeneralRe: {"Response is not well-formed XML."} Pin
jocool2550
11:14 5 Mar '09  
GeneralRe: {"Response is not well-formed XML."} Pin
Joseph Urso
6:02 6 Mar '09  
GeneralRe: {"Response is not well-formed XML."} Pin
jocool2550
6:04 6 Mar '09  
GeneralRe: {"Response is not well-formed XML."} Pin
Joseph Urso
7:43 9 Mar '09  
GeneralRe: {"Response is not well-formed XML."} Pin
jocool2550
7:56 9 Mar '09  
QuestionAdministrator rights needed? Pin
BBiales
7:09 27 Feb '09  
AnswerRe: Administrator rights needed? Pin
jocool2550
10:42 27 Feb '09  
GeneralAssembly does not allow partially trusted callers Pin
shawn32
7:47 15 Jan '09  
GeneralRe: Assembly does not allow partially trusted callers Pin
jocool2550
8:29 15 Jan '09  
GeneralRe: Assembly does not allow partially trusted callers Pin
shawn32
9:01 15 Jan '09  
Generalusing the client on a web site Pin
gedw99
10:29 22 Oct '08  
GeneralHow to implement? Pin
DuBro
7:08 30 Mar '08  
GeneralRe: How to implement? Pin
jocool2550
3:12 1 Apr '08  
GeneralMD5 Hash instead of file time Pin
Jacques Doubell
22:25 30 Jan '08  
GeneralRe: MD5 Hash instead of file time Pin
jocool2550
10:54 31 Jan '08  
QuestionYet another request for posting the VS2005 Version Pin
dirk_kaiser
0:37 6 Jul '07  
QuestionDatabase SQL Updates ? Pin
Hantoush
16:26 18 Jun '07  
AnswerRe: Database SQL Updates ? Pin
jocool2550
22:23 18 Jun '07  
QuestionDoes it work on webserver with PHP/MYSQL? Pin
Hantoush
16:21 18 Jun '07  
AnswerRe: Does it work on webserver with PHP/MYSQL? Pin
jocool2550
22:21 18 Jun '07  
Question"Proxy Authentication Required" Pin
fhei
2:11 12 Jun '07  


Last Updated 26 Apr 2006 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009