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?

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.