[Old method] How Do I Make An Executable File For Windows?

When I try to create an executable app, it says I need to use electron builder and node.js. I don’t know how to use either of those to do this. I want to test out my game and see if any of the glitches and lag are present in the final executable and not just in gdevelop.

Here’s for you: Publish your game to Windows, macOS and Linux manually using Electron and Electron Builder [GDevelop wiki]

1 Like
  1. download and install yarn: Yarn
  2. startup cmd prompt with administrator rights, cd to the directory of the folder of your exported game.
  3. in the cmd prompt: “yarn add electron-builder --dev” (without quotes)
  4. when electron-builder install is completed, in the cmd prompt: “npx build .” <— yes, include the period. (without quotes).

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

… and you’re set! The good thing about GDevelop5 is that it already did the prep work for you (main.js + package.json). I believe this is the current method used when you upload to the GDevelop5 export to generate an executable/installer.

Try not to use the old method that you see around the web in regards to electron: npm, node.js, electron-packager and etc… using the electron-packager would just bloat your game unnecessarily up to 130 mbs!

edit: forgot to add that these steps will produce a folder named “dist”, the installer is at the parent directory, “win-unpacked” is the distro directory where you can just zip up and distribute. either way, asar packaging is already the default in electron-builder.

4 Likes

@audze if your procedure is correct and usable, we will add it on wiki :wink:

4 Likes

I’d like to work on the this topic too :slight_smile:
Please provide me a suitable URL so that I can get started :wink:

3 Likes

Should be added hereIn a new categories , what you think ?

3 Likes

Sure I’ll get started :slight_smile:

1 Like

Thanks @bouh and @nilarjun, please do add this to the wiki. I have tested and verified the steps to be correct, though i think there might be yarn or npx options that can make it better. Would appreciate it if you folks can add to it.

There are alot info out there on the web regarding electron packaging, but all of the stuff i have seen are horribly outdated.

1 Like

Thanks for sharing the information. I’ll add it :slight_smile:

1 Like

@audze and @Bouh , I have added these steps to the wiki. Please check it here: Publish your game to Windows, macOS and Linux manually using Electron and Electron Builder [GDevelop wiki] :slight_smile:

2 Likes

Tuto is clean, (i’ve not tested the precedure) :+1:
Peoples can be don’t like electron because of size of electron imself() , i suggest to add a alternative like : GitHub - nwjs/nw.js: Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
without necessarily explaining the process

1 Like

Sure, I’ll see what I can do :slight_smile:

I am no fan of nwjs. I believe nwjs bloats your filesize too, x2 the same size of that of an electron-builder package. That is if one can get their constantly changing (and depreciated) commands to even run. If it did run, you will come across unclear and confusing command options with little or no coherent help to be found online.

They can’t make up their mind about anything. One minute it’s this, the next minute it’s that, good luck holding that horse down without a carousel migraine. :sweat:

To point out something: i don’t think you need to install node.js to run electron-builder with the steps outlined here. you just need yarn, the rest is cmdline install.

1 Like

Thanks for the suggestion, I’ll rectify it :slight_smile:

1 Like

I got yarn downloaded. Now how do I run it?

Open the Command Prompt and go to the exported game folder using the cd (Change Directory) command.

Example:

cd C:\Users\Name\Desktop\Project

Then follow the steps given in the wiki: Publish your game to Windows, macOS and Linux manually using Electron and Electron Builder - GDevelop documentation

1 Like

I tried changing the directory but it says it can’t find the file specified. Idk why, cause I copied the folder’s address as text.

You can try another method. Go to the folder using Windows Exlporer and Press Shift + Right Click. You’ll see an “Open Command Prompt/Powershell” option. It will open the command prompt/powershell within the specified folder.

It will help if you send some screenshots of your error :slight_smile:

1 Like

Here’s an attempt to show the steps with pictures:

To access Windows Command Prompt with Administrator Priviledges:

Change directory to YOUR game folder:

Using Command Prompt to install Electron-Builder:


gamefolder3

Using Command prompt to build game package, type “npx build .” (without quotes):


gamefolder5

3 Likes