mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 20:03:01 +08:00
[windows] Handle naked go build
This commit is contained in:
parent
78c43d23b6
commit
c9f93cd313
29
v2/internal/appng/app_default.go
Normal file
29
v2/internal/appng/app_default.go
Normal file
@ -0,0 +1,29 @@
|
||||
//go:build !dev && !production && windows
|
||||
|
||||
package appng
|
||||
|
||||
import (
|
||||
"github.com/leaanthony/winc/w32"
|
||||
"github.com/wailsapp/wails/v2/pkg/options"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
// App defines a Wails application structure
|
||||
type App struct{}
|
||||
|
||||
func (a *App) Run() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// CreateApp creates the app!
|
||||
func CreateApp(_ *options.App) (*App, error) {
|
||||
result := w32.MessageBox(0,
|
||||
`Wails applications will not build without the correct build tags.
|
||||
Please use "wails build" or press "OK" to open the documentation on how to use "go build"`,
|
||||
"Error",
|
||||
w32.MB_ICONERROR|w32.MB_OKCANCEL)
|
||||
if result == 1 {
|
||||
exec.Command("rundll32", "url.dll,FileProtocolHandler", "https://wails.io").Start()
|
||||
}
|
||||
return nil, nil
|
||||
}
|
Loading…
Reference in New Issue
Block a user