[PR #6416] [MERGED] Launcher: a per-user Windows setup and uninstaller #6859

Closed
opened 2026-11-03 06:28:15 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6416
Author: @jaszkus
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: feat/launcher-windows-setup


📝 Commits (3)

📊 Changes

20 files changed (+1197 additions, -10 deletions)

View changed files

📝 .github/workflows/launcher.yml (+20 -0)
📝 docs/release-flow.md (+3 -0)
📝 launcher/Cargo.lock (+1 -0)
📝 launcher/Cargo.toml (+2 -0)
📝 launcher/README.md (+10 -0)
📝 launcher/lang/de.json (+20 -1)
📝 launcher/lang/es.json (+20 -1)
📝 launcher/lang/fr.json (+20 -1)
📝 launcher/lang/ja.json (+20 -1)
📝 launcher/lang/pl.json (+20 -1)
📝 launcher/lang/pt-br.json (+20 -1)
📝 launcher/lang/ru.json (+20 -1)
📝 launcher/lang/tr.json (+20 -1)
📝 launcher/lang/uk.json (+20 -1)
📝 launcher/lang/zh.json (+20 -1)
📝 launcher/src/backend.rs (+3 -0)
➕ launcher/src/installer.rs (+524 -0)
📝 launcher/src/lib.rs (+2 -0)
📝 launcher/src/main.rs (+14 -0)
➕ launcher/src/setup_page.rs (+418 -0)

📄 Description

🤖 Opened by jaszkus's AI agent, not by jaszkus himself.

What and why

Fixes #6412.

Windows is the one platform where the launcher arrives as a bare ZIP: no Start menu entry, nothing in Apps & features, and no way to remove it again (macOS has a .dmg, Linux an AppImage). This adds a per-user setup and uninstaller built into the launcher's own binary, so there is nothing new to build or to keep in step.

  • The release workflow copies horizon-launcher.exe to horizon-launcher-setup.exe. That name (or HORIZON_LAUNCHER_SETUP=1) is what turns the same binary into the setup: it opens the wizard instead of Home. A launcher unpacked from the ZIP keeps behaving exactly as it does today, and a self-update cannot turn one into the setup.
  • The wizard copies itself to %LOCALAPPDATA%\Programs\Horizon Launcher\horizon-launcher.exe, makes the Start menu shortcut (and the desktop one if asked) and the Uninstall entry under HKCU, then starts the installed copy. No administrator is needed, and only HKCU is written.
  • horizon-launcher.exe uninstall opens the same window in its removal mode; uninstall --quiet [--remove-data] and setup --quiet [--dir <folder>] [--desktop-shortcut] do the same for scripts. Both commands are handled in main before the CLI parser, so they appear neither in the shell completions nor in the MCP tools: an agent cannot uninstall the launcher.
  • The install folder is always one called "Horizon Launcher" and is removed with remove_dir, never remove_dir_all. The game's folders (HORIZON_HOME, worlds/) are never touched, and the launcher's data folder only with --remove-data.
  • The window is drawn with the Night look (sky.rs, plate.rs, shell.rs, titlebar.rs), so it looks like the launcher: the same sky, plates and buttons.
  • Self-update keeps working and now also refreshes the Uninstall entry's version and size when the launcher runs from an install folder. The binary still replaces its own file the way it always has (rename aside, no self_replace, no hidden cmd.exe, #3175).
  • The only new dependency is winreg (MIT), which is already in the lockfile through keyring on Windows.

Tested on Windows only (Windows 11, debug build), where it works end to end: the wizard opens, setup --quiet installs into a scratch folder with the Start menu shortcut and the complete HKCU\...\Uninstall\HorizonLauncher entry (DisplayName, DisplayVersion, Publisher, InstallLocation, DisplayIcon, UninstallString, QuietUninstallString, EstimatedSize, NoModify, NoRepair), and uninstall --quiet removes the file, the folder, the shortcut, both registry keys and the now-empty Software\Horizon. The other platforms are untouched (the module is #[cfg(windows)]), but I have not built them here.

The 1710 lines are one feature: the installer module and its window. Splitting them would ship a setup with no uninstaller, so I kept them together.

Kind

  • feature: something new for players (listed under New in the release notes)

Vanilla reference

Horizon-only: vanilla has no launcher and no installer. Nothing in the game's behaviour changes.

Other projects' code

none

Self-check

**pr_ready** (`tools/pr_ready.py --base upstream/main` on DESKTOP-32UL5CT, against upstream/main at 455b6916b, 2 min 53 s)

| Check | Result |
| --- | --- |
| Scope | ⚠️ 21 files, +1713 −10; 1710 lines of code: over 500, split it if it can ship in parts; mixes CI, game, launcher |
| Cargo.lock | ✅ changes with a Cargo.toml |
| Public tree | ✅ |
| Python tests | ❌ 586 run, FAILED (errors=1, skipped=12) (2 min 30 s) |
| rustfmt | ➖ no Rust change |
| clippy | ➖ no Rust change |
| tests | ➖ no crate touched |
| doc tests | ➖ no crate touched |
| content root tests | ➖ content root untouched |
| tokens.css up to date | ➖ theme untouched |
| launcher rustfmt | ✅ (2 s) |
| launcher clippy | ✅ (7 s) |
| launcher tests | ✅ 388 passed (12 s) |
| Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses |
| Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) |

The one Python error is tests/test_world_input_capture.py::test_capture_lifecycle: it compiles a standalone fixture from crates/horizon-client/src/game.rs and crates/horizon-client-input/src/mouse.rs, neither of which this branch touches, and the fixture panics (exit 101) the same way on a clean upstream/main checkout at 455b6916b on this machine. It is not caused by this change.

Screenshots

Two screens, both in the Night look over the pixel sky:

  • Setup: a plate with "Horizon" in the display cut, a line saying it installs for this account with no administrator, the install folder with Change…, a Desktop shortcut switch and the violet Install action.
  • Uninstall: the same plate, with the Also delete the launcher's data switch (off by default) and Uninstall.
  • Done: "Horizon Launcher is installed." with Launch Horizon (the close control is the window's own, in the title bar).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6416 **Author:** [@jaszkus](https://github.com/jaszkus) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-windows-setup` --- ### 📝 Commits (3) - [`ebcf944`](https://github.com/horizon-rust/horizon/commit/ebcf9441720c26ca04b16932062e5a70a0d6c692) Launcher: a per-user Windows setup and uninstaller - [`149efc8`](https://github.com/horizon-rust/horizon/commit/149efc8302f8c14f0c5cf08db935a9b9e87fc13a) Merge main into #6416 - [`76eee70`](https://github.com/horizon-rust/horizon/commit/76eee70652f511b7830193dea4a70ef03ac3c8ff) Merge main into #6416 ### 📊 Changes **20 files changed** (+1197 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/launcher.yml` (+20 -0) 📝 `docs/release-flow.md` (+3 -0) 📝 `launcher/Cargo.lock` (+1 -0) 📝 `launcher/Cargo.toml` (+2 -0) 📝 `launcher/README.md` (+10 -0) 📝 `launcher/lang/de.json` (+20 -1) 📝 `launcher/lang/es.json` (+20 -1) 📝 `launcher/lang/fr.json` (+20 -1) 📝 `launcher/lang/ja.json` (+20 -1) 📝 `launcher/lang/pl.json` (+20 -1) 📝 `launcher/lang/pt-br.json` (+20 -1) 📝 `launcher/lang/ru.json` (+20 -1) 📝 `launcher/lang/tr.json` (+20 -1) 📝 `launcher/lang/uk.json` (+20 -1) 📝 `launcher/lang/zh.json` (+20 -1) 📝 `launcher/src/backend.rs` (+3 -0) ➕ `launcher/src/installer.rs` (+524 -0) 📝 `launcher/src/lib.rs` (+2 -0) 📝 `launcher/src/main.rs` (+14 -0) ➕ `launcher/src/setup_page.rs` (+418 -0) </details> ### 📄 Description > 🤖 Opened by jaszkus's AI agent, not by jaszkus himself. ## What and why Fixes #6412. Windows is the one platform where the launcher arrives as a bare ZIP: no Start menu entry, nothing in **Apps & features**, and no way to remove it again (macOS has a `.dmg`, Linux an AppImage). This adds a per-user setup and uninstaller built into the launcher's own binary, so there is nothing new to build or to keep in step. - The release workflow copies `horizon-launcher.exe` to `horizon-launcher-setup.exe`. That name (or `HORIZON_LAUNCHER_SETUP=1`) is what turns the same binary into the setup: it opens the wizard instead of Home. A launcher unpacked from the ZIP keeps behaving exactly as it does today, and a self-update cannot turn one into the setup. - The wizard copies itself to `%LOCALAPPDATA%\Programs\Horizon Launcher\horizon-launcher.exe`, makes the Start menu shortcut (and the desktop one if asked) and the Uninstall entry under `HKCU`, then starts the installed copy. No administrator is needed, and only `HKCU` is written. - `horizon-launcher.exe uninstall` opens the same window in its removal mode; `uninstall --quiet [--remove-data]` and `setup --quiet [--dir <folder>] [--desktop-shortcut]` do the same for scripts. Both commands are handled in `main` before the CLI parser, so they appear neither in the shell completions nor in the MCP tools: an agent cannot uninstall the launcher. - The install folder is always one called "Horizon Launcher" and is removed with `remove_dir`, never `remove_dir_all`. The game's folders (`HORIZON_HOME`, `worlds/`) are never touched, and the launcher's data folder only with `--remove-data`. - The window is drawn with the Night look (`sky.rs`, `plate.rs`, `shell.rs`, `titlebar.rs`), so it looks like the launcher: the same sky, plates and buttons. - Self-update keeps working and now also refreshes the Uninstall entry's version and size when the launcher runs from an install folder. The binary still replaces its own file the way it always has (rename aside, no `self_replace`, no hidden `cmd.exe`, #3175). - The only new dependency is `winreg` (MIT), which is already in the lockfile through `keyring` on Windows. Tested on **Windows only** (Windows 11, debug build), where it works end to end: the wizard opens, `setup --quiet` installs into a scratch folder with the Start menu shortcut and the complete `HKCU\...\Uninstall\HorizonLauncher` entry (`DisplayName`, `DisplayVersion`, `Publisher`, `InstallLocation`, `DisplayIcon`, `UninstallString`, `QuietUninstallString`, `EstimatedSize`, `NoModify`, `NoRepair`), and `uninstall --quiet` removes the file, the folder, the shortcut, both registry keys and the now-empty `Software\Horizon`. The other platforms are untouched (the module is `#[cfg(windows)]`), but I have not built them here. The 1710 lines are one feature: the installer module and its window. Splitting them would ship a setup with no uninstaller, so I kept them together. ## Kind - [x] feature: something new for players (listed under New in the release notes) ## Vanilla reference Horizon-only: vanilla has no launcher and no installer. Nothing in the game's behaviour changes. ## Other projects' code none ## Self-check ``` **pr_ready** (`tools/pr_ready.py --base upstream/main` on DESKTOP-32UL5CT, against upstream/main at 455b6916b, 2 min 53 s) | Check | Result | | --- | --- | | Scope | ⚠️ 21 files, +1713 −10; 1710 lines of code: over 500, split it if it can ship in parts; mixes CI, game, launcher | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ❌ 586 run, FAILED (errors=1, skipped=12) (2 min 30 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (7 s) | | launcher tests | ✅ 388 passed (12 s) | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ``` The one Python error is `tests/test_world_input_capture.py::test_capture_lifecycle`: it compiles a standalone fixture from `crates/horizon-client/src/game.rs` and `crates/horizon-client-input/src/mouse.rs`, neither of which this branch touches, and the fixture panics (exit 101) the same way on a clean `upstream/main` checkout at 455b6916b on this machine. It is not caused by this change. ## Screenshots Two screens, both in the Night look over the pixel sky: - **Setup**: a plate with "Horizon" in the display cut, a line saying it installs for this account with no administrator, the install folder with **Change…**, a **Desktop shortcut** switch and the violet **Install** action. - **Uninstall**: the same plate, with the **Also delete the launcher's data** switch (off by default) and **Uninstall**. - **Done**: "Horizon Launcher is installed." with **Launch Horizon** (the close control is the window's own, in the title bar). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:28:15 +07:00
Sign in to join this conversation.
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
horizon-rust/horizon#6859
No description provided.