Use Startup shortcut for Windows autostart

Replace the HKCU Run autostart entry with a per-user Startup folder shortcut. A .lnk stores TargetPath separately, which avoids fragile quoting when the executable path contains spaces.

Remove legacy PySentry and GoSentry Run entries when saving autostart settings, and report shortcut status from the actual shortcut target.

Add Windows tests that create and read a temporary shortcut with spaces in the path so the PowerShell/COM invocation remains covered.
This commit is contained in:
mixeme
2026-06-16 21:40:48 +03:00
parent 0bc9e91d1e
commit 44f24ab3d8
4 changed files with 174 additions and 39 deletions
+4 -3
View File
@@ -14,7 +14,7 @@ flowchart LR
store["src/core Store - YAML config and jobs"]
scheduler["src/core Scheduler - @every and cron timing"]
runner["src/core Runner - shell command execution"]
autostart["src/core Autostart - Windows Run / Linux desktop startup"]
autostart["src/core Autostart - Windows Startup shortcut / Linux desktop startup"]
config["pysentry.yaml - application settings"]
jobs["jobs.yaml - job definitions"]
logs["logs_dir - per-run command output logs"]
@@ -67,5 +67,6 @@ flowchart LR
runs log cleanup, and calls the GUI callback so the `History` tab refreshes.
7. Autostart:
The Settings tab calls the platform autostart implementation. Windows uses the
current user's Run registry key. Linux uses a desktop-session startup entry.
The Settings tab calls the platform autostart implementation. Windows uses a
shortcut in the current user's Startup folder. Linux uses a desktop-session
startup entry.