diff --git a/v2/internal/wv2installer/browser.go b/v2/internal/wv2installer/browser.go index 27b223ac..67a05f8d 100644 --- a/v2/internal/wv2installer/browser.go +++ b/v2/internal/wv2installer/browser.go @@ -10,7 +10,7 @@ import ( ) func doInstallationStrategy(installStatus installationStatus, messages *windows.Messages) error { - confirmed, err := webview2runtime.Confirm(messages.DownloadPageMsg+MinimumRuntimeVersion, messages.MissingRequirementsMsg) + confirmed, err := webview2runtime.Confirm(messages.DownloadPageMsg+MinimumRuntimeVersion, messages.MissingRequirements) if err != nil { return err } @@ -21,5 +21,5 @@ func doInstallationStrategy(installStatus installationStatus, messages *windows. } } - return fmt.Errorf(messages.FailedToInstallMsg) + return fmt.Errorf(messages.FailedToInstall) } diff --git a/v2/internal/wv2installer/download.go b/v2/internal/wv2installer/download.go index bc441ccf..99c03e0b 100644 --- a/v2/internal/wv2installer/download.go +++ b/v2/internal/wv2installer/download.go @@ -10,24 +10,24 @@ import ( ) func doInstallationStrategy(installStatus installationStatus, messages *windows.Messages) error { - message := messages.InstallationRequiredMsg + message := messages.InstallationRequired if installStatus == needsUpdating { - message = messages.UpdateRequiredMsg + message = messages.UpdateRequired } - confirmed, err := webview2runtime.Confirm(message, messages.MissingRequirementsMsg) + confirmed, err := webview2runtime.Confirm(message, messages.MissingRequirements) if err != nil { return err } if !confirmed { - return fmt.Errorf(messages.Webview2NotInstalledMsg) + return fmt.Errorf(messages.Webview2NotInstalled) } installedCorrectly, err := webview2runtime.InstallUsingBootstrapper() if err != nil { - _ = webview2runtime.Error(err.Error(), messages.ErrorMsg) + _ = webview2runtime.Error(err.Error(), messages.Error) return err } if !installedCorrectly { - err = webview2runtime.Error(messages.FailedToInstallMsg, messages.ErrorMsg) + err = webview2runtime.Error(messages.FailedToInstall, messages.Error) return err } return nil diff --git a/v2/internal/wv2installer/embed.go b/v2/internal/wv2installer/embed.go index b9364be4..b01274ea 100644 --- a/v2/internal/wv2installer/embed.go +++ b/v2/internal/wv2installer/embed.go @@ -10,25 +10,25 @@ import ( ) func doInstallationStrategy(installStatus installationStatus, messages *windows.Messages) error { - message := messages.InstallationRequiredMsg + message := messages.InstallationRequired if installStatus == needsUpdating { - message = messages.UpdateRequiredMsg + message = messages.UpdateRequired } - message += messages.PressOKToInstallMsg - confirmed, err := webview2runtime.Confirm(message, messages.MissingRequirementsMsg) + message += messages.PressOKToInstall + confirmed, err := webview2runtime.Confirm(message, messages.MissingRequirements) if err != nil { return err } if !confirmed { - return fmt.Errorf(messages.Webview2NotInstalledMsg) + return fmt.Errorf(messages.Webview2NotInstalled) } installedCorrectly, err := webview2runtime.InstallUsingEmbeddedBootstrapper() if err != nil { - _ = webview2runtime.Error(err.Error(), messages.ErrorMsg) + _ = webview2runtime.Error(err.Error(), messages.Error) return err } if !installedCorrectly { - err = webview2runtime.Error(messages.FailedToInstallMsg, messages.ErrorMsg) + err = webview2runtime.Error(messages.FailedToInstall, messages.Error) return err } return nil diff --git a/v2/internal/wv2installer/error.go b/v2/internal/wv2installer/error.go index 203da523..3ce7d2a1 100644 --- a/v2/internal/wv2installer/error.go +++ b/v2/internal/wv2installer/error.go @@ -10,6 +10,6 @@ import ( ) func doInstallationStrategy(installStatus installationStatus, messages *windows.Messages) error { - _ = webview2runtime.Error(messages.ContactAdminMsg, messages.ErrorMsg) - return fmt.Errorf(messages.Webview2NotInstalledMsg) + _ = webview2runtime.Error(messages.ContactAdmin, messages.Error) + return fmt.Errorf(messages.Webview2NotInstalled) } diff --git a/v2/pkg/options/windows/windows.go b/v2/pkg/options/windows/windows.go index 24986c68..7161a76b 100644 --- a/v2/pkg/options/windows/windows.go +++ b/v2/pkg/options/windows/windows.go @@ -3,15 +3,15 @@ package windows type Theme int type Messages struct { - InstallationRequiredMsg string - UpdateRequiredMsg string - MissingRequirementsMsg string - Webview2NotInstalledMsg string - ErrorMsg string - FailedToInstallMsg string - DownloadPageMsg string - PressOKToInstallMsg string - ContactAdminMsg string + InstallationRequired string + UpdateRequired string + MissingRequirements string + Webview2NotInstalled string + Error string + FailedToInstall string + DownloadPage string + PressOKToInstall string + ContactAdmin string } const ( @@ -73,14 +73,14 @@ type Options struct { func DefaultMessages() *Messages { return &Messages{ - InstallationRequiredMsg: "The WebView2 runtime is required. Press Ok to download and install. Note: The installer will download silently so please wait.", - UpdateRequiredMsg: "The Webview2 runtime needs updating. Press Ok to download and install. Note: The installer will download silently so please wait.", - MissingRequirementsMsg: "Missing Requirements", - Webview2NotInstalledMsg: "webview2 runtime not installed", - ErrorMsg: "Error", - FailedToInstallMsg: "The runtime failed to install correctly. Please try again.", - DownloadPageMsg: "This application requires the WebView2 runtime. Press OK to open the download page. Minimum version required: ", - PressOKToInstallMsg: "Press Ok to install.", - ContactAdminMsg: "The WebView2 runtime is required to run this application. Please contact your system administrator.", + InstallationRequired: "The WebView2 runtime is required. Press Ok to download and install. Note: The installer will download silently so please wait.", + UpdateRequired: "The Webview2 runtime needs updating. Press Ok to download and install. Note: The installer will download silently so please wait.", + MissingRequirements: "Missing Requirements", + Webview2NotInstalled: "webview2 runtime not installed", + Error: "Error", + FailedToInstall: "The runtime failed to install correctly. Please try again.", + DownloadPage: "This application requires the WebView2 runtime. Press OK to open the download page. Minimum version required: ", + PressOKToInstall: "Press Ok to install.", + ContactAdmin: "The WebView2 runtime is required to run this application. Please contact your system administrator.", } }