Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Can't create right icon on windows #23

Open
EragonJ opened this issue Sep 25, 2015 · 3 comments
Open

Can't create right icon on windows #23

EragonJ opened this issue Sep 25, 2015 · 3 comments

Comments

@EragonJ
Copy link

EragonJ commented Sep 25, 2015

As title, after putting right path into winIcon field (with right format : name.ico), gulp-atom-electron still can't show the icon on Windows. After reading through the codebase, it seems that rcedit.exe does executed and put contents into .exe.

In order to make the test more accurate, I made the build on Windows 10 to make sure rcedit.exe would execute correctly. Any idea ?

@joaomoreno
Copy link
Owner

Can you download rcedit and make sure it executes in Windows 10?

@Janneman84
Copy link

I experienced the same problem, the icon didn't change and neither did the version numbers, so Rcedit didn't seem to work. With some experimenting I found that it most probably has something to do with it being called right between the copying and zipping of the file. Probably some caching/async/concurrency/filesystem thing.

I tried forcing a wait by generating a while loop before and after the Rcedit call. I know it's dirty but it seemed to have worked. Strange thing is that even when I remove these loops now it still seems to keep working right.

distributeWinIcon = function(src, targetAppPath) {
return new Promise(function(resolve) {
var stop = new Date().getTime();
while(new Date().getTime() < stop + 3000) {
;
}
rcedit( targetAppPath, src, resolve);
stop = new Date().getTime();
while(new Date().getTime() < stop + 3000) {
;
}
return resolve();
});
};

First check if the metadata has updated properly by checking the properties of the .exe file, check the details tab. You can set the desired metadata in the gulp file under 'win:', check the available options here: https://github.com/unindented/grunt-rcedit#usage

If the metadata has updated you know that rcedit worked. If however the icon hasn't updated or only partially (check all sizes by using ctrl+mouse wheel in the file explorer) you might want to try a reboot. You can even try swiping the icon cache: http://www.thewindowsclub.com/rebuild-the-icon-cache-windows

You could also try running the console as administrator, but I doubt that you need to do that.

@joaomoreno
Copy link
Owner

I'm pretty sure this is related to a missing Visual C++ Redistributable. Can you install that and check whether it works?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants