Skip to content

Commit 7bcdc19

Browse files
Sbussisoclaude
andcommitted
fix(wix): Start menu shortcut becomes smart launcher, not setup-only
The Start menu shortcut had Arguments='setup' which forced the setup wizard every time the user clicked it. After someone successfully completed setup, clicking the shortcut to launch the camera dashboard re-prompted for Node ID + API key + URL — making it look like credentials weren't being saved when in fact they were saved fine, the shortcut just always took the explicit setup path. Root cause in main.rs:261: let needs_setup = match &args.command { Some(Commands::Setup { .. }) => true, // always true Some(Commands::Run { .. }) | None => /* check creds */, ... }; `Commands::Setup` unconditionally re-runs the wizard. The bare invocation (`None` arm) is the smart path — it checks Config::load for existing credentials and runs the node if they're present, or falls through to the wizard if not. Fix: drop the Arguments='setup' attribute on the Start menu shortcut so clicking it invokes the binary with no subcommand. The bare path then handles both first-launch (no creds → wizard → run) and every- launch-after (creds present → straight to dashboard). Also renamed the shortcut from "SourceBox Sentry CloudNode Setup" (implies setup-only behaviour) to "SourceBox Sentry CloudNode" (reflects its new role as a normal app launcher). Shortcut Id changed from ShortcutSetup → ShortcutLauncher; the WiX Component Guid is unchanged so the upgrade chain still recognises this as the same shortcut row, just renamed. The MSI Finish-dialog LaunchSetup CustomAction (top of wxs) is unaffected — it's a separate code path that explicitly passes `setup` because the Finish dialog needs to spawn a fresh console. That path correctly forces the wizard on first install. Operators who genuinely want to RECONFIGURE (change Node ID, point at a different Command Center, etc.) can run `sourcebox-sentry-cloudnode setup` from any console — the explicit subcommand still forces the wizard, by design. Bumps version to 0.1.33. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d86a132 commit 7bcdc19

3 files changed

Lines changed: 28 additions & 10 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# should reflect that. Going from `opensentry-cloudnode` to
66
# `sourcebox-sentry-cloudnode` keeps the binary name explicit + branded.
77
name = "sourcebox-sentry-cloudnode"
8-
version = "0.1.32"
8+
version = "0.1.33"
99
edition = "2021"
1010
authors = ["SourceBox LLC"]
1111
description = "SourceBox Sentry CloudNode — turns a USB webcam into a cloud-connected security camera."

wix/main.wxs

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -332,19 +332,37 @@
332332
</Directory>
333333
</Directory>
334334

335-
<!-- Start menu shortcut so the user can launch a console
336-
invocation of the binary without typing the full path.
337-
The shortcut runs `sourcebox-sentry-cloudnode setup` since
338-
that's the most likely first action after install. -->
335+
<!-- Start menu shortcut: smart launcher.
336+
No `Arguments=` attribute → the binary runs with no
337+
subcommand, which hits the bare-invocation path in
338+
main.rs. That path checks Config::load for existing
339+
credentials and chooses:
340+
- creds present → run_cloudnode (foreground TUI
341+
dashboard, cameras stream)
342+
- creds missing → run setup wizard, then
343+
run_cloudnode
344+
So the same shortcut handles both first-launch (runs
345+
the wizard then streams) and every-launch-after
346+
(just streams).
347+
The MSI Finish dialog's LaunchSetup CustomAction at
348+
the top of this file handles the very first launch
349+
after install via cmd /c start with `setup` arg
350+
explicitly — that's a separate code path because the
351+
Finish dialog needs to spawn a new console window.
352+
The shortcut here is what the operator clicks on
353+
every subsequent launch; previously it had
354+
`Arguments='setup'` which forced the wizard to re-
355+
prompt for credentials every single time. v0.1.33
356+
dropped the argument so the shortcut becomes a
357+
normal app launcher. -->
339358
<Directory Id='ProgramMenuFolder'>
340359
<Directory Id='ApplicationProgramsFolder' Name='SourceBox Sentry CloudNode'>
341360
<Component Id='cmpStartMenu'
342361
Guid='9DAB7EBC-6F4F-4C3D-B05E-C2F8FAD47069'>
343-
<Shortcut Id='ShortcutSetup'
344-
Name='SourceBox Sentry CloudNode Setup'
345-
Description='Run the interactive setup wizard to enrol this machine.'
362+
<Shortcut Id='ShortcutLauncher'
363+
Name='SourceBox Sentry CloudNode'
364+
Description='Launch the CloudNode dashboard. Runs the setup wizard the first time, streams cameras every time after.'
346365
Target='[#filServiceExe]'
347-
Arguments='setup'
348366
WorkingDirectory='APPLICATIONFOLDER' />
349367
<RemoveFolder Id='RemoveProgramsFolder'
350368
Directory='ApplicationProgramsFolder'

0 commit comments

Comments
 (0)