Electron-builder: Changing Icons (not updating on dist output)

Created on 21 Oct 2016  Â·  10Comments  Â·  Source: electron-userland/electron-builder

  • Version: 7.13.0

  • Target: mac

On the Mac, I'm changing the icons that are in the build folder. When I package the app, the new icon is not being updated consistently across all of the output files.

Is there a build-cache somewhere that I need to delete?

I have tried deleting the Xcode/DerivedData but that makes no difference.

Thanks.

feature mac question

All 10 comments

Do you mean that icon of your YourName.app in the Finder has old icon?

The build folder with the latest icon selected - looks like this:

image

The built dist folder after a build has this:

image

Which is a previous incarnation of the icon.

And the DMG when opened does have the latest version of the icon.

image

Furthermore, it's displaying differently on retina and non-retina screens:

Non-retina

image

Retina

image

I wonder if this is perhaps. the Finder caching things.

@philcockfield I did a bit of research on the topic - and it seems that your hunch was correct - see here for a potential fix for it!

I can confirm, that it is Finder cache issue — not your app or electron-builder issue.

Pulling a bunch of those suggestions together, I have this "nuke'em" set of commands:

sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {};
sudo find /private/var/folders/ -name com.apple.iconservices -exec rm -rf {};
sudo rm -rf /Library/Caches/com.apple.iconservices.store
killall Dock
killall Finder

Not totally working - the DMG is still lagging behind, but some of the icons are now updating. Thanks everyone.

Help-wanted — electron-builder should not confuse users. Probably we should touch application executable to update cache.

What would be the file to touch?

In this case, would it be:

touch /<path>/dist/mac/Team DB.app
touch /<path>/dist/mac/Team DB.app/Contents/Info.plist

image

8.4.1+ will touch .app directory.

Awesome.

Was this page helpful?
0 / 5 - 0 ratings