Example of using s.install()
buzzlightyear2k opened this issue · comments
Can someone give me an easy example of using s.install() and s.run() to make service visible in Windows Service Manager please
You can use the service.Interactive
function to tell you if you are in a shell or in a service.
This is if you want to just run the exe to have it auto install itself.
runningInShell := service.Interactive()
if runningInShell {
s.Install()
return
}
err = s.Run()
if err != nil {
logger.Error(err)
}
The other way of doing it is to check for cli flags so you can do my-app.exe install
Check out #319 for a much better example though