fix(windows): simplify installer success message
This commit is contained in:
1 parent
0735908ca9
commit
49bb103171
3 files changed
+23
-2
No files matched your search
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -15,6 +16,18 @@ const (
|
||||
defaultInstallerWorkDir = `C:\Users\Public`
|
||||
)
|
||||
|
||||
func installerSuccessMessage(configPath string) (string, error) {
|
||||
data, err := os.ReadFile(configPath)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("read installed client configuration: %w", err)
|
||||
}
|
||||
configured, err := config.DecodeClient(data, config.ClientOptions{Platform: config.PlatformWindows})
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("decode installed client configuration: %w", err)
|
||||
}
|
||||
return "Installed and is running on server " + configured.Client.ServerURL, nil
|
||||
}
|
||||
|
||||
// packagedClientConfig creates the deliberately small first-install TOML. The
|
||||
// strict production decoder validates it before an elevated installer writes
|
||||
// anything, so the SCM service never starts from a hand-built invalid file.
|
||||
|
||||
@@ -48,7 +48,13 @@ func runInteractiveInstaller(_ io.Writer, _ io.Writer) error {
|
||||
showInstallerMessage(err.Error(), installerErrorIcon)
|
||||
return err
|
||||
}
|
||||
showInstallerMessage("RVBox is installed and its Windows service has started.\n\nThe notification-area icon is available now; no sign-out or reboot is needed. Windows may place it under the hidden-icons arrow.", installerInfoIcon)
|
||||
_, configPath := packagedInstallPaths()
|
||||
message, err := installerSuccessMessage(configPath)
|
||||
if err != nil {
|
||||
showInstallerMessage(err.Error(), installerErrorIcon)
|
||||
return err
|
||||
}
|
||||
showInstallerMessage(message, installerInfoIcon)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user