gms_update_apply

Usage: gms_update_apply ( )

Description

Applies the update, and restarts the game.

Warning: This will restart the game, and therefore reset all variables. Don't execute this function while in-game, but rather when on a menu or update screen.

Example

//Apply update when the download is completed
//Please note this code must be executed at the very moment, or after the download finishes.
if(gms_update_isfinished())
{
    gms_update_apply();
}

Replies (6)

Last message on 22 Jan 2017

Zecca on 16 Jan 2017, 01:05:44
Hey Size, everything works fine except for the "overwrite the original file you opened" stage.
GMS download it in a folder in %appdata% called like IXP000.TMP then it close the game, then it start the game from that folder, and the original single runtime executable is not replaced.
I tried it with admin permissions, with different names but nothing changes
Size43 (Administrator) on 22 Jan 2017, 09:24:21
It will be downloaded to %appdata%/GameMaker Server/update.dat.

Seems like this might not work with single runtime executables, since they are actually just unzipping the real game to a temporary directory, and then running that.
Zecca on 22 Jan 2017, 15:37:06
Ok, thanks Size
Forgeio on 15 Sep 2015, 04:03:50
can you add an updating example in the downloadable .zip file?
Truncatedwheel9 on 4 Mar 2015, 23:02:24
My game is not updating properly (and by that I mean not at all) does the update come before you initialize the gms_settings or after?
Size43 (Administrator) on 7 Mar 2015, 18:42:13
The server sends a message to the client after calling gms_settings, but this may not be instant. It should be received within a few hundred milliseconds, depending on the ping.

Keep in mind updating only works on GM8 and the GM:Studio windows export using the Windows-version of the dll.