System tray icon
See original GitHub issueSystem tray icon shows in development mode, but not after packaging the app. Any workaround to this?
This is how I add the icon
let tray = new Tray(
nativeImage.createFromPath(
path.join(__dirname, 'resources', 'icons', '24x24.png')
)
);
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
What is system tray in Windows? - TechTarget
An icon can be placed in the system tray when a program is installed by making an entry in the system registry or...
Read more >How to Customize and Tweak Your System Tray Icons in ...
To further customize your notification area icons, click the “Customize” link behind the up arrow. You can also right-click your taskbar, select ...
Read more >Customize the taskbar notification area - Microsoft Support
To change how icons and notifications appear · Press and hold or right-click any empty space on the taskbar and select Taskbar settings....
Read more >Windows 10 - System Tray - Tutorialspoint
The System Tray is another name given to the Notification Area, which we can find in the right-side of the Windows Taskbar. The...
Read more >The Windows 10 system tray - How to show or hide icons!
Another method for displaying the hidden icons in the system tray involves accessing the Taskbar settings. To do that, right-click or press-and- ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I figured it out with help from the electron-builder docs and https://stackoverflow.com/a/46033483/530309
I moved my tray icon into a new folder called
[my_project]/extraResources.Then I added a electron-builder definition for “extraResources” in
[my_project]/package.json. For me, that looks like:Then, when referencing the tray icon by name, I use a new getAssetPath() function so that it can be found in dev mode and when packaged. Here’s that:
Hope this helps others who are new to Electron. Anyone know a better way? Should this be something that’s added to this boilerplate project, or did I miss how the boilerplate recommends to do this?
My problem with packaging of an embedded sqlite db with prepared data is now solved, thank you very much!