[PR #2947] [MERGED] Launcher: delete old versions after an update, and show what they take on disk #4702

Closed
opened 2026-11-03 05:07:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2947
Author: @kacpherek
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: feat/launcher-prune-old-versions


📝 Commits (6)

  • e9b71c2 Launcher: delete old release versions after an install or update
  • ab955d6 Launcher: prune after each install and add a Settings switch
  • 732be56 Launcher: show what installed versions take on disk
  • 827bd7f Launcher: test which versions pruning deletes
  • caa1be7 Merge main into feat/launcher-prune-old-versions
  • 8871ba0 Launcher: German strings for old-version pruning

📊 Changes

7 files changed (+228 additions, -7 deletions)

View changed files

📝 docs/launcher-commands.md (+2 -2)
📝 launcher/lang/de.json (+5 -1)
📝 launcher/lang/fr.json (+4 -0)
📝 launcher/lang/ru.json (+4 -0)
📝 launcher/src/backend.rs (+121 -0)
📝 launcher/src/cli.rs (+21 -3)
📝 launcher/src/main.rs (+71 -1)

📄 Description

What and why

A player reported that versions in the launcher's data folder had grown to 20 GB: each Horizon version is about 790 MB and every update adds one. The Versions page already had a manual Remove button, but nothing cleaned up on its own.

  • After an install or update, the launcher now deletes the release versions nothing needs. It keeps the 2 newest installed (the newest and the one before it, as a fallback), the selected version, every version an instance pins, and any version a program is running from. Nightly builds are not touched here (Nightly already keeps only its newest).
  • It runs in the window (once the install is saved, so the new selection is never pruned) and in horizon-launcher install / update. Each deletion is logged to stderr; a folder that fails to delete is logged and the others still go.
  • Settings has a new "Delete old versions automatically" switch, on by default. horizon-launcher settings prune-old-versions on|off and keep-versions N (default 2) do the same from the command line.
  • A deleted version can be installed again from the Versions page (it lists every GitHub release), so nothing else was needed for re-downloading.
  • The Versions page shows each installed version's size on disk and the total under the title, measured on a background thread.

For review: the "running" check reads ps -A -ww -o args= on macOS and Linux and deletes nothing if ps fails. Windows has no such check yet, so a version whose files are locked by a running game fails to delete and is logged.

Horizon-only: vanilla has no counterpart.

Self-check

clippy (--all-targets, -D warnings, with gpui/runtime_shaders on the command line only) and fmt pass for horizon-launcher. Not run: no launcher build or run, no tests. docs/launcher-commands.md was edited by hand to match the new settings help text (its test was not run).


🔄 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/2947 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-prune-old-versions` --- ### 📝 Commits (6) - [`e9b71c2`](https://github.com/horizon-rust/horizon/commit/e9b71c288ac53c7de604cb0f69d870dc3ead8983) Launcher: delete old release versions after an install or update - [`ab955d6`](https://github.com/horizon-rust/horizon/commit/ab955d66c4a8619c70307ab95df427a2e0f49448) Launcher: prune after each install and add a Settings switch - [`732be56`](https://github.com/horizon-rust/horizon/commit/732be56485beff65183926aeefb6cd77ac8a3ca5) Launcher: show what installed versions take on disk - [`827bd7f`](https://github.com/horizon-rust/horizon/commit/827bd7f609a4656491f93dd8ff5324cd19ecd894) Launcher: test which versions pruning deletes - [`caa1be7`](https://github.com/horizon-rust/horizon/commit/caa1be7abe2e358767d170beb8fdc6c889999bd2) Merge main into feat/launcher-prune-old-versions - [`8871ba0`](https://github.com/horizon-rust/horizon/commit/8871ba0b288ddd0da510907219661da12621575f) Launcher: German strings for old-version pruning ### 📊 Changes **7 files changed** (+228 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `docs/launcher-commands.md` (+2 -2) 📝 `launcher/lang/de.json` (+5 -1) 📝 `launcher/lang/fr.json` (+4 -0) 📝 `launcher/lang/ru.json` (+4 -0) 📝 `launcher/src/backend.rs` (+121 -0) 📝 `launcher/src/cli.rs` (+21 -3) 📝 `launcher/src/main.rs` (+71 -1) </details> ### 📄 Description ## What and why A player reported that `versions` in the launcher's data folder had grown to 20 GB: each Horizon version is about 790 MB and every update adds one. The Versions page already had a manual Remove button, but nothing cleaned up on its own. - After an install or update, the launcher now deletes the release versions nothing needs. It keeps the 2 newest installed (the newest and the one before it, as a fallback), the selected version, every version an instance pins, and any version a program is running from. Nightly builds are not touched here (Nightly already keeps only its newest). - It runs in the window (once the install is saved, so the new selection is never pruned) and in `horizon-launcher install` / `update`. Each deletion is logged to stderr; a folder that fails to delete is logged and the others still go. - Settings has a new "Delete old versions automatically" switch, on by default. `horizon-launcher settings prune-old-versions on|off` and `keep-versions N` (default 2) do the same from the command line. - A deleted version can be installed again from the Versions page (it lists every GitHub release), so nothing else was needed for re-downloading. - The Versions page shows each installed version's size on disk and the total under the title, measured on a background thread. For review: the "running" check reads `ps -A -ww -o args=` on macOS and Linux and deletes nothing if `ps` fails. Windows has no such check yet, so a version whose files are locked by a running game fails to delete and is logged. Horizon-only: vanilla has no counterpart. ## Self-check clippy (`--all-targets`, `-D warnings`, with `gpui/runtime_shaders` on the command line only) and fmt pass for horizon-launcher. Not run: no launcher build or run, no tests. `docs/launcher-commands.md` was edited by hand to match the new `settings` help text (its test was not run). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:18 +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#4702
No description provided.