Search code examples
javascriptelectronelectron-packager

Shortcut icon not loading properly in electron-packager


Explanation

I'm trying to run electron-packager in my project, currently using a windows x64 and compiling a ia32 version, this is the package config inside my package.json:

"package": "electron-packager ./ --prune=true --arch=ia32 --win32metadata.ProductName=myProdName --icon=favicon.ico --overwrite=true"

The problem is, when the project is compiled the icon isn't displayed properly, but if I go in the properties the icon is the one selected, see the images below:

Icon displayed in the folder

https://image.prntscr.com/image/cXekfe0QTCa_wFY-LZs1IQ.png

Icon displayed in properties

https://image.prntscr.com/image/IHWu6xQDRy_acEhvCCw1IQ.png

Would like to get some help in this, really don't know what more can I do to get this right.


Solution

  • Already found the error, it was in my package JSON. Instead of:

       --icon=favicon.ico
    

    It sould be:

        --icon=./favicon.ico
    

    Needs the ./ in the start to identify