karansys
karansys

Reputation: 2729

How to set custom executable icon using electron-packager?

Entered image

I have successfully built an Electron app. Now I'm trying to change the icon of the .exe that is generated by electron-packager. However, the .exe gets the default Electron icon, not my own icon (see screenshot).

The command I run: npm run build

The corresponding script in package.json:

"build": "electron-packager --out winx64 --overwrite --platform win32 --appname clientlmcenter . --icon my_logo.ico"

The file my_logo.ico is present in the root directory.

Upvotes: 3

Views: 10885

Answers (2)

Michael Parra
Michael Parra

Reputation: 21

Another solution that I found is adding the icon in the packaje.json taking into account that the icon is in the root.

{
  "name": "nameAplication",
  "version": "1.0.0",
  "icon": "favicon.ico",
}

and when creating the executable add this command

electron-packager . --platform=win32 --arch=x64 --icon=favicon.ico

Upvotes: 2

Sharvin K
Sharvin K

Reputation: 715

You have to put icon argument like this

--icon=./my_logo.ico

Also make sure the logo is in the current directory where you execute npm run build

Upvotes: 3

Related Questions