[GH-ISSUE #6980] Launcher: setup and uninstaller for macOS and Linux (parity with #6416) #3110

Open
opened 2026-11-03 04:05:55 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @jaszkus on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6980

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

Summary

#6416 added a per-user setup and uninstaller for Windows (launcher/src/installer.rs, setup_page.rs):
an "Apps & features" entry, shortcuts, horizon-launcher.exe uninstall, silent flags, and a Night-styled
window. macOS and Linux still have only downloads, no install step and no uninstall. This issue asks for the
equivalent on both, keeping the same contract: per-user, no administrator/sudo, self-update untouched, the
player's worlds and the game's folder never touched.

Current state (main 455b6916b)

macOS

  • Horizon.app in a ZIP (arm64 and x64) and an arm64 .dmg ("drag to Applications", packaging/macos/package.sh).
  • Ad-hoc signed by default; Developer ID and notarization when MACOS_SIGN_IDENTITY / MACOS_NOTARY_PROFILE are set.
  • Self-update replaces the whole bundle (mac_update.rs), wherever the app runs from.
  • No first-run step, no check where the app runs from (Downloads, a mounted disk image, an App Translocation
    path), no uninstall.

Linux

  • .tar.gz (one binary) and an .AppImage (glibc >= 2.35, no FUSE 2 needed).
  • A release build writes an applications-menu entry at start, only when there is none or its TryExec/Exec
    no longer exists (desktop.rs); horizon-launcher desktop-entry forces it.
  • Self-update replaces $APPIMAGE. Packagers can set HORIZON_LAUNCHER_DESKTOP_EXEC and
    HORIZON_LAUNCHER_NO_SELF_UPDATE=1.
  • Instance shortcuts (X-Horizon-Instance key) are written by the launcher; nothing removes them with the app.
  • No .deb, .rpm, Flatpak or Snap, and no uninstall.

Goals

  1. A player can put the launcher in the right place, with menu/Launchpad integration, in one step, without
    administrator rights.
  2. A player can remove it cleanly: the app, its menu entries and shortcuts, and optionally its data.
  3. Same look and flow as the Windows setup (Night sky, plates, steps instead of a log), all strings through
    tr("...") in every language table.
  4. Existing users see no change: no prompt for a launcher that already runs from a sensible place, nothing
    that breaks self-update.

Non-goals

  • .deb, .rpm, Flatpak, Snap, Homebrew cask, winget/scoop (separate issues; the packaging hooks
    HORIZON_LAUNCHER_DESKTOP_EXEC and HORIZON_LAUNCHER_NO_SELF_UPDATE already exist for them).
  • Authenticode, Developer ID or notarization changes (existing environment variables keep working as they do).
  • Changing the Windows installer, except sharing code.
  • Touching the game's folder (HORIZON_HOME), worlds, or any account's keychain items without an explicit choice.

Proposed design

All of this is a proposal; the open questions below are the places to push back.

Shared

  • Keep one installer module with the Windows code as is, and add #[cfg(target_os = "macos")] and
    #[cfg(target_os = "linux")] backends behind one small API: installed(), install(options, progress),
    uninstall(remove_data, progress), after_update(version), run_quiet(), window_mode().
  • Generalise setup_page.rs (now #[cfg(windows)]) to all three platforms; only the option rows and the
    steps' names differ.
  • Silent mode for scripts, handled in main() before cli::run() like on Windows, so it never reaches clap,
    the completions or the MCP tools (an agent must not be able to uninstall the launcher). Subcommand names must
    not clash with the existing install <tag> (the game's install): reuse setup --quiet and
    uninstall --quiet [--remove-data].
  • No nagging: the offer to install is shown once per account and can be dismissed for good (a key in
    settings.json). It is never shown to a launcher that already runs from an install location, started
    from a package manager's path, or with HORIZON_LAUNCHER_NO_SELF_UPDATE=1.
  • Test hooks: environment variables for the folders involved (as HORIZON_LAUNCHER_DESKTOP and
    HORIZON_LAUNCHER_HOME do today), so tests never touch the real Applications folder, menu or Trash.
  • Uninstall asks before removing the launcher's data folder (default: keep). The text says what is in it:
    game builds, servers made in the launcher, settings, skins. It never touches the game's folder or worlds.

macOS

  • Trigger: the app was opened from a mounted disk image (/Volumes/...), an App Translocation path
    (/private/var/folders/.../AppTranslocation/...) or ~/Downloads. The window shows an offer in the Night
    style: "Move Horizon to Applications".
  • Install: copy Horizon.app to /Applications (or ~/Applications when that isn't writable, e.g. a
    standard user), keeping the code signature and the resource forks, and handling the quarantine attribute
    so Gatekeeper doesn't ask a second time for a copy the player already approved. Start the copy, then
    quit the original. If the copy came from a disk image, offer to eject it.
  • Why not a .pkg: it needs an administrator prompt for /Applications, has no uninstall of its own and
    needs a signed/notarized installer certificate to avoid warnings. It can stay a later option; this keeps the
    no-admin rule.
  • Uninstall: Settings > Launcher > Uninstall… and horizon-launcher uninstall [--quiet] [--remove-data].
    It moves Horizon.app to the Trash (so the player can get it back), removes instance shortcut apps it made
    (found by the HorizonInstance key in their Info.plist, as shortcut.rs already does), and, when asked,
    removes ~/Library/Application Support/horizon-launcher.
  • Self-update: after mac_update.rs replaces the bundle, nothing needs registering on macOS, so
    after_update is a no-op there; the install location must stay user-writable.

Linux

  • Trigger: an offer in the window (and the same from the CLI) when the launcher runs from an AppImage
    or a .tar.gz folder that isn't the install location, i.e. not from ~/.local/bin, /usr, a package
    manager path or $APPDIR of someone else's AppImage.
  • Install (per user, XDG paths, honouring XDG_DATA_HOME):
    • copy the AppImage (or the .tar.gz's binary) to ~/.local/bin/horizon-launcher and keep it executable;
    • write ~/.local/share/applications/horizon-launcher.desktop (Exec, TryExec, Icon=horizon,
      StartupWMClass=horizon-launcher) with absolute paths, as desktop.rs does today;
    • install the icons from packaging/icons/hicolor/* to ~/.local/share/icons/hicolor/, and run
      update-desktop-database / gtk-update-icon-cache when they exist (failure is not an error).
  • Respect AppImage rules: use $APPIMAGE as the source, never $APPDIR's inner copy (it vanishes when the
    launcher exits), and keep backend::appimage_path_in guarding that the launcher never replaces someone
    else's AppImage. After install, self-update targets the installed copy.
  • Uninstall: horizon-launcher uninstall [--quiet] [--remove-data] removes the installed binary, the menu
    entry, the icons and every instance .desktop found by X-Horizon-Instance; with --remove-data also
    ~/.local/share/horizon-launcher. Anything it can't remove is listed, not hidden.
  • PATH: if ~/.local/bin isn't on PATH, say so in the final step; don't edit shell profiles.
  • Packagers: unchanged. When HORIZON_LAUNCHER_DESKTOP_EXEC or HORIZON_LAUNCHER_NO_SELF_UPDATE=1 is set,
    the launcher assumes a package manager owns it and offers nothing.

Acceptance criteria

macOS

  • Opening the .dmg's app offers the move; accepting puts a working, signed app in Applications and starts it.
  • A standard (non-admin) user gets ~/Applications and no password prompt.
  • An app already in Applications, or any later self-update, shows no offer and keeps working.
  • Uninstall… moves the app to the Trash, removes its instance shortcut apps, and removes the data folder
    only when asked.

Linux

  • From an AppImage and from the .tar.gz, install gives a menu entry, an icon and a binary in ~/.local/bin
    without root.
  • Self-update after install replaces the installed copy, not the downloaded one.
  • uninstall leaves no launcher file, menu entry, icon or instance .desktop behind (except what it lists
    as not removable).
  • Packaged installs (HORIZON_LAUNCHER_DESKTOP_EXEC, NO_SELF_UPDATE) get no offer.

Both

  • Worlds, HORIZON_HOME and the game's folder are untouched in every path.
  • No new prompts or behavior for existing users; the offer can be dismissed permanently.
  • All new strings in tr("...") with entries in every launcher/lang/*.json; the translation test passes.
  • cargo test passes on all three platforms; the setup/uninstall logic has tests that use temporary folders
    through the environment hooks.
  • README and docs/release-flow.md describe the new flow and flags.

Test plan

  • macOS arm64 and Intel (Rosetta): from the .dmg, from the ZIP in Downloads, from Applications, as a standard user,
    with and without the quarantine attribute, ad-hoc and Developer ID builds.
  • Linux: Ubuntu 22.04, Fedora, Debian 12; GNOME and KDE; Wayland and X11; AppImage with and without FUSE 2;
    .tar.gz; an existing entry pointing at another launcher (must stay untouched unless the player turns it on).
  • Both: install, update, uninstall, reinstall; uninstall with and without --remove-data; instance shortcut
    present before uninstall; a launcher in a path with spaces and non-ASCII characters.

Open questions

  1. macOS: in-app "move to Applications" (proposed) or a .pkg? A .pkg adds an admin prompt and receipts,
    but is what some players expect.
  2. macOS: is ~/Applications an acceptable fallback, and should the app ever install itself without asking when
    it detects a disk image?
  3. Linux: ~/.local/bin (proposed) or ~/Applications / ~/.local/opt/horizon-launcher/ for the installed binary?
  4. Linux: offer inside the window only, CLI only, or both? (Proposed: both, window only for AppImage and .tar.gz.)
  5. Should uninstall also offer to sign the Microsoft accounts out (keychain / Secret Service tokens), as
    account sign-out does, or leave that to the player?
  6. Are .deb/.rpm/Flatpak wanted as follow-ups? If so, this issue's install logic should stay out of their way.

References

  • #6416 (Windows setup and uninstaller): launcher/src/installer.rs, launcher/src/setup_page.rs
  • packaging/macos/package.sh, launcher/src/mac_update.rs
  • packaging/linux/appimage.sh, launcher/src/desktop.rs, launcher/src/shortcut.rs
  • Self-update contract: backend.rs (update_target, replace_binary), docs/release-flow.md
  • Design system: docs/design-system.md ("Night")
Originally created by @jaszkus on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6980 > 🤖 Opened by jaszkus's AI agent, not by jaszkus himself. ## Summary #6416 added a per-user setup and uninstaller for Windows (`launcher/src/installer.rs`, `setup_page.rs`): an "Apps & features" entry, shortcuts, `horizon-launcher.exe uninstall`, silent flags, and a Night-styled window. macOS and Linux still have only downloads, no install step and no uninstall. This issue asks for the equivalent on both, keeping the same contract: per-user, no administrator/sudo, self-update untouched, the player's worlds and the game's folder never touched. ## Current state (main 455b6916b) **macOS** - `Horizon.app` in a ZIP (arm64 and x64) and an arm64 `.dmg` ("drag to Applications", `packaging/macos/package.sh`). - Ad-hoc signed by default; Developer ID and notarization when `MACOS_SIGN_IDENTITY` / `MACOS_NOTARY_PROFILE` are set. - Self-update replaces the whole bundle (`mac_update.rs`), wherever the app runs from. - No first-run step, no check where the app runs from (Downloads, a mounted disk image, an App Translocation path), no uninstall. **Linux** - `.tar.gz` (one binary) and an `.AppImage` (glibc >= 2.35, no FUSE 2 needed). - A release build writes an applications-menu entry at start, only when there is none or its `TryExec`/`Exec` no longer exists (`desktop.rs`); `horizon-launcher desktop-entry` forces it. - Self-update replaces `$APPIMAGE`. Packagers can set `HORIZON_LAUNCHER_DESKTOP_EXEC` and `HORIZON_LAUNCHER_NO_SELF_UPDATE=1`. - Instance shortcuts (`X-Horizon-Instance` key) are written by the launcher; nothing removes them with the app. - No `.deb`, `.rpm`, Flatpak or Snap, and no uninstall. ## Goals 1. A player can put the launcher in the right place, with menu/Launchpad integration, in one step, without administrator rights. 2. A player can remove it cleanly: the app, its menu entries and shortcuts, and optionally its data. 3. Same look and flow as the Windows setup (Night sky, plates, steps instead of a log), all strings through `tr("...")` in every language table. 4. Existing users see no change: no prompt for a launcher that already runs from a sensible place, nothing that breaks self-update. ## Non-goals - `.deb`, `.rpm`, Flatpak, Snap, Homebrew cask, winget/scoop (separate issues; the packaging hooks `HORIZON_LAUNCHER_DESKTOP_EXEC` and `HORIZON_LAUNCHER_NO_SELF_UPDATE` already exist for them). - Authenticode, Developer ID or notarization changes (existing environment variables keep working as they do). - Changing the Windows installer, except sharing code. - Touching the game's folder (`HORIZON_HOME`), worlds, or any account's keychain items without an explicit choice. ## Proposed design All of this is a proposal; the open questions below are the places to push back. ### Shared - Keep one `installer` module with the Windows code as is, and add `#[cfg(target_os = "macos")]` and `#[cfg(target_os = "linux")]` backends behind one small API: `installed()`, `install(options, progress)`, `uninstall(remove_data, progress)`, `after_update(version)`, `run_quiet()`, `window_mode()`. - Generalise `setup_page.rs` (now `#[cfg(windows)]`) to all three platforms; only the option rows and the steps' names differ. - Silent mode for scripts, handled in `main()` before `cli::run()` like on Windows, so it never reaches clap, the completions or the MCP tools (an agent must not be able to uninstall the launcher). Subcommand names must not clash with the existing `install <tag>` (the game's install): reuse `setup --quiet` and `uninstall --quiet [--remove-data]`. - No nagging: the offer to install is shown once per account and can be dismissed for good (a key in `settings.json`). It is never shown to a launcher that already runs from an install location, started from a package manager's path, or with `HORIZON_LAUNCHER_NO_SELF_UPDATE=1`. - Test hooks: environment variables for the folders involved (as `HORIZON_LAUNCHER_DESKTOP` and `HORIZON_LAUNCHER_HOME` do today), so tests never touch the real Applications folder, menu or Trash. - Uninstall asks before removing the launcher's data folder (default: keep). The text says what is in it: game builds, servers made in the launcher, settings, skins. It never touches the game's folder or worlds. ### macOS - **Trigger:** the app was opened from a mounted disk image (`/Volumes/...`), an App Translocation path (`/private/var/folders/.../AppTranslocation/...`) or `~/Downloads`. The window shows an offer in the Night style: "Move Horizon to Applications". - **Install:** copy `Horizon.app` to `/Applications` (or `~/Applications` when that isn't writable, e.g. a standard user), keeping the code signature and the resource forks, and handling the quarantine attribute so Gatekeeper doesn't ask a second time for a copy the player already approved. Start the copy, then quit the original. If the copy came from a disk image, offer to eject it. - **Why not a `.pkg`:** it needs an administrator prompt for `/Applications`, has no uninstall of its own and needs a signed/notarized installer certificate to avoid warnings. It can stay a later option; this keeps the no-admin rule. - **Uninstall:** `Settings > Launcher > Uninstall…` and `horizon-launcher uninstall [--quiet] [--remove-data]`. It moves `Horizon.app` to the Trash (so the player can get it back), removes instance shortcut apps it made (found by the `HorizonInstance` key in their `Info.plist`, as `shortcut.rs` already does), and, when asked, removes `~/Library/Application Support/horizon-launcher`. - **Self-update:** after `mac_update.rs` replaces the bundle, nothing needs registering on macOS, so `after_update` is a no-op there; the install location must stay user-writable. ### Linux - **Trigger:** an offer in the window (and the same from the CLI) when the launcher runs from an AppImage or a `.tar.gz` folder that isn't the install location, i.e. not from `~/.local/bin`, `/usr`, a package manager path or `$APPDIR` of someone else's AppImage. - **Install (per user, XDG paths, honouring `XDG_DATA_HOME`):** - copy the AppImage (or the `.tar.gz`'s binary) to `~/.local/bin/horizon-launcher` and keep it executable; - write `~/.local/share/applications/horizon-launcher.desktop` (`Exec`, `TryExec`, `Icon=horizon`, `StartupWMClass=horizon-launcher`) with absolute paths, as `desktop.rs` does today; - install the icons from `packaging/icons/hicolor/*` to `~/.local/share/icons/hicolor/`, and run `update-desktop-database` / `gtk-update-icon-cache` when they exist (failure is not an error). - **Respect AppImage rules:** use `$APPIMAGE` as the source, never `$APPDIR`'s inner copy (it vanishes when the launcher exits), and keep `backend::appimage_path_in` guarding that the launcher never replaces someone else's AppImage. After install, self-update targets the installed copy. - **Uninstall:** `horizon-launcher uninstall [--quiet] [--remove-data]` removes the installed binary, the menu entry, the icons and every instance `.desktop` found by `X-Horizon-Instance`; with `--remove-data` also `~/.local/share/horizon-launcher`. Anything it can't remove is listed, not hidden. - **PATH:** if `~/.local/bin` isn't on `PATH`, say so in the final step; don't edit shell profiles. - **Packagers:** unchanged. When `HORIZON_LAUNCHER_DESKTOP_EXEC` or `HORIZON_LAUNCHER_NO_SELF_UPDATE=1` is set, the launcher assumes a package manager owns it and offers nothing. ## Acceptance criteria macOS - [ ] Opening the `.dmg`'s app offers the move; accepting puts a working, signed app in Applications and starts it. - [ ] A standard (non-admin) user gets `~/Applications` and no password prompt. - [ ] An app already in Applications, or any later self-update, shows no offer and keeps working. - [ ] `Uninstall…` moves the app to the Trash, removes its instance shortcut apps, and removes the data folder only when asked. Linux - [ ] From an AppImage and from the `.tar.gz`, install gives a menu entry, an icon and a binary in `~/.local/bin` without root. - [ ] Self-update after install replaces the installed copy, not the downloaded one. - [ ] `uninstall` leaves no launcher file, menu entry, icon or instance `.desktop` behind (except what it lists as not removable). - [ ] Packaged installs (`HORIZON_LAUNCHER_DESKTOP_EXEC`, `NO_SELF_UPDATE`) get no offer. Both - [ ] Worlds, `HORIZON_HOME` and the game's folder are untouched in every path. - [ ] No new prompts or behavior for existing users; the offer can be dismissed permanently. - [ ] All new strings in `tr("...")` with entries in every `launcher/lang/*.json`; the translation test passes. - [ ] `cargo test` passes on all three platforms; the setup/uninstall logic has tests that use temporary folders through the environment hooks. - [ ] README and `docs/release-flow.md` describe the new flow and flags. ## Test plan - macOS arm64 and Intel (Rosetta): from the `.dmg`, from the ZIP in Downloads, from Applications, as a standard user, with and without the quarantine attribute, ad-hoc and Developer ID builds. - Linux: Ubuntu 22.04, Fedora, Debian 12; GNOME and KDE; Wayland and X11; AppImage with and without FUSE 2; `.tar.gz`; an existing entry pointing at another launcher (must stay untouched unless the player turns it on). - Both: install, update, uninstall, reinstall; uninstall with and without `--remove-data`; instance shortcut present before uninstall; a launcher in a path with spaces and non-ASCII characters. ## Open questions 1. macOS: in-app "move to Applications" (proposed) or a `.pkg`? A `.pkg` adds an admin prompt and receipts, but is what some players expect. 2. macOS: is `~/Applications` an acceptable fallback, and should the app ever install itself without asking when it detects a disk image? 3. Linux: `~/.local/bin` (proposed) or `~/Applications` / `~/.local/opt/horizon-launcher/` for the installed binary? 4. Linux: offer inside the window only, CLI only, or both? (Proposed: both, window only for AppImage and `.tar.gz`.) 5. Should uninstall also offer to sign the Microsoft accounts out (keychain / Secret Service tokens), as `account sign-out` does, or leave that to the player? 6. Are `.deb`/`.rpm`/Flatpak wanted as follow-ups? If so, this issue's install logic should stay out of their way. ## References - #6416 (Windows setup and uninstaller): `launcher/src/installer.rs`, `launcher/src/setup_page.rs` - `packaging/macos/package.sh`, `launcher/src/mac_update.rs` - `packaging/linux/appimage.sh`, `launcher/src/desktop.rs`, `launcher/src/shortcut.rs` - Self-update contract: `backend.rs` (`update_target`, `replace_binary`), `docs/release-flow.md` - Design system: `docs/design-system.md` ("Night")
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#3110
No description provided.