I think the idea of providing some kind of 'automatic update' is a good one for platforms which have no native, open and user friendly means to handle this themselves, i.e. Windows and, to my knowledge, OS X. So it could be nice to default to On for an automatic upgrade option on these platforms.
The way I'd suggest to implement it in the first step is much simpler than the one you describe, though. When starting up, if online update checks are enabled, the game spawns a background thread which communicates with a (yet to be developed) interface on the master server or website. The game checks with it for availability of an upgrade, providing information on the currently installed version and platform, which is then responded to by a machine interpretable representation of either 'no update available' or 'update available, download location is ...'.
Example request (transmitted via HTTP POST):
interfaceversion=1
gameversion=3.5.3-beta2
ostype=2
osarchitecture=2
osversion=5.1
InterfaceVersion refers to the version of this web query interface, and allows for later upgrades to it. GameVersion is self-explanatory, it's important here to work with a version scheme which allows error prone comparisons of version numbers, i.e. it must be detected that 3.5.3-beta2 is older than 3.5.3 but newer than 3.5.3-dev, and that 3.6.0.4 is newer than 3.6. Alternatively, we could switch to a different version naming scheme as needed. The problem of correctly interpreting version schemes has been solved before by e.g. Debian GNU/Linux and we could and should just copy existing solutions.
OSType 2 would mean Windows (1=Linux, 2=Windows, 3=OS X, 0=Other).
OSArchitecture 2 would mean x86_64 (1=i386, 2=amd64, 3=armel, ...) See
http://popcon.debian.org/ for some hints. Alternatively, this information could be used to create more specific OSType's which would then make OSArchitecture superfluous.
OSVersion obviously refers to the operating system version.
The online interface should then respond with something along the lines of this:
updateavailable=1
gameversion=3.7.1
download=http://example.org/download?ostype=2&osarchitecture=2&osversion=5.1&gameversion=latest
info=http://example.org/downloads.html
UpdateAvailable states, as a boolean, whether an update is available for this platform based on the currently installed version (1=an update is available, 0=an update is not available). If updateavailable is false (0) then all other response values may empty.
GameVersion is the latest game version available for this platform.
Download points to the download location of the latest update; HTTP 301 and 302 Location redirects are be allowed (and need to be followed by the client), the
latest keyword points to the latest available version available for this platform (and basically causes the version check to be repeated on the server), alternatively, the gameversion could be provided as a specific version number such as "3.7.1" here.
Info is a human friendly representation of available downloads, changelogs etc. Currently, this would probably point to
http://megaglest.org/download.htmlIf
updateavailable=1, the game thread would create a lock file which contains the information returned by interface discussed above. A hook would be added to every game menu which would check whether this lock file exists. If found, a prompt would display, informing the user that an upgrade is available, offering to download it, get more information on it, or to 'remind me later'. If the user chooses to download it, the game will shut down, spawning an OS handled request for the given download location as it exits (this should result in the users' default web browser starting up, offering to download the file the download location points to). If the user chooses to get more information, the game will shut down, spawning an OS handled request for the given info location as it exits (this should result in the web page at the info location to be rendered in the users' default web browser). If the user chooses to be reminded later, the prompt closes and another lock file is created, which will prevent further update prompts during the runtime of this game. This lockfile is removed whenever the game starts up, causing prompts to appear again unless disabled generally.
The process described above does not support bindiff / delta style upgrades (I assume that's what WinMerge does), but I think offering this for all supported platforms would mean too much overhead at this time. Producing releases already involves a lot of work now, and we don't want to make it even more by having to provide binary diff information for every upgrade on any platform. If our minds change on this, an updated version of this interface could allow for bindiff style updates.
This process does also not depend on an external application (other than the users' web browser) for updating MegaGlest. If there was such an updater application then it would be unclear how this application would be updated itself, it would also make the process more complex and thus error prone, so I do not recommend it at this time.