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.
- download and install yarn: Yarn
- startup cmd prompt with administrator rights, cd to the directory of the folder of your exported game.
- in the cmd prompt: “yarn add electron-builder --dev” (without quotes)
- 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.
@audze if your procedure is correct and usable, we will add it on wiki
I’d like to work on the this topic too
Please provide me a suitable URL so that I can get started
Should be added hereIn a new categories , what you think ?
Sure I’ll get started
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.
Thanks for sharing the information. I’ll add it
@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]
Tuto is clean, (i’ve not tested the precedure)
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
Sure, I’ll see what I can do
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.
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.
Thanks for the suggestion, I’ll rectify it
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.
Then follow the steps given in the wiki: Publish your game to Windows, macOS and Linux manually using Electron and Electron Builder - GDevelop documentation
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