Search code examples
javascriptelectronelectron-packager

Electron-packager not setting icons


There are lots of questions relating to setting icons using electron-packager but none of the answers have worked for me – maybe the answers are out of date or not clear – but I need to ask again.

I am building on OSX for OSX & Windows. I've tried at least 20 variations on specifying the icon for electron-packager (the full cmd set is below). I've tried referencing icons withing the app folder (app/assets/WIN_logo.icns) as well as in an "icons" folder at the project root (icons/assets/WIN_logo.icns); I've tried using quotation marks, leaving off the extension and other stuff I can't even recall.

So please, can someone tell me, given the directory structure below, how I specify the icon for electron-packager to use.

-icon=assets/WIN_logo.icns
-icon=assets/WIN_logo.ico

enter image description here

  "package-mac": "electron-packager . --overwrite --tmpdir=false --platform=darwin --arch=x64  --prune=true --out=release-builds -icon=assets/WIN_logo.icns",
  "package-win": "electron-packager . --overwrite --tmpdir=false --platform=win32 --arch=ia32 --asar=true  --prune=true --out=release-builds -icon=assets/WIN_logo.ico"

Solution

  • Change -icon=assets/... to --icon=./assets/...

    The icon argument should have two hyphens at the start and the path should start with ./.