feat(agent): the Windows setup installs Beanstalk, or runs it portable, as the launcher's does #26

Merged
HumanBean merged 1 commit from HumanBean/Beanstalk:feat/windows-install into main 2026-11-15 23:19:05 +00:00
Owner

Why: beanstalk-agent-…-windows-x64-setup.exe was the portable program under another name. It ran from wherever it was downloaded (usually Downloads), with no Start menu entry and no way to uninstall it. The Longshot Launcher's setup installs itself, and this makes Beanstalk's do the same.

What changed (adapted from the launcher's Core/Installer.cs, App/WindowsInstall.cs and App/SetupWindows.cs)

  • First start of the setup: a dialog offers Install or Run portable. It only appears for a release or nightly started from its own .exe, with no portable file beside it, not the installed copy, and no Beanstalk installed yet.
  • Install:
    • copies the program to %LOCALAPPDATA%\Programs\Beanstalk\beanstalk-agent.exe (per user, no administrator);
    • adds a Start menu shortcut "Beanstalk" and an Apps & features entry;
    • then starts the installed copy, and the downloaded one closes.
    • An installed agent rewrites its entry with its version at each start, and remakes its shortcut once per new version. --install does the same without the dialog.
  • Run portable: writes portable beside the program. It then updates from the portable zip, like the zip's own program. Its data stays in %LOCALAPPDATA%\Beanstalk, because the sign-in belongs to the PC.
  • Uninstall (Apps & features runs --uninstall): a confirm window removes the shortcut, the entry and the program. The program is deleted after it closes, if it was running.
    • Beanstalk's data goes only when "Also delete Beanstalk's data" is ticked. Even then the .nup, the dump's folders, a Longshot checkout of the tester's own, and a data folder outside the home all stay, and the window names that folder.
    • If the beanstalk-runner account exists, a ticked box removes it (one UAC prompt).
  • Self-update: the installed program updates from the setup, a portable one from the zip. The release still ships both side by side.
  • Docs: the package.sh header, agent/README.md (Installing on Windows) and docs/deploy.md (Downloads).

Testing

  • test_agent_core.py: 1606 checks pass, 41 of them new installer checks with a fake registry, fake shortcuts and temp folders. They cover:
    • where it installs, and which kind each copy is;
    • when the dialog is offered;
    • install copies whole and registers; reinstall replaces;
    • refresh once per version;
    • updates stay installed or portable;
    • uninstall while running leaves the program pending;
    • data is kept unless asked, and game files always.
  • The Linux build and the win-x64 build both succeed.
  • Not run on Windows: the real registry and .lnk writes, the dialogs, starting the installed copy, deleting after exit, --uninstall from Apps & features, and removing the runner account. Someone with Windows should run a nightly setup once: install, start it from the Start menu, then uninstall.

Risks: a Windows tester already running the setup file from Downloads sees the dialog once, the first time this version starts (their copy has no portable file and isn't installed). Choosing Run portable keeps everything as it was, and Install moves the app into Programs; their sign-in and data stay where they are.

**Why:** `beanstalk-agent-…-windows-x64-setup.exe` was the portable program under another name. It ran from wherever it was downloaded (usually Downloads), with no Start menu entry and no way to uninstall it. The Longshot Launcher's setup installs itself, and this makes Beanstalk's do the same. **What changed** (adapted from the launcher's `Core/Installer.cs`, `App/WindowsInstall.cs` and `App/SetupWindows.cs`) - **First start of the setup:** a dialog offers **Install** or **Run portable**. It only appears for a release or nightly started from its own `.exe`, with no `portable` file beside it, not the installed copy, and no Beanstalk installed yet. - **Install:** - copies the program to `%LOCALAPPDATA%\Programs\Beanstalk\beanstalk-agent.exe` (per user, no administrator); - adds a Start menu shortcut "Beanstalk" and an Apps & features entry; - then starts the installed copy, and the downloaded one closes. - An installed agent rewrites its entry with its version at each start, and remakes its shortcut once per new version. `--install` does the same without the dialog. - **Run portable:** writes `portable` beside the program. It then updates from the portable zip, like the zip's own program. Its data stays in `%LOCALAPPDATA%\Beanstalk`, because the sign-in belongs to the PC. - **Uninstall** (Apps & features runs `--uninstall`): a confirm window removes the shortcut, the entry and the program. The program is deleted after it closes, if it was running. - Beanstalk's data goes only when "Also delete Beanstalk's data" is ticked. Even then the `.nup`, the dump's folders, a Longshot checkout of the tester's own, and a data folder outside the home all stay, and the window names that folder. - If the `beanstalk-runner` account exists, a ticked box removes it (one UAC prompt). - **Self-update:** the installed program updates from the setup, a portable one from the zip. The release still ships both side by side. - **Docs:** the `package.sh` header, `agent/README.md` (Installing on Windows) and `docs/deploy.md` (Downloads). **Testing** - `test_agent_core.py`: 1606 checks pass, 41 of them new installer checks with a fake registry, fake shortcuts and temp folders. They cover: - where it installs, and which kind each copy is; - when the dialog is offered; - install copies whole and registers; reinstall replaces; - refresh once per version; - updates stay installed or portable; - uninstall while running leaves the program pending; - data is kept unless asked, and game files always. - The Linux build and the `win-x64` build both succeed. - **Not run on Windows:** the real registry and `.lnk` writes, the dialogs, starting the installed copy, deleting after exit, `--uninstall` from Apps & features, and removing the runner account. Someone with Windows should run a nightly setup once: install, start it from the Start menu, then uninstall. **Risks:** a Windows tester already running the setup file from Downloads sees the dialog once, the first time this version starts (their copy has no `portable` file and isn't installed). Choosing Run portable keeps everything as it was, and Install moves the app into Programs; their sign-in and data stay where they are.
feat(agent): the Windows setup installs Beanstalk, or runs it portable, as the launcher's does
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Workflow lint (actionlint) (pull_request) Successful in 4s
CI / Coordinator tests (pull_request) Has been cancelled
CI / Agent build and checks (pull_request) Has been cancelled
CI / Coordinator image (pull_request) Has been cancelled
c99a91ee63
The setup program was the portable program under another name: it ran
from wherever it was downloaded, with no Start menu entry and no way to
uninstall it. Like the Longshot Launcher's (adapted from its
Core/Installer.cs, App/WindowsInstall.cs and App/SetupWindows.cs), its
first start now offers Install or Run portable:

- Install copies it to %LOCALAPPDATA%\Programs\Beanstalk (per user, no
  administrator), adds a Start menu shortcut and an Apps & features
  entry, then starts the installed copy. An installed agent refreshes
  its entry at each start and its shortcut once per version.
- Run portable writes the portable file beside it; it then updates from
  the portable zip, as the zip's own program does.
- --uninstall (from Apps & features) removes the shortcut, the entry and
  the program; Beanstalk's data only when asked, and never the game
  files or a data folder outside its home.

The release still ships the setup and the portable zip side by side.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Beanstalk!26
No description provided.