5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 06:59:18 +08:00
wails/v2/internal/system/system_windows.go
Nan0 2065600096
Feature: set browser path (#1448)
* Added option to specify webview2 path

* Added `manual` webview strategy

* Update documentation

* Fixed build with manual tag

* Check for browser directory existence

* Added version check for manually specified webview, removed fallback for installed webview in manual strategy

* Update WebviewBrowserPath documentation

* Replaced deprecated StringToUTF16Ptr

* Return on error

* Removed manual strategy, return error in wv2installer for fixed runtime

* Removed manual strategy from CLI
2022-06-25 07:49:00 +10:00

45 lines
1.1 KiB
Go

//go:build windows
// +build windows
package system
import (
"github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/go-webview2/webviewloader"
"github.com/wailsapp/wails/v2/internal/system/operatingsystem"
"github.com/wailsapp/wails/v2/internal/system/packagemanager"
)
func (i *Info) discover() error {
var err error
osinfo, err := operatingsystem.Info()
if err != nil {
return err
}
i.OS = osinfo
i.Dependencies = append(i.Dependencies, checkWebView2())
i.Dependencies = append(i.Dependencies, checkNPM())
i.Dependencies = append(i.Dependencies, checkUPX())
i.Dependencies = append(i.Dependencies, checkNSIS())
//i.Dependencies = append(i.Dependencies, checkDocker())
return nil
}
func checkWebView2() *packagemanager.Dependancy {
version, _ := webviewloader.GetWebviewVersion("")
installed := version != ""
return &packagemanager.Dependancy{
Name: "WebView2 ",
PackageName: "N/A",
Installed: installed,
InstallCommand: "Available at https://developer.microsoft.com/en-us/microsoft-edge/webview2/",
Version: version,
Optional: false,
External: true,
}
}