Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

879593 Posts in 32992 Topics- by 24372 Members - Latest Member: adellaxs66

May 24, 2013, 11:58:31 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Auto updaters?
Pages: [1] 2
Print
Author Topic: Auto updaters?  (Read 931 times)
tametick
Level 3
***


Could take weeks, sir!


View Profile WWW Email
« on: July 02, 2012, 07:04:45 AM »

Hi guys,
since I couldn't get my game on steam I instead put it on a bunch of other places like desura and indievania.

But now I have 2 annoying problems:

1. every time do an update I have to upload it to a bunch of places, some of which (e.g. desura) have an annoying way of updating from inside their client (instead of just uploading a file somewhere).

2. the people who bought the game on services that don't have a client (e.g. indievania or gameolith) have to manually download the update and install it over the existing game.

I figured the solution to both of these problems is to have my own auto-updater, a program that runs before the game itself and check for updates on my server, downloads and applies them.

This sounds like a fairly generic itch that I'm sure a ton of people want scratched, but in my searches I didn't come across any cross platform (ideally windows, mac & linux) solution.

Do I really have to write my own?  Cry

Thanks,
-tametick
Logged

ANtY
Level 10
*****


here i am to save the day... or wreck it


View Profile WWW Email
« Reply #1 on: July 02, 2012, 07:23:51 AM »

It isn't so much of a problem (writing ur own), our programmer made it during a single day and it's working pretty well.
Logged

tametick
Level 3
***


Could take weeks, sir!


View Profile WWW Email
« Reply #2 on: July 02, 2012, 07:38:42 AM »

It isn't so much of a problem (writing ur own), our programmer made it during a single day and it's working pretty well.

Are you willing to share that code?
Logged

ANtY
Level 10
*****


here i am to save the day... or wreck it


View Profile WWW Email
« Reply #3 on: July 02, 2012, 08:18:43 AM »

It isn't so much of a problem (writing ur own), our programmer made it during a single day and it's working pretty well.

Are you willing to share that code?
It's written in C# so it probably won't be any good for u since u want it to be multi-platform, also I don't own it, but if u still want it even in C# I can ask the programmer.
Logged

Nix
Level 10
*****



View Profile
« Reply #4 on: July 02, 2012, 08:27:03 AM »

1) http://forums.tigsource.com/index.php?topic=18688.0

