Electron-packager: Icon not being added to .exe file

Created on 12 Nov 2015  路  9Comments  路  Source: electron/electron-packager

Hi,

I'm packaging an application with [email protected] on OS X El Capitan with the following command:

electron-packager . Herostratus \
    --platform=win32 \
    --arch=x64 \
    --version=0.34.2 \  
        --icon="assets/icon.ico" \
    --overwrite \
    --out=release/

The icon is added to the top left corner of the window and appears in the bottom bar on Windows 10, however I still see the default Electron icon when opening the directory with the file explorer.

Is there anything else I have to add to get the icon on the .exe file?

I also tested generating the package directly on Windows 10 in case the issue was wine-related but the results were the same.

Most helpful comment

I did two things and one of them solved the issue, but not sure which one:

  • I had a 1024x1024 *.png icon that I passed to BrowserWindow. I resized to 256x256.
  • Pass --asar to electron-packager.

All 9 comments

Perhaps it's because you don't have the appropriate icon size for the file explorer in your icon file?

@malept Sounds like that's the problem. Turns out my icon size is 16x16. What's the expected size? I can't find any documentation on the README.

I don't know offhand, I would look in the MSDN documentation. Personally, I just generate a whole bunch of common icon sizes in order to create the ICO and ICNS files for my app.

I have a multi-layered ico with the following sizes that still doesn't work:

  • 16x16
  • 32x32
  • 48x48
  • 64x64
  • 128x128
  • 256x256

I did two things and one of them solved the issue, but not sure which one:

  • I had a 1024x1024 *.png icon that I passed to BrowserWindow. I resized to 256x256.
  • Pass --asar to electron-packager.

i tried with --icon="./assets/icon.ico"
this works for me

I did two things and one of them solved the issue, but not sure which one:

  • I had a 1024x1024 *.png icon that I passed to BrowserWindow. I resized to 256x256.
  • Pass --asar to electron-packager.

The second

Passing --asar has zero impact on the icon embedded in the Windows executable.

first one turned out to be the solution for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TracyGJG picture TracyGJG  路  5Comments

Bharwcb picture Bharwcb  路  5Comments

andreabisello picture andreabisello  路  3Comments

NoahAndrews picture NoahAndrews  路  5Comments

kdawg1406 picture kdawg1406  路  4Comments