Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example or info how to run Systray as a service in Windows #21

Closed
niels-s opened this issue Oct 4, 2016 · 3 comments
Closed

Example or info how to run Systray as a service in Windows #21

niels-s opened this issue Oct 4, 2016 · 3 comments

Comments

@niels-s
Copy link

niels-s commented Oct 4, 2016

Hi there,

I'm looking around to see if I can find a solution to run my go binary as a service in windows. I've tried a couple things already:

  1. I've tried using this go lib to setup a service but unfortunately this won't work nicely together with Systray since we need to start the ui in main: github.com/kardianos/service
  2. Another approach I've tried is NSSM. While is was able to register a simple dummy go app printing a message every 5 seconds. NSSM doesn't play nice with Systray.

I'm hoping some of you can share you experiences on how you run you app's as a service on Windows in combination with Systray.

Thanks!

@myleshorton
Copy link
Contributor

hey @niels-s -- in my experience windows services in general are a bit of a nightmare -- super cumbersome and error prone. If you want something to just run at startup, all you need is a registry setting. That's what lantern does.

@niels-s
Copy link
Author

niels-s commented Oct 7, 2016

@myleshorton thanks for the info found the NSI script for lantern here

@niels-s niels-s closed this as completed Oct 7, 2016
@phoenix147
Copy link

Since i came around the same problem, i just wanted to add, that it is technically impossible to show a system tray for processes running as service in windows. You have to write a second indicator application, that runs with user privileges, and somehow communicates with the service.

Mysql for example does this with its Notifier program.

bdwyertech pushed a commit to bdwyertech/systray that referenced this issue Dec 19, 2022
Cleanly quit systray when app exits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants