How Do I Make An Executable File For Windows?


#1

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.


#2

Here’s for you: http://wiki.compilgames.net/doku.php/gdevelop5/publishing/windows-macos-linux-with-electron


#3
  1. download and install yarn: https://yarnpkg.com/en/
  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

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


#5

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:


#6

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


#7

Sure I’ll get started :slight_smile:


#8

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.


#9

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


#10

@audze and @Bouh , I have added these steps to the wiki. Please check it here: http://wiki.compilgames.net/doku.php/gdevelop5/publishing/windows-macos-linux-with-electron :slight_smile:


#11

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 : https://github.com/nwjs/nw.js
without necessarily explaining the process


#12

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


#13

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:


#14

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.


#15

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


#16

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


#17

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: wiki.compilgames.net/doku.php/gdevelop5/publishing/windows-macos-linux-with-electron


#18

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.


#19

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:


#20

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