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

Closed
opened 2026-01-29 16:37:34 +00:00 by claunia · 18 comments
Owner

Originally created by @Marcelh1983 on GitHub (Jul 16, 2019).

Originally assigned to: @GregorBiswanger on GitHub.

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

Originally created by @Marcelh1983 on GitHub (Jul 16, 2019). Originally assigned to: @GregorBiswanger on GitHub. * **ElectronNET.API 5.22.13, netcoreapp2.2, electron-builder version=20.44.4, node 10.10.0**: <!-- What target are you building for? --> * **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.
claunia added the bug label 2026-01-29 16:37:34 +00:00
Author
Owner

@robalexclark commented on GitHub (Jul 16, 2019):

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.

@robalexclark commented on GitHub (Jul 16, 2019): 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 ](https://github.com/robalexclark/SilveR) and the electron.manifest.json there. Determine the path to icon.png and compare to your own settings.
Author
Owner

@Marcelh1983 commented on GitHub (Jul 17, 2019):

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

@Marcelh1983 commented on GitHub (Jul 17, 2019): @robalexclark thank you so much! This fixed it. I created a pull request to fix it in the example aswell.
Author
Owner

@alexwiese commented on GitHub (Jan 16, 2020):

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"
    },
@alexwiese commented on GitHub (Jan 16, 2020): 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" }, ```
Author
Owner

@MrCircuit commented on GitHub (Feb 27, 2020):

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?

@MrCircuit commented on GitHub (Feb 27, 2020): 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?
Author
Owner

@GregorBiswanger commented on GitHub (Feb 28, 2020):

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

@GregorBiswanger commented on GitHub (Feb 28, 2020): 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...
Author
Owner

@pmagnussen commented on GitHub (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! <<" } ] }

@pmagnussen commented on GitHub (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! <<" } ] } `
Author
Owner

@Mondonno commented on GitHub (Jun 8, 2021):

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

@Mondonno commented on GitHub (Jun 8, 2021): Anyone solved this? or anyone have a method how to add custom icon into the electron.net app?
Author
Owner

@schaveyt commented on GitHub (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"
    },
@schaveyt commented on GitHub (Nov 8, 2021): @Mondonno ~~~json "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" }, ~~~
Author
Owner

@raydeo commented on GitHub (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

@raydeo commented on GitHub (Jan 20, 2022): ...and for mac use this. ```json { "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](https://user-images.githubusercontent.com/29735453/150241117-1ce45832-ed3f-474d-a238-c22ab546376e.png)
Author
Owner

@danatcofo commented on GitHub (Jan 20, 2022):

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

@danatcofo commented on GitHub (Jan 20, 2022): As a side note, Mac also supports the pkg target.
Author
Owner

@mazm786 commented on GitHub (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

@mazm786 commented on GitHub (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
Author
Owner

@Taster-git commented on GitHub (Jun 29, 2022):

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

@Taster-git commented on GitHub (Jun 29, 2022): > 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.)
Author
Owner

@Silvenga commented on GitHub (Aug 3, 2022):

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

Tldr: filename matters.

@Silvenga commented on GitHub (Aug 3, 2022): FWIW - Linux has oddities documented here: https://www.electron.build/configuration/linux Tldr: filename matters.
Author
Owner

@ManBearPigg commented on GitHub (May 22, 2024):

On Linux I had to give the png dimensions as the file name.

"build": {
      "appId": "com.mangearpigg.ChatGUI",
      "linux": {
        "target": "AppImage",
        "category": "Utility",
       "icon": "512x512.png"
      }
 },

Where the icon is just a png in the same root directory that package.json is in. To be clear, if the png is called icon.png, or icon_512x512.png, or anything else other than 512x512.png, it won't work.

@ManBearPigg commented on GitHub (May 22, 2024): **On Linux I had to give the png dimensions as the file name.** ``` "build": { "appId": "com.mangearpigg.ChatGUI", "linux": { "target": "AppImage", "category": "Utility", "icon": "512x512.png" } }, ``` Where the icon is just a png in the same root directory that package.json is in. To be clear, if the png is called icon.png, or icon_512x512.png, or anything else other than 512x512.png, it won't work.
Author
Owner

@aldairl commented on GitHub (Jul 17, 2024):

Config the "buildResources" folder in your config:

 "build": {
    "appId": "p",
    "productName": "p",
    "asar": true,
    "asarUnpack": "**\\*.{node,dll}",
    "files": [
      "build",
      "node_modules",
      "package.json"
    ],
    "directories": {
      "app": "./",
      "output": "app-build",
      "buildResources": "src/assets"
    },
    "win": {
      "target": [
        "nsis"
      ],
      "publish": [
        "github"
      ]
    }
  },
@aldairl commented on GitHub (Jul 17, 2024): Config the "buildResources" folder in your config: ``` "build": { "appId": "p", "productName": "p", "asar": true, "asarUnpack": "**\\*.{node,dll}", "files": [ "build", "node_modules", "package.json" ], "directories": { "app": "./", "output": "app-build", "buildResources": "src/assets" }, "win": { "target": [ "nsis" ], "publish": [ "github" ] } }, ```
Author
Owner

@theamanullahdev commented on GitHub (Jan 23, 2025):

Anyone knows, how to do on electron-vite (it also uses electron builder though) on linux and windows. the exported deb or win exe give same warning and use default icon. but i have icon.png in resources folder.

Also can some one tell where to add this:
"build": {
"icon" : "icon.png"
},
in electron-builder.yml file or package.json file?

@theamanullahdev commented on GitHub (Jan 23, 2025): Anyone knows, how to do on electron-vite (it also uses electron builder though) on linux and windows. the exported deb or win exe give same warning and use default icon. but i have icon.png in resources folder. Also can some one tell where to add this: "build": { "icon" : "icon.png" }, in electron-builder.yml file or package.json file?
Author
Owner

@aldairl commented on GitHub (Jan 23, 2025):

I set the config in package.json file. look a simple config:

... "devDependencies": { "@types/react": "^18.2.66", ... }, "eslintConfig": { "extends": "standard" }, "build": { "appId": "app_namen", "files": [ "dist/**/*", "electron/**/*" ], "directories": { "buildResources": "src/assets" }, "win": { "icon": "assets/icon.ico" } }

@aldairl commented on GitHub (Jan 23, 2025): I set the config in package.json file. look a simple config: `... "devDependencies": { "@types/react": "^18.2.66", ... }, "eslintConfig": { "extends": "standard" }, "build": { "appId": "app_namen", "files": [ "dist/**/*", "electron/**/*" ], "directories": { "buildResources": "src/assets" }, "win": { "icon": "assets/icon.ico" } }`
Author
Owner

@ozirisdark commented on GitHub (May 22, 2025):

All this doesn't work (win)

@ozirisdark commented on GitHub (May 22, 2025): All this doesn't work (win)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#360