From 49bb103171c99a01e4a499a81aae41a7e7577d73 Mon Sep 17 00:00:00 2001 From: cabbage Date: Tue, 27 Oct 2026 09:37:39 +0000 Subject: [PATCH] fix(windows): simplify installer success message --- cmd/rvbox/installer_config.go | 13 +++++++++++++ cmd/rvbox/installer_windows.go | 8 +++++++- docs/testing.md | 4 +++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/cmd/rvbox/installer_config.go b/cmd/rvbox/installer_config.go index 9803e15..6bf9ee5 100644 --- a/cmd/rvbox/installer_config.go +++ b/cmd/rvbox/installer_config.go @@ -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. diff --git a/cmd/rvbox/installer_windows.go b/cmd/rvbox/installer_windows.go index e686f34..0f5793e 100644 --- a/cmd/rvbox/installer_windows.go +++ b/cmd/rvbox/installer_windows.go @@ -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 } diff --git a/docs/testing.md b/docs/testing.md index fef9bad..7d717f0 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -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 +`, 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