Electron.NET: default Electron icon is used reason=application icon is not set

  • 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.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (2 by maintainers)

Most upvoted comments

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"
    },

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.

@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"
    },

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

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

…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