GMPack Documentation

Package GameMaker games into a single file executable.

When you build a game with GameMaker, several files are provided next to your executable on Windows. This program allows you to turn your game into a single executable file without needing the extra files next to it.

Usage

After downloading the program, drag the GMPack.exe file into your game folder. This should be the same folder as your *.exe file and your data.win file. Double-click on GMPack.exe, and you may be asked if for confirmation if you have a particularly large game. After a few seconds, you should see a new *-packed.exe file in the folder. That file is your packaged game, and can be launched without any other neighboring files.

Drag GMPack into your game folder

How does it work?

tl;dr: It's a self-extracting archive. Because of course it is.

When you run GMPack, it first scans the folder it's in and looks for a GameMaker game. It then makes a copy of itself and takes all of the other files in the folder, zips them up, and attaches them to the copy as a payload. After that, it attempts to copy all of the executable information from your game onto the packaged program, including copyright information, version number, and icon.

Once all of that's done, the program can be run again to launch the game. The way it does this is by checking if it has a payload attached, and then extracting that payload to a predetermined location: %LOCALAPPDATA%\GMPack\{your-game-name}. After extraction, it runs your game. If it sees that the game already has a folder here, it checks the version number attached to the binary to check if it has changed since the last time. If it hasn't, it runs the game without extracting. Otherwise it re-extracts, overwriting the old version.

Handling versions

Since GMPack won't extract its payload if the version hasn't changed, this means that when you ship updates to your game, you have to update the version number from within GameMaker so that GMPack knows to re-extract. This can be done in Game Options - Windows:

Game Options - Windows

Custom icons

By default, GMPack tries to copy the icon from your game binary. If you want to overwrite this behavior, you can specify a custom icon to use instead. If there is a file called gmpack_icon.ico in your game folder, GMPack will try to use that icon instead.

Caveats

In no particular order:

  • Games packed with GMPack can trigger false positives as a virus in Windows Defender
  • GMPack is probably not suitable for very large games because it will take a long time to extract the payload the first time it's launched, making for a bad user experience
  • Sometimes it has trouble copying the icon, so in some rare cases you may end up with a binary that has an ugly default icon (many times this problem exists only locally and is a Windows bug, try restarting explorer.exe)
  • Using GMPack will usually result in a larger overall filesize, which usually isn't a big deal for smaller games or tools but still worth noting
  • You shouldn't use this for the Steam version of your game, because the files are usually hidden to user anyway
  • GMPack offers no way to the user to easily access game files, since they are hidden away in app data (which may or may not be important to you)
  • GMPack is known to not work with some games made with older versions of GameMaker, including GMS 1
  • Critical errors (including permissions errors) can sometime result in a crash when packaging without any output