question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rcedit.exe failed with exit code 1. Fatal error: Unable to set icon

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:25 (13 by maintainers)

github_iconTop GitHub Comments

8reactions
Jaaromycommented, Jun 1, 2018

This is how I resolved the issue.

I had an macOS icon file named icons.icns and a Windows icon file named icon.ico. This was my packagerConfig:

"electronPackagerConfig": {
	"packageManager": "npm",
	"icon": "./src/assets/images/icons.icns",
	"asar": true
},

No matter what I specified in my electronWinstallerConfig I was still getting this error, even if I removed the icon key from it. I finally tracked down the issue by finding my globally installed electron-forge and adding a console.log to the rcedit.js file. It turns out that rcedit was taking the the path from electronPackagerConfig and ignoring the electronWinstallerConfig, then just renaming the extension to .ico. So rcedit couldn’t find ./src/assets/images/icons.ico because 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.icns src/assets/images/icons.ico

And everything works.

6reactions
positlabscommented, Apr 21, 2018

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.

  "electronPackagerConfig": {
    "packageManager": "npm",
    "icon": "./src/assets/imgs/icon-1024.png"
  },
screen shot 2018-04-21 at 2 09 32 pm
Read more comments on GitHub >

github_iconTop Results From Across the Web

How I Fixed: Electron builder rcedit-x64.exe": file does not ...
This is likely a very specific issue to my setup, but on the off chance ... I kept hitting the following error, causing...
Read more >
When I use electron-builder to package an NSIS program ...
When I use electron-builder to package an NSIS program, I get: Fatal error: Unable to parse version string for FileVersion.
Read more >
Issue while creating .exe file using electron builder
default Electron icon is used reason=application icon is not set ? cannot execute cause=exit status 1 errorOut=Fatal error: Unable to commit ...
Read more >
rcedit设置exe文件的icon图标和信息
Fatal error : Unable to set icon ... go语言从windows的exe中获取icon图标 ... electron打包Error: rcedit.exe failed with exit code 1.
Read more >
It is impossible to add an icon to a standalone .exe file.
Error : Could not load game data at path '.'. Is the .pck file missing? Yes, "Embed Pck" is enabled in the export...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found