2) The problem that you'll run into is that all of a sudden you need a centralized place for the updater to grab the binaries from, which probably means you'll have to pay for that hosting yourself. You might be able to make a custom updater for each download site (so users who originally got the game from indievania will have binaries fetched from indievania's servers) but this will depend entirely on the individual services and I don't know how they work. If people are buying your game, then paying for bandwidth could be worth it; a seamless updating experience will make players enjoy the game more and are more likely to recommend it to friends, which in turn means more money for you. The larger problem, and it's a moral one, is that you would be serving updates to pirates and that would cost dollars out of your pocket for the bandwidth. Knowing that pirates aren't paying for your game is one thing, but then losing real dollars (not imaginary "potential" dollars) on bandwidth when they run the updater is something else.

If you do end up hosting your own files, Amazon and Rackspace are the big boys and I think both have CDN services available.
Logged
tametick
Level 3
***


Could take weeks, sir!


View Profile WWW Email
« Reply #5 on: July 02, 2012, 08:29:20 AM »

I already use amazon s3+cloudfront for hosting the Cardinal Quest installers (for people who buy it directly from me), it's been dirt cheap so far so I don't really mind:

http://aws.amazon.com/cloudfront/pricing/ -> 12 cents per GB in the first (most expensive) tier. My game is about 10mb, so that's like 833 full downloads per $1.
Logged

tametick
Level 3
***


Could take weeks, sir!


View Profile WWW Email
« Reply #6 on: July 02, 2012, 08:38:45 AM »

It's written in C# so it probably won't be any good for u since u want it to be multi-platform, also I don't own it, but if u still want it even in C# I can ask the programmer.

Funny, I wanted to use c# anyway Smiley mono works on mac & linux so that's not a problem.

-Ido.
Logged

waxx
Level 0
***


make dem herts wit pugs


View Profile Email
« Reply #7 on: July 02, 2012, 08:48:15 AM »

It's really easy.
Just create a file containing all files` names and their MD5 hashes. You can easily write a script that does it for all files in a chosen directory. Then, make the auto-updater download that file and compare all files the game has on user's end with those files and MD5s you downloaded. If something is missing or MD5 is different - proceed to add that file to download list.
One could argue it's not the most efficient way - but a 50kB (in our project with tons of assets) manifest is not really a problem these days.

///I'm the guy ANtY talked about
Logged

tametick
Level 3
***


Could take weeks, sir!


View Profile WWW Email
« Reply #8 on: July 02, 2012, 08:51:52 AM »

Cool thanks, I'll give it a shot.
Logged

Evan Balster
Level 10
*****


dreaming close to metal


View Profile WWW Email
« Reply #9 on: July 02, 2012, 03:46:23 PM »

IMPORTANT:  a badly written autoupdater is one of the easiest security holes in any machine for a hacker.  If you don't use sufficient safety measures, your players could become easy targets for code injection.  If you don't secure your server very well, your autoupdater could be hijacked to infect the machines of every player of your game in one move.  As the vendor of the software, you are liable if that happens.

So, y'know.  Factor that in.
Logged

Infinite Blank, SoundSelf, Cave Story+, Wreath
voice, accordion, mandolin, (oboe, soon)
Game audio programming consultant.
<plaid/audio>: opensource audio framework
larsiusprime
Level 2
**



View Profile WWW
« Reply #10 on: July 02, 2012, 04:16:15 PM »

Agree with Evan Balster here.

You want to harden your auto-updater, so that in the worst case scenario, where your server is compromised and malicious software is put in place of your actual payload, the client will be able to detect the tampering and refuse to download/install the compromised files.

Basic private/public key cryptography is your first step - sign the update files with your private key (keep the private key somewhere safe obviously, and not on a server!), then include the public key in the client to verify the files.

As an additional measure, download the files via an HTTPS request and make sure your server is set up to handle that.

There's more you can do, I'm sure, but that's a good first step.

Also, make sure to cover your ass with a well-written EULA if you're deploying an auto-updater, because even if you do everything right, something could still slip through and you'd held liable.
Logged

Nostrils!
Critias
Level 0
*


View Profile
« Reply #11 on: July 03, 2012, 06:03:34 AM »

There is an auto-update feature in the 'One Click' deploy tool with in Visual Studio. During setup you give the URI where you will be deploying to. Each time your program turns on it checks there and grabs a new copy if needed. It worked well for what I used it for but I have never shipped anything using it. It has served me well to keep test machines easily updated with new code but I have never used it in the real world.

Oh yea and it is included in the Express version of Visual Studio so it is free.
Logged
tametick
Level 3
***


Could take weeks, sir!


View Profile WWW Email
« Reply #12 on: July 03, 2012, 06:08:47 AM »

There is an auto-update feature in the 'One Click' deploy tool with in Visual Studio. During setup you give the URI where you will be deploying to. Each time your program turns on it checks there and grabs a new copy if needed. It worked well for what I used it for but I have never shipped anything using it. It has served me well to keep test machines easily updated with new code but I have never used it in the real world.

Oh yea and it is included in the Express version of Visual Studio so it is free.

How well does the mac and linux versions work?
Logged

Evan Balster
Level 10
*****


dreaming close to metal


View Profile WWW Email
« Reply #13 on: July 03, 2012, 07:16:21 AM »

How well does the mac and linux versions work?

 Facepalm
Logged

Infinite Blank, SoundSelf, Cave Story+, Wreath
voice, accordion, mandolin, (oboe, soon)
Game audio programming consultant.
<plaid/audio>: opensource audio framework
Nix
Level 10
*****



View Profile
« Reply #14 on: July 03, 2012, 09:55:53 AM »

I think he meant that as a bit of a dry joke  Smiley
Logged
Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic