Skip to content

Turning off Start with Windows does not stop the startup shortcut the installer created #1956

Open

Description

@MertBasar0

Summary

If "Start OpenClaw Companion when Windows starts" was selected in the installer, Companion keeps starting at logon after the user turns Start with Windows off. An upgrade can also bring the startup entry back.

Cause

There are two separate autostart registrations, and only one of them is managed.

Owner Registration Settings can see it Settings can remove it
installer.iss, startupicon task {userstartup}\OpenClaw Companion.lnk No No
AutoStartManager HKCU\...\Run value and logon scheduled task Yes Yes

AutoStartManager.SetUnpackagedAutoStart(false) and SetupStartupPolicy.ApplyUnpackaged(false, ...) delete only the Run value and the scheduled task. The setup wizard's startup choice goes through the second one, so it cannot remove the shortcut either.

Inno also inherits earlier task selections on an upgrade, so a shortcut the user deleted by hand comes back.

Reproduce

Unsigned Dev installers built from main a4dd026, Windows 11 x64 build 26200, on the Dev identity. The Settings toggle binds to SettingsData.AutoStart, so I set the state the toggle stores, launched the installed tray with --background, and read the state back.

installed with /TASKS=startupicon, AutoStart set to false
settings.json AutoStart (the Settings toggle): False
startup shortcut: True; Run value: absent

shortcut deleted by hand, then a silent upgrade
startup shortcut: True; Run value: absent

Fix I have ready

  • The installer task writes the same Run value that Settings manages, with --background, instead of a shortcut.
  • The task is offered on a fresh install only, so an upgrade cannot turn autostart back on.
  • An upgrade moves an existing shortcut to the Run value and removes the shortcut.
  • At startup an unpackaged build reports an existing registration in the toggle, so a user who turned the toggle off before the upgrade sees On and can really turn it off. It never lowers an enabled preference.

Results with the fix, on the same setup:

fresh install with the task
startup shortcut: False; Run value: "<app>\OpenClaw.Tray.WinUI.exe" --background

fresh install without the task
startup shortcut: False; Run value: absent

baseline with the shortcut and AutoStart false, then upgrade
startup shortcut: False; Run value: <app>\OpenClaw.Tray.WinUI.exe --background
log: Auto-start setting corrected from False to True to match Windows.
settings.json AutoStart (the Settings toggle): True

Run value removed, then a silent upgrade
startup shortcut: False; Run value: absent

Not verified

  • I did not click the toggle in the UI or reboot. That the toggle removes the Run value comes from reading SetUnpackagedAutoStart.
  • Signed artifacts.

I found no existing issue or PR for this. I will open a PR.

Activity

  1. added
    clawsweeper:intake:bug
    P2
    clawsweeper:fix-shape-clear
    clawsweeper:queueable-fix
    clawsweeper:source-repro
    impact:ux-friction
    issue-rating: 🦞 diamond lobster
    no-stale
    and removed
    clawsweeper:intake:bug
    on Oct 31, 2026
  2. clawsweeper commented on Oct 31, 2026

    @clawsweeper

    Codex review: this still needs some work.

    Summary
    This issue identifies a current startup-control bug: the installer creates a shortcut that neither Settings nor setup removes, so disabling autostart can leave Companion launching at logon.

    Reproducibility: Current source establishes the shortcut creation and both incomplete disable paths; the reporter adds Dev-installer observations, but this read-only review ran no Windows reproduction or tests.

    Next step
    Coordinate with the reporter's prepared fix and establish a failing regression showing that disabling startup removes installer-created autostart and remains disabled after upgrade.

    Review details

    Best possible solution:

    Use a registration that Companion can inspect and disable, retire owned legacy shortcuts, and prevent upgrades from restoring disabled autostart.

    Do we have a high-confidence way to reproduce the issue?

    Current source establishes the shortcut creation and both incomplete disable paths; the reporter adds Dev-installer observations, but this read-only review ran no Windows reproduction or tests.

    Is this the best way to solve the issue?

    Consolidating installer registration with Companion's managed startup paths addresses the defect directly, provided migration preserves user intent and packaged-app boundaries.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The reported runtime checks did not exercise the visible toggle or a subsequent logon, and signed upgrade behavior remains unverified.
    • Legacy-shortcut migration needs coverage for disabled preferences and separate Dev/release identities.

    Codex review notes: model internal, reasoning medium; reviewed against a4dd026cc5f8.

    Label changes

    Label changes:

    • add P2: A reproducible ownership mismatch defeats an existing startup preference without blocking Companion's core workflow.
    • add impact:ux-friction: The displayed Off preference can leave a separate startup entry active, requiring recovery outside Companion.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:queueable-fix: Current issue advisory state selects this label.
    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.

    Label justifications:

    • P2: A reproducible ownership mismatch defeats an existing startup preference without blocking Companion's core workflow.
    • impact:ux-friction: The displayed Off preference can leave a separate startup entry active, requiring recovery outside Companion.
    Evidence reviewed

    Acceptance criteria:

    • ./build.ps1
    • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
    • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore
    • Establish a failing regression for installer-created startup surviving disable, then verify it passes through both Settings and setup paths.
    • On isolated Windows, verify fresh install with/without startupicon, legacy-shortcut upgrade, disable followed by silent upgrade, and subsequent logon, preserving Dev/release separation.

    What I checked:

    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed October 31, 2026, 7:23 PM ET / 23:23 UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2clawsweeper:fix-shape-clearclawsweeper:queueable-fixclawsweeper:source-reproimpact:ux-frictionissue-rating: 🦞 diamond lobsterno-stale

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions