Repository navigation
Surface a removal path for the Windows daemon autorun entry - #2613
Merged
Merged
Conversation
…1519) register_autorun_windows writes an HKCU Run key so nodespaced restarts on next login, but nothing let a user discover or remove it. Add autorun_windows_present/remove_autorun_windows (same reg.exe mechanism as the write side, no new registry crate dependency), wire them behind two Tauri commands, and surface a "Remove" action in Settings -> About that only appears when an entry actually exists. Co-Authored-By: Claude Sonnet 5 <[email protected]>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
register_autorun_windows(packages/desktop-app/src-tauri/src/daemon_setup.rs) writes an HKCUSoftware\Microsoft\Windows\CurrentVersion\Runentry on every daemon start sonodespacedrestarts on next login. There was no way for a user to discover or remove that entry — this closes that gap.What changed
daemon_setup.rs— two new#[cfg(windows)]functions, mirroringregister_autorun_windows's existingreg.exe-via-Commandmechanism exactly (no new registry crate dependency, e.g.winreg/windows-sys, introduced):autorun_windows_present()—reg query, returns whether the entry exists.remove_autorun_windows()—reg delete. Checks presence first so a "nothing to remove" no-op (Ok(false)) can be told apart from a genuinereg.exefailure, rather than scraping stderr text to distinguish the two.commands/settings.rs— two new Tauri commands,windows_autorun_presentandremove_windows_autorun. Both are always registered (generate_handler!needs the item to exist unconditionally on every target) but only do anything on Windows — macOS/Linux always report "nothing to do" rather than the command being absent, so the frontend needs no platform check of its own.Surfacing it — investigated the existing precedents before picking a surface:
scripts/uninstall.sh/packages/cli/src/commands/uninstall.rsare POSIX-only (stop_daemon()is a Windows no-op today) and out of this issue's stated scope (packages/desktop-app/src-tauri).tauri.conf.json'sbundleconfig has no Windows-specific NSIS/WiX customization (targets: "all", default bundler, no custom uninstall hooks) — there's no existing installer-script hook to wire into.diagnostics-settings.svelte, theaboutcategory insettings-sidebar.svelte) already surfaces machine-level app state (version, database path) with no prior platform-conditional pattern anywhere in the frontend.Given that, the most minimal, clearly-scoped surface is a Settings → About row, gated purely on the backend's own presence check rather than adding new OS-detection code to the frontend: on mount it calls
windows_autorun_present, and only when that'strue(Windows, with an entry actually registered — never on macOS/Linux, never on a clean install) does a "Remove" button appear, callingremove_windows_autorunand hiding the row on success. This avoids inventing a new UI feature or a frontend platform-detection helper for a one-button action.Testing
nodespace-app's existing 165-test suite grew via compile-checked#[cfg(windows)]functions (not independently unit-testable on macOS/CI); see the real Windows verification below instead.packages/desktop-app/src/tests/components/settings/diagnostics-settings.test.ts(4 tests) — row hidden with no entry, row shown with an entry, successful removal hides the row, a failed removal shows an inline error and keeps the row for retry.bun run test:allandbun run quality:fixboth clean locally (full pre-push gate —test:all,cargo build --bin nodespaced,test:e2e— passed before this push).Real Windows verification
register_autorun_windows/autorun_windows_present/remove_autorun_windows's logic was extracted verbatim into a standalone Rust binary (no Tauri/nlp-engine dependency chain — the full desktop-app crate can't build on this Windows box due to a missinglibclang) and run for real over SSH on a Windows 11 machine, using a distinct test value name (NodeSpaceDaemonHarnessTest) so it could never collide with a real install:Confirms: the write path lands the exact key/value shape
register_autorun_windowsproduces,autorun_windows_presentcorrectly reflects presence/absence via an independently-verifiedreg.exe query,remove_autorun_windowsgenuinely deletes the entry (independently confirmed absent afterward), and both operations are safe/idempotent when there's nothing to do.Closes #1519
🤖 Generated with Claude Code