[Feature] One-click update from the main menu, using the release overlay

Chiusa
#170 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
desktop, devtools

Direzione di ricerca

Start with OptimumUpdateChecker.cs, GuiCompositeMainMenuLeft, Optimum.Cli/CliRunner.cs, and scripts/package-overlay.sh; trace how release assets and manifests are discovered and how optimum patch applies an overlay. The proposal leaves key design questions open about when to apply updates and how to coordinate with RiftLauncher. Done means a verified overlay can be staged, applied after exit with rollback on failure, and source-built installs retain the release link.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

complexity: hard enhancement installer
Problem

Upgrading Optimum means leaving the game: download an installer or a source tree, or go through RiftLauncher. For players who only use Optimum, the client already knows an update exists. OptimumUpdateChecker (sources/VintagestoryLib/Optimum/OptimumUpdateChecker.cs) queries releases/latest at startup, and GuiCompositeMainMenuLeft shows "update available" as a link to the release page. From there the player is on their own. That last step trips up the people I play with: "which asset is mine?", picking the wrong installer, or reinstalling on top of an install the new installer doesn't recognise. Windows players have it worst.

Each release already contains everything an in-place update needs:

  • Optimum-v<ver>-<rid>-overlay.tar.gz, about 9 MB, with no Anego binaries (scripts/package-overlay.sh);
  • optimum-manifest-<rid>.json, with the archive's SHA-256, a SHA-256 for every file, supportedGameVersions, and the targets;
  • optimum patch --game-dir <abs> --overlay <abs> [--rollback] (Optimum.Cli/CliRunner.cs), which re-patches from .optimum/vanilla and can roll back. RiftLauncher already updates installs this way.
Proposed change

Turn the existing notice into an Update button for installs that have the overlay layout (.optimum/vanilla present):

  1. Download. Read optimum-manifest-<rid>.json from the release the checker found. Refuse when the running game version is not in supportedGameVersions, or when the release has no overlay for this RID. Download the archive in the background, with a progress bar in the main menu.
  2. Verify and stage. Check the archive SHA-256 and every file's SHA-256 against the manifest. Extract into .optimum/pending/<version>/. Nothing in the live install is touched yet. The menu then says "Optimum is ready. Restart the game to finish."
  3. Apply after exit. Run the existing optimum patch --overlay .optimum/pending/<version> path once the game process has exited. Windows locks the loaded DLLs, so applying while the game runs is not an option on either OS. On failure, call --rollback, keep the old version, and show the failure reason on the next start.
  4. Fallback. A source-built install without .optimum/vanilla keeps today's behaviour, the link to the release page.

There would be no new update channel and no new artifacts. The button uses the overlay, the manifest and the patch command RiftLauncher already relies on, so it inherits their testing and the fixes from #140/#142.

Questions before I write it
  • Do you want this in the client at all, or should updating stay with the installer and RiftLauncher?
  • For step 3: a small detached helper that the client spawns, which waits for the game PID, patches and exits? Or should Optimum.exe apply a pending overlay at startup, before it loads the game? The helper also covers installs started through the vanilla executable. The launcher route would reuse PatchSplashScreen for progress.
  • Should the button hide when RiftLauncher started the game, so two updaters don't fight over one install? If so, is there an existing signal for that (an environment variable or an argument)?
  • Is the overlay intended for in-place use on an install made by the Linux or Windows installer, or only for RiftLauncher-managed copies?

I'm happy to implement it, with tests for the hash check, a corrupt or partial download, an unsupported game version, and rollback after a failed patch, plus a full 0.3.20 → 0.3.21 run on Linux. Windows testing would be on a second machine.

Scope
  • This does not change gameplay, balance, or add content.
Lingua principale
C#
Stelle
22
Fork
4
Merge medio
30m
PR unite (30g)
188

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di StratumServer/Optimum

Tutte le issue di StratumServer/Optimum

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.