How to set app icon for Electron / Atom Shell App

前端 未结 9 1435
无人及你
无人及你 2020-11-29 17:00

How do you set the app icon for your Electron app?

I am trying BrowserWindow({icon:\'path/to/image.png\'}); but it does not work.

Do I need to p

9条回答
  •  一向
    一向 (楼主)
    2020-11-29 17:31

    If you want to update the app icon in the taskbar, then Update following in main.js (if using typescript then main.ts)

    win.setIcon(path.join(__dirname, '/src/assets/logo-small.png'));
    

    __dirname points to the root directory (same directory as package.json) of your application.

提交回复
热议问题