• Advertisement
Sign in to follow this  

Patcher

This topic is 1569 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My question is a basic one: how do patchers work?

 

My understanding so far is that the EXE is only the patcher / launcher.  When it's run, it checks the files against a website or server to see if they match (I will be using libcurl).  If they don't, it updates them.  Then, when you hit Play, it runs the actual game DLL which plays the game.

 

First, is this the correct idea?

Second, in Windows (I use Leadwerks and Visual Studio Express), what's the command to launch the DLL?

Finally, how do you update the launcher itself?  Does that game do that once the launcher quits?  Or does the updater launch another updater DLL?  I guess it doesn't matter which but what's the "right" way to do it?

 

Thanks!

Edited by GameCreator

Share this post


Link to post
Share on other sites
Advertisement

Generally there are two executables - the patcher and the game. The patcher executable is the one you launch to run the game. The patcher can then update the other executable and use CreateProcess() or ShellExecute() to launch it.

 

Updating the patcher is a little more complicated, because you can't modify the exe of a program that is currently running. I'd go for a process something like:

 

- The patcher does a version check. If it's out of date it downloads an updater executable. The patcher then launches the updater and exits.

- The updater waits for the patcher to fully exit, and then updates the patcher.

- The updater can then launch the new patcher and exit.

- Optionally the new patcher can get rid of old updaters.

 

You'll also need to watch out for cases like launching the patcher while the game is running, or the user trying to run the game directly.

 

In addition make sure you check that all your API calls succeed - the update process needs to be robust in case of things like the disk being full, or the user lacking appropriate permissions.

Share this post


Link to post
Share on other sites

Thanks for the thorough response!  Sounds like there's still a lot to learn (about how to monitor if a program is running and permissions).  Games like Starcraft make it look easy.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement