Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default Electron icon is used reason=application icon is not set #292

Closed
Marcelh1983 opened this issue Jul 16, 2019 · 13 comments
Closed

default Electron icon is used reason=application icon is not set #292

Marcelh1983 opened this issue Jul 16, 2019 · 13 comments
Assignees
Labels

Comments

@Marcelh1983
Copy link

  • ElectronNET.API 5.22.13, netcoreapp2.2, electron-builder version=20.44.4, node 10.10.0:
  • Target: windows

I use the win/icon option to add my own app icon:

    "win": {
      "icon": "Assets/icon.ico"
    },

electron-builder keeps logging:

default Electron icon is used reason=application icon is not set

I also tried ElectronNET.WebApp which gives the same message.

@robalexclark
Copy link

Its probably not a bug. It took me aaages to get it to work. If you don't get the path to your icon correct from the "current working folder" it defaults to the electron icon and you get that message. Take a look at this repo and the electron.manifest.json there. Determine the path to icon.png and compare to your own settings.

@Marcelh1983
Copy link
Author

@robalexclark thank you so much! This fixed it. I created a pull request to fix it in the example aswell.

@alexwiese
Copy link

For anyone else hitting this I found that I had to prefix the directory with bin to get it to work:

"win": {
      "icon": "bin/Assets/favicon.ico"
    },

@MrCircuit
Copy link

My project did not work with an ICO file. Converting it to PNG worked instead. Maybe the fact, that the ICO had two embedded resolutions broke the feature?

@GregorBiswanger GregorBiswanger self-assigned this Feb 28, 2020
@GregorBiswanger
Copy link
Member

Electron-builder is used to integrate the icon. In the electron.manifest.json file, the entire build part is the 1:1 configuration of electron-builder. Best for problems, google for electron builder and icons...

@pmagnussen
Copy link

pmagnussen commented Apr 28, 2021

The following worked for me:
"win": { "icon": "../../../Assets/reporting_tool.ico", "publish": [ { "provider": "github", "owner": "ElectronNET", "repo": "electron.net-api-demos", "token": ">> Insert GH_TOKEN here! <<" } ] }

@Mondonno
Copy link

Mondonno commented Jun 8, 2021

Anyone solved this? or anyone have a method how to add custom icon into the electron.net app?

@schaveyt
Copy link

schaveyt commented Nov 8, 2021

@Mondonno

"build": {
    "appId": "...",
    . . .
    . . .
    "directories": {
      "output": "../../../bin/Desktop"
    },
    "nsis": {
      "oneClick": true,
      "perMachine": true
    },
    "win": {
       // This path is relative to the `{.net project folder}`\obj\desktop\win
      "icon": "../../../wwwroot/favicon.ico"
    },

@raydeo
Copy link

raydeo commented Jan 20, 2022

...and for mac use this.

{
  "name": "YOOOOOOO!",
  "version": "1.0.0",
  "description": "the easy way to add logo and installer background",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  },
  "repository": "https://github.com",
  "keywords": [
    "Electron"
  ],
  "build": {
    "appId": "com.SUPPLIER.APP_NAME",
    "mac": {
      "category": "public.app-category.utilities",
      "target": "dmg"
    },
    "extraResources": [
      "res",
      "favicon.png"
    ],
    "directories": {
      "buildResources": "build",
      "output": "OH-YEAH"
    }
  },
    ...additional stuff after

Make sure you got 'build' folder on the same level as your package.json is located, with 'icon.png' size >= 512x512

If you want to add a background splash picture to the installer just drop an image with the name 'background.png' in the build folder also.

Screenshot 2022-01-20 at 00 37 25

@danatcofo
Copy link
Contributor

As a side note, Mac also supports the pkg target.

@mazm786
Copy link

mazm786 commented Jan 27, 2022

For anyone else hitting this I found that I had to prefix the directory with bin to get it to work:

"win": {
      "icon": "bin/Assets/favicon.ico"
    },

Please also mention solution for linux

@Taster-git
Copy link

Electron-builder is used to integrate the icon. In the electron.manifest.json file, the entire build part is the 1:1 configuration of electron-builder. Best for problems, google for electron builder and icons...

Please post an example of icon in Linux. Png file path is set but it displays system default icon at system tray. (Neither it is electron default nor my custom icon. While I want to set custom icon.)

@Silvenga
Copy link

Silvenga commented Aug 3, 2022

FWIW - Linux has oddities documented here: https://www.electron.build/configuration/linux

Tldr: filename matters.

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

No branches or pull requests