Nativefier: Windows icons aren't working

Created on 14 Aug 2016  路  25Comments  路  Source: jiahaog/nativefier

Description

I'm building on both Mac & Windows 7 machine w/ nativefier --name "My APP" "http//community.therms.io" -i ./icon.png -p windows and the Electron icon is the icon being used when opening the application (.exe) on windows.

Steps to Reproduce Issue

Specifications

  • Version of Nativefier (run $ nativefier --version): v7.0.1
  • Version of Node.js (run $ node --version): v4.3.1
  • OS: OSX & Windows 7
bug windows

Most helpful comment

Hey guys, the solution is to have your macOS/Linux installed w/ ImageMagick. On macOS, you can do:

brew install imagemagick

The root cause is: src/build/iconBuild.js relies on the bin/convertToIco shell script. And if you manually run the script it failed and let you know that ImageMagick is missed on your OS.

Thumb me if my solution solves your problem. ;-)

All 25 comments

I do see the icon being packaged in the build /../resources/app/icon.ico But why is that not used?

92

+1
Same issue

same issue here

@anyone figure out how to fix this issue?

+1
OSX icon generation working fine though

+1

+1

Anyone have a fix for this?

In my case the Icon is used while the app is running.
But not for the File-Icon.
I used a .png image.
I also checked the .exe with http://www.angusj.com/resourcehacker/
The .icon is inside, but there are 4 Images:
1: the .png file
2: Default image in 32x32
3: Default image in 48x48
4: Default image in 256x256
It seems, that the given icon is used, but ist left out in some places.

I successfully used Resource Hacker to update the Icon after the build.

+1

Hey guys, the solution is to have your macOS/Linux installed w/ ImageMagick. On macOS, you can do:

brew install imagemagick

The root cause is: src/build/iconBuild.js relies on the bin/convertToIco shell script. And if you manually run the script it failed and let you know that ImageMagick is missed on your OS.

Thumb me if my solution solves your problem. ;-)

Anyone managed a workaround/solution to this on Windows other than manually editing the exe?

I just found that instead using png file convert in an ico file with any tool online or offline, then use that generated ico when calling Nativefier. The documentation of Nativefier is not clear enough for windows.

@gasova Thanks!
I can confirm that it works on Windows!

nativefier --name "Example" --icon "C:/Users/Myuser/Desktop/Example.ico" --maximize "https://example.com"

I just found that instead using png file convert in an ico file with any tool online or offline, then use that generated ico when calling Nativefier. The documentation of Nativefier is not clear enough for windows.

@gasova thanks for the feedback 馃檪, would you mind submitting a doc PR clarifying what's to be done under Windows?

@ronjouch find out an online converter tool from png to ico then use my example code above

It works for me when I use the full path to the .png in quotes instead of "./file.png"

It does not work for me when using the full path to the .png in quotes. I still get:

Error: rcedit.exe failed with exit code 1. Cannot open icon file 'C'

Dropping the drive letter and the appending colon also fails with Cannot open icon file '\'

Trimming it even further results in Cannot open icon file 'U' (the first letter of Users).

So, for some reason, it gets as far as the first character in the path then quits.

Interestingly, if I remove the quotes and use a single . for the start of the path, e.g. .\resources\foo.png, the error becomes Cannot open icon file 'r'

...but, if I use .. in the path, as in ..\resources\foo.png it fails with Cannot open icon file '.'

Finally, it also fails if I move the .png to the working directory and call it with --icon foo.png, continuing to say that it Cannot open icon file 'f'

I found another clue about this bug... it seems that it won't recognize icons that are inside the C drive (or boot drive, perhaps?). But, when I moved the same icon file from C drive into somewhere else (mine is E), it seems to be working just fine.

Seems like the rcedit.exe is the root cause of this bug, after all.

In fact, this is the bug --> https://github.com/electron/rcedit/issues/56 It's an issue with rcedit.

I can confirm that it works on Windows!

nativefier --name "Example" --icon "C:/Users/Myuser/Desktop/Example.ico" --maximize "https://example.com"

Still same problem. I have windows 10, and OSX, and I can not set icon on ether system for Windows build. None of the suggestions work for me. And I have read all topics here and on electron support about this problem.

Unbelievable, but after trying everything from topics here, on electron and SO for days, I went to official electron documentation. And it worked on OSX by path to/icon.ico, IT NEED'S TO BE NAMED icon.ico. I was trying everything but icons where named differently. For OSX build it dos not. Its works with different names and .png of coarse.

I was getting error:
no such file or directory, open '/Applications/Advocatus-win32-x64/resources/app/icon.ico'] even obliviously name of my icons where different. So i changed it and it worked...

AND it does NOT work with --conceal

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasonivers picture jasonivers  路  4Comments

luco picture luco  路  4Comments

StyxOfDynamite picture StyxOfDynamite  路  4Comments

ranzou06 picture ranzou06  路  3Comments

danielyli picture danielyli  路  5Comments