5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 16:02:07 +08:00
wails/v2/internal/app/preflight_windows.go
Eng Zer Jun ae341be638
chore: run go fmt ./... and go mod tidy
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-11-25 12:14:27 +08:00

28 lines
807 B
Go

//go:build windows
// +build windows
package app
import (
"github.com/wailsapp/wails/v2/internal/ffenestri/windows/wv2runtime"
"github.com/wailsapp/wails/v2/pkg/options"
)
func (a *App) PreflightChecks(options *options.App) error {
_ = options
// Process the webview2 runtime situation. We can pass a strategy in via the `webview2` flag for `wails build`.
// This will determine how wv2runtime.Process will handle a lack of valid runtime.
installedVersion, err := wv2runtime.Process()
if installedVersion != nil {
a.logger.Debug("WebView2 Runtime installed: Name: '%s' Version:'%s' Location:'%s'. Minimum version required: %s.",
installedVersion.Name, installedVersion.Version, installedVersion.Location, wv2runtime.MinimumRuntimeVersion)
}
if err != nil {
return err
}
return nil
}