asticode / go-astilectron

Build cross platform GUI apps with GO and HTML/JS/CSS (powered by Electron)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to change icon for windows application

asdfsx opened this issue · comments

I'm trying to build windows application on macOS, and I met a problem that the icon of the application can not change.

I build the application with the command astilectron-bundler -c "bundler-win.json" -ldflags "-linkmode external -extldflags -static", and the bundler.json is like below

{
  "app_name": "desktop",
  "icon_path_darwin": "resources/icon.icns",
  "icon_path_linux": "resources/icon.png",
  "icon_path_windows": "resources/icon.ico",
  "environments": [
    {
      "arch": "amd64", 
      "os": "windows",
      "env": {
        "CC": "x86_64-w64-mingw32-gcc",
        "CXX": "x86_64-w64-mingw32-g++",
        "CGO_ENABLED": "1"
      }
    }
  ]
}

But the icon always be image
So I want to know how to update the icon for the windows application.

Did you change the icon located at resources/icon.ico?

yes, I have change the icon.

When I use regular icon or extra large icon in file explorer, the application show as
image

When I use medium icon, the application show the icon I replaced
image

Now I'm very confused about this

I think the problem is caused by the ico file I make. And the windows icon cache made the problem more confuse.
After I recreate the ico file and clean the cache, the problem solved.