Windows assets, check hash while upload

This commit is contained in:
Aurélie Delhaie
2022-06-16 22:45:24 +02:00
parent 5ed0cfa837
commit 86b0924148
17 changed files with 277 additions and 37 deletions

47
main_windows.go Normal file
View File

@@ -0,0 +1,47 @@
//go:build windows
package main
import (
_ "embed"
"github.com/getlantern/systray"
"opensavecloudserver/constant"
"opensavecloudserver/server"
"os"
)
//go:generate go-winres make
//go:embed tray.ico
var icon []byte
func main() {
go func() {
InitCommon()
server.Serve()
}()
systray.Run(onReady, onExit)
}
func onReady() {
systray.SetIcon(icon)
systray.SetTitle("Open Save Cloud Server")
systray.SetTooltip("Open Save Cloud Server")
systray.AddMenuItem("Open Save Cloud", "").Disable()
systray.AddMenuItem(constant.Version, "").Disable()
systray.AddSeparator()
mQuit := systray.AddMenuItem("Quit", "Quit the server")
select {
case <-mQuit.ClickedCh:
quit()
}
}
func quit() {
systray.Quit()
os.Exit(0)
}
func onExit() {
systray.Quit()
}