From e5732bcee142ef6ffac499973b743b65d88facd8 Mon Sep 17 00:00:00 2001 From: "Lea\\Anthony" Date: Sat, 25 Dec 2021 08:51:32 +1100 Subject: [PATCH] [v2] Update to webview2runtime v1.3.0 --- .../initialise/templates/templates/svelte/go.mod.tmpl | 2 +- .../initialise/templates/templates/vanilla/go.mod.tmpl | 2 +- v2/go.mod | 4 +++- v2/internal/appng/app_windows.go | 6 +++--- v2/internal/ffenestri/windows/wv2runtime/wv2runtime.go | 8 ++++---- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/go.mod.tmpl b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/go.mod.tmpl index 2c68d66ed..3de154f04 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/go.mod.tmpl +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/svelte/go.mod.tmpl @@ -22,7 +22,7 @@ github.com/leaanthony/go-common-file-dialog v1.0.3 // indirect github.com/leaanthony/go-webview2 v0.0.0-20210914103035-f00aa774a934 // indirect github.com/leaanthony/slicer v1.5.0 // indirect github.com/leaanthony/typescriptify-golang-structs v0.1.7 // indirect -github.com/leaanthony/webview2runtime v1.1.0 // indirect +github.com/leaanthony/webview2runtime v1.3.0 // indirect github.com/leaanthony/winc v0.0.0-20210921073452-54963136bf18 // indirect github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2 // indirect github.com/pkg/errors v0.9.1 // indirect diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/go.mod.tmpl b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/go.mod.tmpl index 2c68d66ed..3de154f04 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/go.mod.tmpl +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates/vanilla/go.mod.tmpl @@ -22,7 +22,7 @@ github.com/leaanthony/go-common-file-dialog v1.0.3 // indirect github.com/leaanthony/go-webview2 v0.0.0-20210914103035-f00aa774a934 // indirect github.com/leaanthony/slicer v1.5.0 // indirect github.com/leaanthony/typescriptify-golang-structs v0.1.7 // indirect -github.com/leaanthony/webview2runtime v1.1.0 // indirect +github.com/leaanthony/webview2runtime v1.3.0 // indirect github.com/leaanthony/winc v0.0.0-20210921073452-54963136bf18 // indirect github.com/pkg/browser v0.0.0-20210706143420-7d21f8c997e2 // indirect github.com/pkg/errors v0.9.1 // indirect diff --git a/v2/go.mod b/v2/go.mod index 81aa02fd0..044ae8b95 100644 --- a/v2/go.mod +++ b/v2/go.mod @@ -27,7 +27,7 @@ require ( github.com/leaanthony/idgen v1.0.0 github.com/leaanthony/slicer v1.5.0 github.com/leaanthony/typescriptify-golang-structs v0.1.7 - github.com/leaanthony/webview2runtime v1.1.0 + github.com/leaanthony/webview2runtime v1.3.0 github.com/leaanthony/winc v0.0.0-20211202091710-9931d43181ff github.com/leaanthony/winicon v1.0.0 github.com/matryer/is v1.4.0 @@ -81,3 +81,5 @@ require ( golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect ) + +replace github.com/leaanthony/webview2runtime => C:\Users\leaan\Documents\wails-v2-beta\webview2runtime diff --git a/v2/internal/appng/app_windows.go b/v2/internal/appng/app_windows.go index 644cd728e..50540e3c0 100644 --- a/v2/internal/appng/app_windows.go +++ b/v2/internal/appng/app_windows.go @@ -15,9 +15,9 @@ func PreflightChecks(options *options.App, logger *logger.Logger) error { // 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 { - logger.Debug("WebView2 Runtime installed: Name: '%s' Version:'%s' Location:'%s'. Minimum version required: %s.", - installedVersion.Name, installedVersion.Version, installedVersion.Location, wv2runtime.MinimumRuntimeVersion) + if installedVersion != "" { + logger.Debug("WebView2 Runtime Version '%s' installed. Minimum version required: %s.", + installedVersion, wv2runtime.MinimumRuntimeVersion) } if err != nil { return err diff --git a/v2/internal/ffenestri/windows/wv2runtime/wv2runtime.go b/v2/internal/ffenestri/windows/wv2runtime/wv2runtime.go index 7326d54b1..ffa09103d 100644 --- a/v2/internal/ffenestri/windows/wv2runtime/wv2runtime.go +++ b/v2/internal/ffenestri/windows/wv2runtime/wv2runtime.go @@ -15,14 +15,14 @@ const ( installed ) -func Process() (*webview2runtime.Info, error) { +func Process() (string, error) { installStatus := needsInstalling installedVersion := webview2runtime.GetInstalledVersion() - if installedVersion != nil { + if installedVersion != "" { installStatus = installed - compareResult, err := webviewloader.CompareBrowserVersions(installedVersion.Version, MinimumRuntimeVersion) + compareResult, err := webviewloader.CompareBrowserVersions(installedVersion, MinimumRuntimeVersion) if err != nil { - return nil, err + return "", err } updateRequired := compareResult == -1 // Installed and does not require updating