main.go 951 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package main
  2. import (
  3. "embed"
  4. "github.com/wailsapp/wails/v2"
  5. "github.com/wailsapp/wails/v2/pkg/options"
  6. "github.com/wailsapp/wails/v2/pkg/options/assetserver"
  7. )
  8. //go:embed all:frontend/dist
  9. var assets embed.FS
  10. func main() {
  11. // Create an instance of the app structure
  12. app := NewApp()
  13. // Create application with options
  14. err := wails.Run(&options.App{
  15. Title: "Vali-Tools",
  16. Width: 805,
  17. Height: 800,
  18. DisableResize: true, //禁止调整尺寸
  19. AssetServer: &assetserver.Options{
  20. Assets: assets,
  21. //Handler: utils.NewFileLoader(),
  22. },
  23. BackgroundColour: &options.RGBA{R: 255, G: 255, B: 255, A: 1},
  24. OnStartup: app.startup,
  25. SingleInstanceLock: &options.SingleInstanceLock{
  26. UniqueId: "141cdd5b-8167-4e2d-b738-8126a5f3fe46",
  27. OnSecondInstanceLaunch: app.onSecondInstanceLaunch,
  28. },
  29. Bind: []interface{}{
  30. app,
  31. },
  32. })
  33. if err != nil {
  34. println("Error:", err.Error())
  35. }
  36. }