packager: rcedit.exe failed with exit code 1. Fatal error: Unable to set icon
Electron packager doesn’t accept my icon file even though it is in the right dimensions and format. Icon.zip
PS C:\Users\abornst\Documents\ovt> electron-packager . CNTKVideoTagger --platform=win32 --icon=Icon.ico --arch=x64
Packaging app for platform win32 x64 using electron v1.6.2
rcedit.exe failed with exit code 1. Fatal error: Unable to set icon
PS C:\Users\abornst\Documents\ovt> electron-packager . CNTKVideoTagger --platform=win32 --icon=.Icon.ico --arch=x64
Packaging app for platform win32 x64 using electron v1.6.2
Wrote new app to C:\Users\user\Documents\ovt\CNTKVideoTagger-win32-x64
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 25 (13 by maintainers)
This is how I resolved the issue.
I had an macOS icon file named
icons.icnsand a Windows icon file namedicon.ico. This was my packagerConfig:No matter what I specified in my
electronWinstallerConfigI was still getting this error, even if I removed theiconkey from it. I finally tracked down the issue by finding my globally installedelectron-forgeand adding aconsole.logto thercedit.jsfile. It turns out thatrceditwas taking the the path fromelectronPackagerConfigand ignoring theelectronWinstallerConfig, then just renaming the extension to.ico. Sorceditcouldn’t find./src/assets/images/icons.icobecause it didn’t exist.Long story short: rename your icon files to have the same base name and in the same folder. In my case I now have these:
src/assets/images/icons.icnssrc/assets/images/icons.icoAnd everything works.
FWIW, I was seeing this same error when I tried building without an .ico file in the same directory as the .png specified in the config.
Following what @jaaromy did. I fixed mine with a config that looks like this:
If everything you say is accurate, then I’m inclined to believe that it’s a bug in rcedit. Packager doesn’t do anything except pass the icon path to rcedit, and it modifies the executable accordingly.