Archived

This topic is now archived and is closed to further replies.

auto updater

This topic is 5152 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

hello. i''ve been here before a long time ago but forgot my details so this is my first post in a long time. what i''m trying to do is figure out how to do an auto updater (not sure of the technical name) for a game i''m working on. an example of what i mean by auto updater can be seen in age of mythology. i''m sure many of you have played this but it isn''t as good as the previous series in my opinion. thankyou

Share this post


Link to post
Share on other sites
A common auto updating method (as used in the end of Petzold''s book), is to use ftp. The method I would use, would probably be to simply store the version info locally, and get the client to compare with a version online (eg in an ftp server). You can be clever, and let it check multiple servers etc... but a simple implementation would use only one. Based on the result of this comparison, your client would then automatically have the update, to get him up to the current version downloaded, and executed... (which would update his local version tag). This could be done in a little prestart launch application. This would mean that the game could run immediately after the update, rather than requiring the game to be quite and restarted.

Share this post


Link to post
Share on other sites
Yes, there is normally a small launch app that simply checks for updates. If there are some, it downloads them then runs the client. If there aren''t any, it just runs the client. You can do the file transfer any way you''d like, there is no reason you can''t just send the data over manually through a normal winsock connection, rather than implementing an ftp client. The benefit of an ftp client, is that you can download from just about any ftp server that feels like putting your files on it, so you don''t have to waste your own bandwidth. The other way, you''d have to run a custom app on the server, and most people won''t allow you to do this for free.

Share this post


Link to post
Share on other sites
i can get myself a server that supports ftp with a 10mb connection unlimited bandwidth.... costs a bit but i can easily afford if neccessary.

the file(s) would only be about 3mb in size. nothing over the top.

"small launch appliction"

can u go into a little detail here, thankyou. v.much appreciated if you could.

i have never heard of "petzolds book" but i will look this up on google.

use ftp - never tried this before some example code etc would be useful. i have used ftp to upload things obviously but i mean to write something that manipulates it.

simple implementation - i''d want reliable downloads not having to worry about others web servers. so only my own server.

i''m fine with the game needing to be restarted. but one i get the game to connect with the server and download how do i get it to install the update.

it downloads them then runs the client.

what i am trying to do is have a button on the main menu "updates" then when the user clicks it i want it to connect to the server check if there are any available downloads then obviosly with file is downloaded.

where i am stuck is then how to get it to install. would i use a local directory ie "temp" then get it to run it from there?

anyone got a small script that can detect what os they have and therefore locate where there temp directory is?

how can i write an app that has a front end that tells them whether there connection is on or off or non existen and tell them that they need an inet connection to update the game?

thankyou

if my post is confusing just tell me and i will do my best to clear things up.

Share this post


Link to post
Share on other sites
Personally, I would take the "small launch" application approach.

Basically, whenever a user wished to run your program, they would execute the "small launch" application to do so. This application would look at the current version information (stored locally in a file or your choosing), and connect to the webserver at retrieve the current updated version information. If the client is out of date, the launch app would request the updated files from the server. Depending upon the nature of the files, the launch app may simply copy them to the appropriate directory (ie updating DLLs etc...) or uncompress and then copy etc... Once this is complete (or if no update was required), the launch app would make a call to "CreateProcess" and terminate. CreateProcess (with appropriate parameters) will launch your main app.

You could write your launch app with MFC and use the internet wrapper classes to communicate over the net. It wouldn''t take much to get something like that up and running.

Share this post


Link to post
Share on other sites