Sign in to follow this  
feariel

Looking for a tutorial on how to make an update server

Recommended Posts

What type of updates?
Which platform? OS? Desktop? Mobile?
What kind of update mechanism?
How frequent?
What kind of audience?

Share this post


Link to post
Share on other sites
file download - bandwith is not a concern at the moment.
windows - desktop.
i think my first line answered this.
i want basically a launcher for my game that checks with the server every time the game is launched.
the audience is close friends.
oh and also the server will run on my pc.

thank you.

Share this post


Link to post
Share on other sites
Run a web server of your choice which hosts the files and serves them via HTTP.

Implement a library like LibCurl into your game to go to the server and ask for the latest files and download them.


Done :-)

Share this post


Link to post
Share on other sites
Replacing the currently executing binary is not possible on Windows, and is various flavors of hard on various other OS-es (from "almost trivial" to "can't be done.")
Thus, almost all patchers use a ripple launcher. This is the thing that pops up first, maybe asks for your name/password, checks for updates, and if all is OK, actually pushes you into the game.
Typically, that ripple launcher will do something like:

- Get the latest version, and proper hash for that, from server.
- If the installed version is correct, jump to "chain launch."
- Check the download temp directory for a download archive. If it's there, verify the signature. If it matches, jump to "apply patch."
- Clear out the download temp directory.
- Download the new patch archive.
- Verify the checksum of the downloaded patch archive compared to what you expect.
apply patch:
- Unpack the downloaded archive into the game install directory.
- Remove the downloaded archive.
chain launch:
- Start the actual game binary, and exit the patcher. Ideally, you use a semaphore or some other kind of barrier to guarantee that the patcher is dead before proceeding past the loading screen in the game.
actual game:
- The actual game compares a copy of the "chain launcher" binary in its own data files to the copy that's actually installed. If they differ, replace the one that started the game. This allows you to apply a patch to the downloader/patcher application, indirectly.

There are many file- and network- and permission-related things that could go wrong here. However, if you're comfortable developing desktop applications in general, there is nothing particularly new and exciting here, you just need to follow good implementation practices (keep the user informed, provide safe fallbacks for cancelling, error handling, etc.)

Share this post


Link to post
Share on other sites
You will also need a domain name, either regular one or a dyndns.org style one to allow clients to update when the patch server's IP changes.

Things get trickier if you want binaries to be signed.

For longer term solution it might be worth following the Microsoft's planned App Store and their terms/restrictions.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this