electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.57k stars 1.73k forks source link

App icon with Windows appx build not working as it should according to the documentation #7811

Open mathias-berg opened 11 months ago

mathias-berg commented 11 months ago

Hi,

This issue is kind of strange, but very easy to reproduce. I have found a few people having this issue when searching, but not any solution that works.

The platforms that works for me as it should is MacOS and Windows (nsis build). The one that I am struggling with is the appx build.

According to the documentation you should put your app icon in the build folder or the one that you assign as such in package.json at buildResources. I use the default build.

My app icon is icon.ico for Windows and icon.icns for Mac (could as well be icon.png).

When building a nsis build, I get my expected icon, but when building for appx, I get the default Electron icon. The only thing I could get some other icon than the default Electron one is if I also add an logo named StoreLogo.png in build/appx.

Look at the attached images. The one to the left is a nsis build and the one to the right is an appx build. They are built right after each other, nothing is changed.

Skärmavbild 2023-10-05 kl  19 32 32

When hovering the app icons, I get these results. Here you can actually see the wanted icon in the appx build in the top left preview (coming from icon.ico).

nsis:

Skärmavbild 2023-10-05 kl  19 32 45

appx:

Skärmavbild 2023-10-05 kl  19 32 52

One more thing. When I added the StoreLogo.png image on the appx build, you will see a blue background on the image, that is a bit hard to see on this image. I have tried to use the backgroundColor property set to transparent (in package.json), or any other color, but that doesn't seem to affect it all.

One last image from recent used apps.

Skärmavbild 2023-10-05 kl  19 31 59

Why does nsis work as expected and why doesn't appx?

So either is the documentation needs an update or the implementation has some flaws.

Thanks in advance!

github-actions[bot] commented 9 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

mathias-berg commented 9 months ago

Not stale, still a problem.

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

PKZatWork commented 4 months ago

I am seeing similar issues with the toolbar icon. When I build my app and run the exe in the win-upacked folder, the icon is larger than the icon that appears when running the appx build.

electron\dist.icon-ico\icon.ico filesize is 256x256. electron\appx\icon.png is 512x512. electron-builder version 24.6.3

electron-build.config.json: ... "win": { "target": [ { "target": "appx", "arch": ["x64"] } ], "icon": "build/appx/StoreLogo.png", "electronLanguages": "en-US" }, ...