Skip to content

ThirteeNov

My personal blog about coding and internet

Menu
  • About me
  • About Zofia Kreasi
  • Cart
  • Checkout
  • Making an airplane game from scratch in Unity
  • My account
  • Privacy Policy
  • Privacy Policy – zkLeaderboard
  • Sample Page
  • Shop
  • Tutorials on Learning JavaScript
  • ZKAccounts – Privacy Policy
Menu

How to build your Electron js app as Windows executable for Windows?

Posted on February 2, 2021October 26, 2022 by Habibie

I made this post because if I did not work on Elenctron project for some times, I can not remember how I did it that time.

So, let’s say we have a “ready to build” Electron project, to build it for Windows, first let’s install Electron Packager (my favorite method is using Electron Packager). To install it, follow it’s instruction here:

https://github.com/electron/electron-packager

Or simply run this command to install it:

npm install --save-dev electron-packager

Or, if that’s not working, try this:

npm install -D electron-packager 
or
npx electron-packager .

If you want to install it globally:

npm install -g electron-packager

After installing it, in my case, I would like to run this command to build Windows 64 executable plus adjusting it’s executable icon:

electron-packager ./ YourAppName --platform=win32 --arch=x64 --icon=./icon.ico

The first part is obvious, electron-packager is the program that we run.

Second part, ./ means we are building what we have in current directory. So please note you need to navigate to your index.html directory on your cmd then you can run above command.

–platform=win32 is telling the program to build Windows executable.

Then –arch=64 is my choice to have 64bit program.

The last part –icon=./icon.ico is defining what icon file do I use for my executable. I already prepared .ico file on my working files directory so I point it that way.

Hope it’s useful to you, and to me for sure.

Post Views: 529
ciihuy2020

Welcome!

  • My YouTube Channel
  • My GitHub Page
  • About me

Categories

  • 3DVista
  • Android
  • Apache
  • C#
  • Cordova
  • Electron & Node JS
  • HTML5, CSS & JavaScript
  • iOS
  • Let's Make Unity Games
  • Misc
  • Photoshop
  • PHP
  • Python
  • Uncategorized
  • Unity
  • WordPress

Recent Posts

  • Hover Reveal script for Unity to show and hide object on mouse hover
  • How to Prevent UI Clicks in Unity from “Bleeding Through” to 3D Objects Behind Them
  • Make objects like wires and cables easily in Unity using Ciihuy Curved Mesh
  • [SOLVED] Can’t Add Custom Domain to Blogger After Losing CNAME Verification
  • iOS App Icon Generator by CiihuyCom
© 2026 ThirteeNov | Powered by Superbs Personal Blog theme