Fix: unify autostart to one per-user Run entry#29
Conversation
Three independent autostart registrations had drifted out of sync: - daemon (ffp_daemon._act_set_autostart): HKCU\...\Run\FastFlowPrompt -- what the dashboard's "Launch Flowkey when I sign in" toggle reads/writes. - installer/install.ps1 (source install): HKCU\...\Run\Flowkey -- same key path, DIFFERENT value name, so the dashboard toggle couldn't see or manage it, and toggling it on added a second, redundant entry. - installer/installer.iss (packaged installer): optional machine-wide HKLM\...\Run\Flowkey via an install-time "autostart" task -- a third, independent mechanism in a different hive entirely. Any combination of these could double-launch grammarFix.ahk + the daemon at logon. Fix: unify everyone on the one HKCU\...\Run\FastFlowPrompt entry the daemon owns. - install.ps1: $RunKeyName "Flowkey" -> "FastFlowPrompt" (matches ffp_daemon._AUTOSTART_VALUE_NAME exactly). - installer.iss: removed the "autostart" Task and its HKLM [Registry] entry entirely (the installer no longer offers machine-wide autostart); added an [UninstallRun] step that removes the per-user HKCU value on uninstall. - first_run.py: removed the dead, now-inaccurate var_autostart_hint (declared, never rendered/read; its comment claimed "installer owns Run key", which is no longer even conceptually true). - installer/README.md: corrected the uninstaller description. New test_installer_autostart.py cross-references ffp_daemon's actual constant (not a hardcoded string) so install.ps1 and installer.iss can never silently drift from the daemon again. Also: removed the Serena MCP server (unregistered globally + deleted the project's local .serena/ cache) and a stale, long-superseded codex/add-autohotkey-runtime branch on origin -- both were artifacts of an external agent that had been operating on this project. Gates: ruff clean, 323 pytest passed (+3), node --check, AHK parse-check. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73272ad4c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # install used to register a DIFFERENT value name ("Flowkey") here, so the | ||
| # dashboard toggle couldn't see it (and enabling the toggle added a second, | ||
| # redundant Run entry -> double launch at logon). See SPEC.md B6 / T10. | ||
| $RunKeyName = "FastFlowPrompt" |
There was a problem hiding this comment.
Remove the legacy Flowkey Run value during upgrades
When a user who installed from source with the previous script reruns installer/install.ps1 to upgrade, their HKCU ...\Run\Flowkey value is still present. This line makes the script write FastFlowPrompt instead, but step 5 only adds the new value and never deletes Flowkey, so Windows will launch both commands at sign-in and the dashboard can only toggle the new one. Please migrate/remove the old value before setting $RunKeyName and in -Uninstall.
Useful? React with 👍 / 👎.
| ; reg.exe exits non-zero when the value is absent; that's fine, Inno | ||
| ; doesn't treat a nonzero [UninstallRun] exit as fatal. | ||
| Filename: "{sys}\reg.exe"; \ | ||
| Parameters: "delete ""HKCU\Software\Microsoft\Windows\CurrentVersion\Run"" /v ""FastFlowPrompt"" /f"; \ |
There was a problem hiding this comment.
Clean up the legacy HKLM autostart on installer upgrades
For machines that installed a previous package with the old autostart task selected, upgrading to this installer leaves HKLM\...\Run\Flowkey in place because the new script has no install-time migration for that legacy value. This cleanup only deletes the per-user HKCU\...\Run\FastFlowPrompt; after the upgrade, logon still starts the machine-wide entry that the dashboard cannot see, and enabling the per-user toggle double-launches again. Add an install/uninstall migration that deletes the legacy HKLM value.
Useful? React with 👍 / 👎.
Unifies autostart to a single per-user Run entry — three independent registrations had drifted out of sync.
The bug
_act_set_autostart, what the dashboard's "Launch Flowkey when I sign in" toggle drives):HKCU\...\Run\FastFlowPromptinstall.ps1(source install):HKCU\...\Run\Flowkey— different value name, same key path. The dashboard toggle couldn't see or manage this entry, and enabling it afterward added a second, redundant one.installer.iss(packaged installer, optional "autostart" task):HKLM\...\Run\Flowkey— a third, machine-wide mechanism in a different hive.Any combination could double-launch
grammarFix.ahk+ the daemon at logon.The fix
install.ps1:$RunKeyName→"FastFlowPrompt"(matchesffp_daemon._AUTOSTART_VALUE_NAMEexactly).installer.iss: removed the "autostart" Task and its[Registry]HKLM entry entirely — the packaged installer no longer offers machine-wide autostart; added an[UninstallRun]step that cleans up the per-user HKCU value.first_run.py: removed the deadvar_autostart_hint(never rendered/read; its comment was now flatly wrong).installer/README.md: corrected the uninstaller description.test_installer_autostart.pycross-references the daemon's actual constant (not a hardcoded string), so this can't silently drift again.Also in this PR
Removed the Serena MCP server (unregistered globally + deleted the project's local
.serena/cache) and a stale, long-supersededcodex/add-autohotkey-runtimebranch on origin — both artifacts of an external agent that had been operating on this project (and had, separately, wiped this repo's local.gitearlier in the session — recovered in a prior PR).Gates: ruff clean · 323 pytest passed (+3) ·
node --check app.js· AHK parse-check.🤖 Generated with Claude Code