fix(startup): fall back to Run key when Task Scheduler fails#51
Conversation
Standard users, group policy restrictions, and some AV software can block schtasks /Create, causing the "Run at startup" toggle to fail with a confusing error toast. Instead of throwing, catch the failure and fall back to Electron's app.setLoginItemSettings (HKCU Run key), which requires no special permissions. When disabling, both the scheduled task and the Run key entry are cleaned up. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c671e7e73
ℹ️ 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".
The HKCU Run key fallback cannot work because the exe manifest is requestedExecutionLevel: requireAdministrator — Windows silently skips Run-key entries for admin-manifest executables. Revert to letting the error surface when schtasks fails (group policy, AV) and update the toast message to point at the actual likely causes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Both the Settings and Schedules pages now show a "Learn more" action button on the error toast that opens a help page explaining common causes and workarounds for Task Scheduler restrictions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe1f9dd25e
ℹ️ 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".
Summary
requireAdministrator, Windows silently skips HKCU Run entries, making the fallback a silent no-ophttps://usekudu.com/help/startup-failedapplyAutoLaunchWin32to document why the Run key is not viableHelp page content
The toast links to
https://usekudu.com/help/startup-failed— this page needs to be created. See below for a prompt to generate the content.AI prompt for help page content
Write a support/help page for the URL path
/help/startup-failedon a system cleaner app called Kudu (usekudu.com). The page should explain why the "Run at startup" toggle can fail on Windows and how to fix it.Context for the AI:
schtasks /Create) to register a logon-triggered task called "KuduStartup"requestedExecutionLevel: requireAdministrator, which means the HKCU Run registry key approach does NOT work (Windows silently skips Run-key entries for admin-manifest executables)schtasks, restricted enterprise environments (Citrix, terminal services), corrupted Task Scheduler servicePage should include:
services.msc→ "Task Scheduler" → should be Running/Automatic)schtasksfor non-whitelisted apps)--startupargument → set "Run with highest privileges"Test plan
🤖 Generated with Claude Code