mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
How Change Default Icon #155
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 @ma9091 on GitHub (May 8, 2018).
Originally assigned to: @robertmuehsig on GitHub.
@R00iBaard commented on GitHub (Jun 13, 2018):
I find this crazy you need to fork to be able to do this???
dotnet electronize build /target win /electron-params "--icon="assets/app-icon/win/lci.ico""I tried this, produces the following which looks right -
electron-packager . --platform=win32 --arch=x64 --icon=assets/app-icon/win/lci.ico --out="C:\Users\davidroux\Halo Software\Halo\DeviceManagement\bin\desktop" --overwriteHowever get the following error
Packaging app for platform win32 x64 using electron v1.7.11
WARNING: Found 'electron' but not as a devDependency, pruning anyway
rcedit.exe failed with exit code 1. Cannot open icon file 'a'
Fatal error: Unable to set icon
Also attempted inside startup.cs but not winning there :
var browserWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions { Center = true, Width = 1152, Height = 864, Show = true, Icon = @"~/assets/app-icon/win/lci.ico" });@robertmuehsig commented on GitHub (Jun 13, 2018):
Hi - this is indeed quite stupid to fork the whole project. AFAIK icons are stupid to setup (at least the macOS icons are created in a different way) but I might be wrong here. Could you tell me how the electron-packager needs to be invoked to insert the correct icons?
@R00iBaard commented on GitHub (Jun 13, 2018):
Hey @robertmuehsig, thanks for the fast reply! I was using this link to figure out what I provided above : https://www.christianengvall.se/electron-packager-tutorial/#windows
@arjo1203 commented on GitHub (Nov 26, 2018):
Hey @ma9091 it looks like there are two issues with the way you are passing the path of the icon to the electron-packager via the ElectronNet command:
--out="C:\Users\davidroux\Halo Software\Halo\DeviceManagement\bin\desktop"NOTE how the out path had quotation marks around it
Your example should be modified like so,
--icon=assets/app-icon/win/lci.ico====>--icon="C:\absolute\path\to\icon.ico"In order to produce this with ElectronNet, you must format the icon path like so,
"--icon="assets/app-icon/win/lci.ico""==>"--icon=\"assets/app-icon/win/lci.ico\""Doing this, includes the quotation marks and will resolve your issue.
@GregorBiswanger commented on GitHub (May 18, 2019):
Available with the next Electron.NET update.