mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 06:59:57 -04:00
Download and stage updates in the background, and install them only when the game is not running.
A check that finds a newer release (at start, then hourly while the launcher runs, also hidden during play) stages it on a background-priority thread: the app into app/<version>, a new Python into app/<version>/python.staged rather than python.next (which the stub would swap in under the running version), and staged.json written last to mark it complete. Nothing is switched and nothing restarts. A failed staging is logged and tried again after the next check. The staged release installs, through the existing switch, restart and ContinueUpdateJob path, when the launcher starts and right after the game exits, never while a copy of the game runs. Install Updates Automatically (on by default) can leave it to the Updates row instead. A version the stub rolled back from is not staged or installed by itself again, prune keeps a staged release, and the Settings rows now fit the window with the new toggle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -168,10 +168,17 @@ def states(app):
|
||||
'saves\\backup 2026-11-08 17.30.12.')
|
||||
app.show('home', next(i for i, r in enumerate(app.rows_home()) if r.label == 'Import Saves'))
|
||||
|
||||
def update_staged(): # a release downloaded in the background, waiting for the game to be closed
|
||||
rel = fake_release(ahead_of(ctx.version))
|
||||
staged = {'version': rel.version, 'runtime': '', 'prerelease': False, 'notes': rel.notes}
|
||||
app.bg.ready = lambda release=None: staged
|
||||
app.release, app.message = rel, ''
|
||||
app.show('home', 1)
|
||||
|
||||
return [('1-first-run', first_run), ('2-installing', installing), ('3-home', home),
|
||||
('4-update-ready', update_ready), ('5-updating', updating), ('6-settings', settings),
|
||||
('7-build-failed', failed), ('8-uninstall', uninstall), ('9-import-saves', import_saves),
|
||||
('10-shaders', shaders)]
|
||||
('10-shaders', shaders), ('11-update-staged', update_staged)]
|
||||
|
||||
|
||||
def run(app, shots):
|
||||
|
||||
Reference in New Issue
Block a user