Ship the launcher as Horizon.app in a .dmg, and in Linux's menus

macOS: packaging/macos/package.sh (run by launcher.yml) builds Horizon.app (Info.plist, bundle
id dev.horizon.launcher, macOS 11+, the .icns), signs it ad hoc, and makes the two release
assets: horizon-launcher-macos-arm64.dmg, the installer (the app and an Applications link over
a background, laid out by dmgbuild without a GUI), and the .zip the launcher updates from. A
launcher inside the app replaces the whole bundle: copied beside it with ditto, swapped in by
renames, restarted; a bare binary, as older launchers are, still finds its binary in the zip.
A macOS test zips, unpacks, swaps and re-verifies a signed bundle. Signing for real is a
MACOS_SIGN_IDENTITY away (packaging/macos/README.md, with what Gatekeeper asks meanwhile).

Linux: release builds keep horizon-launcher.desktop (with the binary's current path),
horizon.desktop (hidden, for the game window's icon) and the hicolor icons under
$XDG_DATA_HOME, without root; `horizon-launcher desktop-entry --remove` takes them out and
stops it, `desktop-entry` puts them back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-14 22:12:29 +02:00
parent fcbbff26a7
commit a248e9242a
13 changed files with 579 additions and 11 deletions
+19
View File
@@ -106,6 +106,13 @@ enum Cmd {
#[arg(long)]
check: bool,
},
/// Linux: put Horizon in the applications menu (an entry and the icon, under
/// $XDG_DATA_HOME), or take it out with --remove
DesktopEntry {
/// Remove the entry and the icon, and stop adding them back
#[arg(long)]
remove: bool,
},
/// Serve the Model Context Protocol on stdin and stdout, for AI agents
Mcp,
}
@@ -312,6 +319,18 @@ fn execute(command: Cmd, as_json: bool) -> Result<(), String> {
}
}
Cmd::Update { check } => update(check, as_json)?,
Cmd::DesktopEntry { remove } => {
let mut settings = backend::Settings::load();
settings.desktop_entry = Some(!remove);
settings.save();
if remove {
horizon_launcher::desktop::remove()?;
println!("Removed Horizon from the applications menu.");
} else {
horizon_launcher::desktop::install(backend::exe_path())?;
println!("Horizon is in the applications menu.");
}
}
Cmd::Mcp => unreachable!(),
}
Ok(())