Simple Amazon S3 based auto updater
by Dan Keller · 08/08/2011 (3:35 pm) · 5 comments
Intro
Amazon S3 is a cloud based web storage service. It is accessible using soap and there are no setup fees which makes it ideal for indie game update hosting. You can find more info about it at aws.amazon.com/s3/.
This program does two simple things. It connects to an S3 bucket (subdomain) of your choosing and downloads everything that has been modified to the current directory. Then, it launches an executable you specify (ie the game's .exe).
Setup:
Amazon S3 is a cloud based web storage service. It is accessible using soap and there are no setup fees which makes it ideal for indie game update hosting. You can find more info about it at aws.amazon.com/s3/.
This program does two simple things. It connects to an S3 bucket (subdomain) of your choosing and downloads everything that has been modified to the current directory. Then, it launches an executable you specify (ie the game's .exe).
Setup:
- First sign up for Amazon S3.
- Next create a bucket. Select your bucket and click "Actions" in the upper left, then "Properties." At the bottom, Add More Permissions and grant "Everyone" list permissions. Save.
- Click Upload, then enable the enhanced uploader. Click Add Items, navigate to your game folder and select everything. (Everything you want to distribute that is. By this point you should have already removed the editor etc.)
- Click Set Permissions, and check "Make everything public." Click Set Metadata and uncheck "Figure out content types automatically." Click start upload.
- Now, go here and download (File -> Download original). Unzip them somewhere.
- In the same folder, create a text file named "update.conf" (not .txt). In the first line put the name of your bucket, and in the second put the name of your executable (included .exe). Save and close.
- You're done. The only files you need to distribute are those four.
- Install.bat is optional, it will download without launching. It just runs "launch.exe -i"
- To redownload everything, delete update.time.
- You can update any of the updater's files except launch.exe. (and update.time, that would be stupid.) In fact, it might be a good idea to include an up to date copy of cacerts.pem in your bucket.
- Deleting files is not supported. Replace it with an empty file if you want to do that.
- Most errors are handled gracefully. Some may not be. Try not to mess anything up.
- All of the code should be cross platform. You can download it here if you want to try compiling for mac or adding a gui. You'll need boost and gsoap headers, libboost_system and libboost_filesystem static libs, as well as libeay32 and ssleay32 (libssl&libcrypto on POSIX) (static or dynamic, I used static) to link against.
- It would probably also work well integrated into an installer.
About the author
#2
@Robert, If I understand it correctly A-S3 will do much cheaper than any web hosting company in terms of storage and bandwith.
08/09/2011 (6:23 am)
Nice resource, thanks!@Robert, If I understand it correctly A-S3 will do much cheaper than any web hosting company in terms of storage and bandwith.
#3
08/09/2011 (8:22 am)
I agree with Novack. But also, if you already use S3 and want to distribute updates to players then there's really no excuse to not use CloudFront! :)
#4
08/09/2011 (10:42 am)
Great stuff Dan this could be really useful :)
#5
08/10/2011 (10:22 am)
@Konrad, I looked at that, but I think I'll stick to plain S3 for now, mostly because I haven't found a REST client that works as well as gSOAP, and CloudFront doesn't support SOAP. CloudFront might be a better idea, however, when I go to distribute the game (if I can make it work). 
Torque Owner Robert Fritzen
Phantom Games Development
If you are in need of an autoupdater, I'd recommend taking a peek at this resource. (do note, you need to make some changes to get it to work in TGEA/T3D) Only requires a web server or other storage location, which is quite cheap.
Also, be sure to read up on their licensing agreement very carefully as it is quite restrictive on content.
*edit* On a second note, let me resource my changes to the patcher system to the mentioned above link.