Jump to content

  • Log In with Google      Sign In   
  • Create Account


Patcher


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 GameCreator   Members   -  Reputation: 691

Like
0Likes
Like

Posted 06 October 2013 - 11:40 AM

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, 06 October 2013 - 11:41 AM.


Sponsor:

#2 Adam_42   Crossbones+   -  Reputation: 2361

Like
4Likes
Like

Posted 06 October 2013 - 05:44 PM

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.



#3 GameCreator   Members   -  Reputation: 691

Like
0Likes
Like

Posted 07 October 2013 - 09:14 AM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS