mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
How to change the default icon inside of application? #797
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ZedZipDev on GitHub (Jun 2, 2022).
I'd like to change the default Electron.NET icon with my own. How can I do it?
I have tried in _Host.cshtml
It does not work.
Ok, then I did it in the Startup.cs
Again: does not work.
What I do wrong? How to change the default icon?
@ggomarighetti commented on GitHub (Jun 9, 2022):
Resume
The configuration to establish which will be the icon of your application as well as its relative location, is in electron.manifest.json.
In a default configuration you must go to line 18 of your configuration, position yourself at the end of the configuration and paste the attached code.
There you will have an idea to establish the relative directory of the icon that you want to use, in case of linux and mac I believe that it should be .png and in case of windows .ico.
Code
@Taster-git commented on GitHub (Jun 29, 2022):
How to do it for Linux ?????
@Jamie-Cappel-Chiron commented on GitHub (Jul 31, 2022):
Hmm.. Have tried the following above solution to no effect.
@jamieyello commented on GitHub (Jan 14, 2023):
I've tried fixing this for several days straight, I've tried putting the icon everywhere and I'm certain this must be some kind of bug.
I've tried the recommended
Then this (which worked for someone)
Still "application icon not set". I've tried converting it to a PNG as well. As a last-ditch effort, I have edited the compiled exe to swap out the icon, but I worry that may set off security warnings when deployed.
I've double, triple, and quadruple-checked to ensure that the path names are valid relative to the directory the console says it's running from. I've compared my project to the SilverR one as well, and I can't tell any difference.
So I guess my last ditch effort should be replacing the default ElectronNET builder icon in the builder program files themselves.
Here's my full electron.manifest.json
@jamieyello commented on GitHub (Jan 14, 2023):
Ok, so I found out that the "win" json object was in the wrong place in my manifest file.
In the above .json file, after moving the "win" section to be inside the "build" section it finally used the icon I wanted. So it was my fault, after all. No bug.