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
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -226,7 +226,9 @@ native installer structure-layout test is in `installer_windows_test.go`.
|
||||
For the real double-click acceptance route, preserve UAC policy: the unelevated
|
||||
parent must wait for its elevated child to exit successfully, start the installed
|
||||
tray with the original user's token, and confirm a registered icon before its
|
||||
single success dialog. Verify both service and tray identities, current-session
|
||||
single success dialog. Its entire message is `Installed and is running on server
|
||||
<server_url>`, using the installed configuration's URL (including a preserved
|
||||
URL on upgrade). Verify both service and tray identities, current-session
|
||||
startup without a reboot, Run-key sign-in startup, duplicate prevention, and
|
||||
continued service operation when only the tray exits. The tray must remain
|
||||
visible/responsive when its service is absent or its IPC peer stalls. Windows
|
||||
|
||||
Reference in new issue
Block a user