Hey all. I figured I'd share with you all the autoupdater than I'm using for my game. I saw this post a few days ago and since I needed one for my game and couldn't find one that was as simple/barebones as I was looking for I just whipped one up. Unfortunatly its pretty specific for my workflow so it'll probably not be good for the vast majority but I'm hoping at least a few will be able to use it. My goal was to make it lite and easy to use and not be too feature crazy so its about as barebones as an autopatcher can be.
Features-Windows only(uses Windows Forms)
-Releasing the project source code so you'll need a Visual Studio edition that can create Windows Forms. I'm using Express 2008.
-Single .exe file. No external .dlls
-Downloads your full project as a zip and extracts it into your user application folder.(no support for diff or individual file downloads.)
-Uses MD5 to verify the download.
-Uses ZipStorer (
http://zipstorer.codeplex.com/) for zip functions.
Not crazy feature rich but gets the job done for small game projects. I'm guessing it'll be perfect for small file size games similar to ace of spades or KAG where we're not talking about hundreds or even tens of megabytes.
How to use. Client Side-Once you open the project in Visual Studio the first thing you want to open up is Protocol.cs. This where you can switch the config to your application.
string httpVersionInfo = "http://www.yourserver.com/version.txt"; Points to the version.txt file on your server. Explained below.
string appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\.yourApplication"; application folder where your game files will reside
string localFilesPath = appPath + "\\LocalFiles"; folder where your .zip will be extracted
string configFileName = "config.txt"; name of the local config file. this file has two lines. version number and an MD5 hash of your local files.
string packageFileName = "newPackage.zip"; name of your zip file when it downloads. doesn't really matter as it's deleted once the application installs it.
string exeFileName = "yourGame.exe"; path and file name of the .exe that will get run when you press play. the path that ends up getting run will be localFilesPath + exeFileName.
int numRetrys = 1; number of times the updater will attempt to download your zip if the MD5 verifier fails.
Ands that pretty much it for client side. The windows form is pretty dry but shouldn't be too hard to make it unique to your application.
Server Side
-Two things needed on your server.
First thing is the version.txt. It is a plain text file with three lines. First line is the version number. Second is the MD5 hash of your zip file. Third is the url to the zip file. A sample is included with the source.
Second is the actual zip file.
Disclaimer
I made this specific for my project in just a few hours so if you expected a polished, by the book, following all best practices then sorry. Its just an autoupdater. It's simple and it works and I tried to make it easy to change it to be used for other game projects. I most likely will not be updating it anymore but you are free to use/modify as you want. The ZipStorer class in it does have a licence but it's not too restrictive. I beleive it's free to use as you want as well. Let me know how it goes and if anyone is able to get some use from it.
Download Visual Studio Source
http://www.gunderman.me/files/barebonesautoupdater.zip