asticode / go-astilectron-demo

Discover the power of Astilectron through a demo app
MIT License
404 stars 83 forks source link

How to set taskbar icon? #74

Closed linclt closed 2 years ago

linclt commented 2 years ago

I want to change this icon on the task bar image

and I find the Icon when use absolute path like this :C:/Users/Administrator/go/src/go-electron/resources/icon.ico ,it works. but when i copy the exe to another computer,because there is no icon.ico at C:/Users/Administrator/go/src/go-electron/resources/icon.ico,so the icon change to the electron icon image what i can do to solve this problem?

asticode commented 2 years ago

Right now there's no solution for that.

The following change would be needed in the lib : bootstrap.Window.Options should be func(a *astilectron.Astilectron) *bootstrap.WindowOptions instead of *boostrap.WindowOptions directly, so that you can use a.Paths().DataDirectory() when setting your absolute icon path.

But I won't have time to work on this issue anytime soon.

linclt commented 2 years ago

Right now there's no solution for that.

The following change would be needed in the lib : bootstrap.Window.Options should be func(a *astilectron.Astilectron) *bootstrap.WindowOptions instead of *boostrap.WindowOptions directly, so that you can use a.Paths().DataDirectory() when setting your absolute icon path.

But I won't have time to work on this issue anytime soon.

Thanks a lot! I will have a try myself!