Publish your game to Windows, macOS and Linux manually using Electron and Electron Builder

From GDevelop you can publish your games to Windows, macOS and Linux. In order to export our game, click File on the top and select the Export option. You can then choose the first Windows, macOS and Linux option, which will use GDevelop online services to automatically build your game for these platforms.

If you want more control or have special needs, you can also choose Windows, macOS and Linux (manual) option. This option exports your game as an Electron project. Electron is a technology allowing HTML5 games and apps to be packaged as executables and access to the underlying system native features. Electron Builder can be used to automate the packaging and distribution.

Choose a folder

First, choose a folder where the game will be exported. It is recommended to choose an empty folder, at least for the first time, to avoid losing any file that could be overwritten by the export.

Launch export

You can then click on Export. The game will be exported to an Electron project.

You can then use Electron Builder to package your game as a Windows, macOS or Linux app.

Export to other platforms (Android, Web, Facebook Messenger...)

See the other export options to learn how to publish your game on other platforms!

Steps to Build the Project Manually

Pre-requisite: Download and Install Yarn

Before building the project, you must have a package installer on your machine. For this tutorial we will be using Yarn. Download the latest build of Yarn here. You can install Yarn using any method provided on that page.

Building the Package

  1. Start up Command Prompt (CMD).
  2. Use the Change directory command (cd) to the directory of the folder of your exported game (or navigate to that folder using Explorer and press Shift + Right Click → Open Command Prompt/Powershell for Windows)
  3. In the Command Prompt, write:
yarn && yarn build
If you are using an older version of GDevelop, you might need to use this instead:
yarn add -D electron-builder && yarn electron-builder

Note: If your custom icon doesn’t show up, just rename buildResources to “build”.

These steps will create a sub-folder named dist. The executable installer is in this sub-directory. The win-unpacked sub-folder contains the executable game files which you can archive and distribute.

Additional options

Usage:

You can pass additional options to electron-builder.

  • The -w option let you build for windows
  • The -l option let you build for linux
  • The -m option let you build for mac

Those options all accept an additional packaging format. You can find those on the electron-builder homepage:

You may combine them (for example -wl for windows and linux) but then they will both share the same packaging format.

Examples:

# Build for windows only:
yarn build -w
# Build a windows portable executable:
yarn build -w portable
# Build for windows and linux:
yarn build -wl
# Build portable builds for windows and linux
yarn build -w portable -l AppImage
# Build for all platforms:
yarn build -wlm
Some operating systems may fail to build for other operating systems.