-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmain.go
More file actions
58 lines (51 loc) · 1.13 KB
/
main.go
File metadata and controls
58 lines (51 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package main
import (
"embed"
"log"
"net"
"os"
"playfast/internal/path"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
)
//go:embed all:frontend/dist
var assets embed.FS
//go:embed build/windows/icon.ico
var logo []byte
var Version = "1.0.0"
func main() {
dial, err := net.Dial("tcp", "127.0.0.1:54712")
if err == nil {
_, _ = dial.Write([]byte("SHOW_WINDOW"))
_ = dial.Close()
return
}
appLog := path.Path() + "/app.log"
log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
open, err := os.Create(appLog)
if err == nil {
log.SetOutput(open)
}
// Create an instance of the app structure
app := NewApp()
// Create application with options
err = wails.Run(&options.App{
Title: "PlayFast",
Width: 576,
Height: 384,
BackgroundColour: &options.RGBA{R: 75, G: 0, B: 130, A: 1},
AssetServer: &assetserver.Options{
Assets: assets,
},
OnStartup: app.startup,
DisableResize: true,
HideWindowOnClose: true,
Bind: []interface{}{
app,
},
})
if err != nil {
log.Fatal(err)
}
}