-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmain.go
59 lines (50 loc) · 1.28 KB
/
main.go
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
59
package main
import (
"bili-audio-downloader/services"
"embed"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/logger"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
"github.com/wailsapp/wails/v2/pkg/options/windows"
)
//go:embed all:frontend/dist
var assets embed.FS
// 全局版本号
const APP_VERSION string = "4.9.0"
const CONFIG_VERSION int = 2
func main() {
// Create an instance of the app structure
app := &App{}
// Init logger
customLogger, err := services.NewCustomLogger()
if err != nil {
println("Error:", err.Error())
return
}
// Create application with options
err = wails.Run(&options.App{
Title: "BiliAudioDownloader " + APP_VERSION,
Width: 1024,
Height: 720,
AssetServer: &assetserver.Options{
Assets: assets,
},
Frameless: true, // 无边框窗口
DisableResize: true, // 窗口尺寸
Windows: &windows.Options{
IsZoomControlEnabled: false, // 页面缩放比例
},
BackgroundColour: &options.RGBA{R: 255, G: 255, B: 255, A: 1},
OnStartup: app.startup,
OnShutdown: app.shutdown,
LogLevelProduction: logger.INFO,
Logger: customLogger,
Bind: []interface{}{
app,
},
})
if err != nil {
println("Error:", err.Error())
}
}