fix(autostart): use CurrentUser registry and normalise Scoop path on Windows#133
Merged
Conversation
…Windows On Windows the auto-launch builder now explicitly targets HKCU instead of the default Dynamic mode (try HKLM, fall back to HKCU) which can silently fail on non-admin accounts or be blocked by security policies. Additionally, when running from a Scoop installation the resolved exe path (e.g. `…\apps\ropy\0.5.1\ropy.exe`) is normalised back to the stable `…\apps\ropy\current\ropy.exe` junction so that the registry entry survives package upgrades. Closes #132
Move the inline Scoop versioned-path rewrite out of `get_app_path` into a standalone `normalise_scoop_path` helper, and cover it with pure string-level unit tests (versioned segment, `current` junction, case variations, non-Scoop paths, malformed inputs). Also drop the `to_lowercase()` allocation in favour of `eq_ignore_ascii_case` on raw bytes, since the marker is pure ASCII. Refs #132
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
WindowsEnableMode::CurrentUser(HKCU) instead ofDynamicmode to avoid silent failures on non-admin accounts or systems with restrictive security policies.apps\ropy\0.5.1\) to the stableapps\ropy\current\junction so the registry entry survivesscoop update.Closes #132
Notes on the console flash issue
The brief terminal window flash reported in the issue is caused by Scoop's shim mechanism —
scoop\shims\ropy.exeis a console-subsystem proxy that launches the real GUI binary. This is a Scoop-side limitation that cannot be fixed in application code (the app already setswindows_subsystem = "windows"). Users can work around it by launching directly from theapps\ropy\current\ropy.exepath or by upgrading Scoop which has improved shimgen for GUI apps.Test plan
HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Runpoints to…\current\ropy.exescoop update ropy, reboot, and confirm auto-start still workscargo testpasses, auto-start still works)