goWindowsService

command module
v0.0.0-...-c5cff33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2020 License: BSD-3-Clause Imports: 13 Imported by: 0

README

goWindowsService

what we do?

Step1.Run Service as SYSTEM

Step2.Run app.exe(config.go) as an administrator(current user) when your system startup

1.Star this project ,haha

2.clone to your workspace

go get github.com/hkloudou/goWindowsService

3.config.go

package main

var serviceName = "Your Service Name"
var serviceDisplayName = "Your ServiceDisplayName"
var serviceDescription = "https://github.com/hkloudou/goWindowsService"

var appPath = "app.exe"   // your app path

4.build

windows(recommend)
go install github.com/akavel/rsrc

run build.bat

mac
brew install mingw-w64

env CGO_ENABLED=1 GOOS=windows GOARCH=386 CC=i686-w64-mingw32-gcc go build -ldflags="-w -s" -o output/service.exe

5.copy

  1. copy your allpication "app.exe"(same as config.go) to output dictionary
  2. pack your output directory as a zip
  3. run output/install.bat

TIP: add -ldflags="-w -s -H windowsgui" to build windowless app when you biuld your own app.exe.

  1. https://gist.github.com/LiamHaworth/1ac37f7fb6018293fc43f86993db24fc
  2. https://github.com/joesilva01862/ScreenshotWindowsService
  3. https://github.com/akavel/rsrc
  4. github.com/kardianos/service

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL