Electron-packager: Electron-packager windows icon not being updated

Created on 13 Jan 2017  路  8Comments  路  Source: electron/electron-packager

Im setting up my icon to my electron-packager cli, but its not working. I think theres some type of cache being saved somewhere. The icon is definitely working though. Whe I goto properties the icon is correct, but the main icon on the exe is showing the original electron app icon.

How can I change it heres the code im using for icon:

--icon=src/assets/icons/win/icon.ico
windows needs info

Most helpful comment

@malept It's not clear

  • is it already installed electron-packaged app
  • or is it only compiled not packed into installer

Also clear C:\Users...\AppData\Local\IconCache.db

And drag compiled exe to desktop to see if default electron icon changes to that of yours

All 8 comments

My guess is that it's probably a caching issue. Try copying the already built EXE to a different machine.

Yeah, thats what I am thinking also. Okay I will try that

I also can't get it to work, it's always electron app icon.

Just so I'm clear, when I say "caching issue", I mean some sort of built-in Windows icon cache.

My inclination is that this problem does not originate with Electron Packager. This is because Electron Packager passes all of the win32 target icon information verbatim to the node-rcedit module. If it doesn't have to do with the Windows icon cache, then it's a bug either there or in rcedit.

@AhadCove

use .ico not .png for windows

app.on("ready", function () {
    // create the window
    mainWindow = new BrowserWindow({
            width : 844,
            height : 640,
            icon : "favicon.ico",
            title : "My app"
        });`

If you launch electron ./index.js higher when www folder

and iindex.js says to launch
mainWindow.loadURL("file://" + __dirname + "/www/index.html");

you should have two same .ico:
./favicon.ico
./www/favicon.ico

on windows for nwjs use .png icon, not .ico
That's for development

@englishextra I'm not sure that's what the problem is.

@malept It's not clear

  • is it already installed electron-packaged app
  • or is it only compiled not packed into installer

Also clear C:\Users...\AppData\Local\IconCache.db

And drag compiled exe to desktop to see if default electron icon changes to that of yours

using .ico when instantiating a BrowserWindow works for me. Thanks, @englishextra

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wgrhstf picture wgrhstf  路  4Comments

Orrison picture Orrison  路  3Comments

akcorp2003 picture akcorp2003  路  4Comments

dland512 picture dland512  路  5Comments

Bharwcb picture Bharwcb  路  5Comments