Updating your game

GameMaker Server has a built-in function to update your game. If you're not very familiar with GML, consider using [gms_show_update] instead.

The process of updating

When gms_settings is called, the given version will be sent to the server. The server check whether the version number saved on the site is larger. If that's the case, the download URL will be sent to the client.
When calling gms_update_check, the DLL checks whether it has received an update-url. If so, gms_update_check returns 1. Keep in mind that receiving update information may take some time, so make sure to check a few seconds after connecting, when the update information has been received.

Applying the update

After calling gms_update_start, the file will be downloaded. This can take some time, so the download runs asynchronously. gms_update_apply finishes the update, by replacing the game's files, and restarting the game.

Replies (26)

Last message on 28 Jan 2018

Nefault1st on 27 Oct 2016, 07:10:05
Before the updates apply, are they downloaded to a specific hard drive? I received reports from players saying the updates don't apply after the program restarts itself. But some say it works when they switch drives.
Size43 (Administrator) on 28 Oct 2016, 17:29:42
Updates are downloaded to a temporary directory (most likely somewhere on the C drive), then the old exe is overwritten by the newly downloaded one.

This worked in GM8 since the runner did not lock the executable file. It might no longer work in GM:Studio because of changes to the runner. Are you distributing single runtime executables or a zip/installer?

I'm fairly sure it should still work with the single runtime executables.
Nefault1st on 28 Oct 2016, 18:48:22
Yeah it's an executable from GM8. Also I should've specified that this only affected some players, the update system worked flawlessly for a majority of them.
Do you think there could be a way to download it to which ever drive the executable file is located in?
Size43 (Administrator) on 30 Oct 2016, 20:19:32
Maybe it's a permissions issue? The game itself needs write access to the executable to overwrite it. If it doesn't have that, it can't update the game.

Can you check what gms_update_apply returns? It will return 0 on failure, or 1 when succesful.
Nefault1st on 31 Oct 2016, 01:10:46
I tried running it on my back-up hard drive and I can confirm it doesn't work, even when I run it as an admin with the file having write access.

I can't seem to check what that function returns because as soon as it's used, the program stops before the step event can even finish. Tried using debug mode and the same still happens. :\
SpaceNerd on 25 Jan 2018, 19:32:22
So if you have a version of your game with a higher version number set in gms_settings it will be sent to the server and will be downloaded by users with a lower version number, right?
Size43 (Administrator) on 27 Jan 2018, 17:01:56
The update check will compare the version set on this site with the version set in-game. If the in-game version is lower, the game will try to download a newer version from the provided download URL.
SpaceNerd on 28 Jan 2018, 16:45:09
Thank you.
mpgame on 18 Feb 2017, 11:15:48
How I can update an android game or forced players to update game from google play before login?
mpgame on 18 Feb 2017, 13:06:07
by "GM_version" we can have version number of game... but how can I comparison it by my new version number?
mpgame on 19 Feb 2017, 17:01:53
I fixed it by "GM_version" and "gms_ini_game_read"...
Truncatedwheel9 on 31 Oct 2016, 18:04:52
So, i run the gms_update_check() and gms_update start() functions on a screen after the login. It does not give any indication that it is updating, even though i game it a script to show a bar when updating. Is there a reason for this?
Size43 (Administrator) on 10 Nov 2016, 11:37:13
What does gms_update_check() return? Does it detect the update properly?

What code are you using to draw the progress bar?
innominato on 4 Mar 2016, 23:45:08
I've a problem, I wrote the code to update the game. Then I've started the game with Gamemaker ( without saving it as a exe).

Ok--> game start --> I click to update --> Appears a message like "restart the game manually."

Now If I try to start the game, it says "Error creating process". It doesn't work anymore;
I have restart pc and Eset nod32 show to me an error with HTTP POP3 and IMAP protocols. I'm very surprised.
innominato on 5 Mar 2016, 13:47:16
Ok, I have reinstalled game maker, now all is ok.
But when i update the game, it says "Could not restart game to update. Please restart the game manually"
Size43 (Administrator) on 6 Mar 2016, 17:05:25
You should make an executable before running an update. The extension will REPLACE the exe with the newly downloaded one. When running the game without creating an executable first, it seems like GameMaker: Studio doesn't create a temporary exe anymore, but just runs a runner.exe. That runner.exe will be replaced by the updated version of your game, which breaks GameMaker.
MagikGames on 5 Feb 2015, 02:03:40
My game has an external folder that holds all the music files so my game is always released in a .zip archive. Will this auto updater take an .zip and puts all the game files inside it in the game's directory or this updater only works with 1 file?
Size43 (Administrator) on 5 Feb 2015, 15:28:13
The updater will currently only update the .exe file itself, so you'd have to use included files. I'm looking at hosting the game files on this server, and doing things like only updating the files that have changed. Don't expect something like that too soon though :)
Gigabite on 20 Dec 2014, 19:10:38
What kind of link do we use? I have tried to get updates going but something's going on. I have tried to get a link as direct as possible but it still doesn't work. What should i use to host my files?
Size43 (Administrator) on 22 Dec 2014, 14:43:13
Updates only work if you're using the GM8 or GM:Studio (All) version of the extension. A direct download link is a link that will not show a webpage before downloading. When opening the link, it should start the download immediately.
Gigabite on 23 Dec 2014, 02:20:32
So, would it work in the game maker 8.1 extension?
Size43 (Administrator) on 23 Dec 2014, 17:08:26
Yes, it'll work in GameMaker 8 and 8.1 too.
Ildradil on 15 Oct 2014, 21:03:14
So where i can set the page i want to download the update from?
Size43 (Administrator) on 16 Oct 2014, 20:35:18
The downloadlink you set under "Gamepage settings" will be used to download updates from.
namlunthkl on 30 Oct 2014, 13:31:29
Can you make an example for me? My email is: namlunthkl1012001@gmail.com Thanks!
namlunthkl on 30 Oct 2014, 13:14:27
Hi Size, do you have a Facebook account?