Heybo Blog

If you look at me when I'm talking, you'll see what I'm saying ... about Tech and .NET discoveries!

My Links

News

Story Categories

Archives

Post Categories

Image Galleries

Login

Blog Stats

Links

Personal Websites

An Auto Update Component

After looking high and low for an updater with ease of use and lack of complexity, I came across a few options. One component had a generator for xml files and started at $89 for the light version. It worked great for Win32 apps, but didn't recognize the VS generated setup.exe files. The next option was just under $300. Meh. All the others were $1000s. I came across this open source component Sharp AutoUpdater by Conversive.

With a little effort I managed to modify the code to allow rollbacks, and updates on the fly. All it takes is an autoloader, and autoloader config file, a xml file for the update information, and zip files of the application directories. You add the component to your project and handle updates with a timer, or whatever mode you desire, and even select wheter to suppress messages, or allow user interaction. I prefer to put the functionality in the about box, and update on demand.

The process is simple. The loader starts the executable in the specified subdirectory. An update is downloaded to the 'udpate' directory, and at restart the old directory is deleted and the new one is moved into place. Upon rollback, the process is the same, except the directory is 'rollback'. To deploy an update, simply modify the server's xml file, and click update in the client. The SharpZipLib is incorporated to handle the compression and decompression. It works asynchronously, so you can see if an update is available with no sluggish GUI side effects. The updates and rollback are asynchronous too!

So for 3 hours worth of time modifing it to exactly what I needed, I came close to the cost of the cheapest solution, with was not what I wanted, and not working! If you would like to see some of my modifications, just drop me a line.

posted on Friday, February 18, 2005 12:51 PM

Feedback

# re: An Auto Update Component 2/24/2005 2:10 PM John McCaffrey

I'm glad to hear someone has had success with this component. I guess there is a crucial step I am missing when adding it to my own code. I get stuck in a loop pulling down the update .zip file. In reading your explanation of how it works, does the update file need to be downloaded into a subdriectory of it's own?

--John

# re: An Auto Update Component 2/24/2005 5:10 PM Matt Linder

John,
In the component, the zip is downloaded in the directory the loader is in, <loader folder>. It is unzipped to the "<loader folder>/update/" folder. The loader looks for the files in the /update/ folder. The new folder is then copied to the <ApplicationFolderName> upon updating.

M

# re: An Auto Update Component 2/24/2005 7:42 PM John McCaffrey

Thanks, I will give it a try and report back. I'll also go back to the original component and start from there. I had added a "Bytes Received" event so I could show some sort of progress of the download.

--John

# re: An Auto Update Component 5/16/2007 8:47 AM Doug DeGenaro

Actually I would like help with a rollback, and the Bytes received event, as I am implementing this for a project.

Are you downloading the zip to your currentversion directory and upon getting the new version moving the old zip to the rollback directory and putting the new zip in the current version directory?

# re: An Auto Update Component 5/16/2007 9:59 AM Matt Linder

Yes, the old zip should be in the rollback directory and the new should be in the current version.

Title  
Name  
Url
Comments   
Protected by Clearscreen.SharpHIPEnter the code you see: