The setup window remembers the base, update, keys and firmware paths along with the install folder

A reinstall or a switch to another game version starts with the form filled in. Only absolute paths are stored, never the keys file's contents, and an entry that no longer exists, has the wrong kind or cannot be statted is dropped on load. Follows #715 by DanielSvoboda.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-11-05 17:21:32 +03:00
1 parent 640990afcc
commit a2843c3fbf
4 files changed
+150 -28

No files matched your search

+8 -4
View File
@@ -116,9 +116,13 @@ class App:
self.vars['dest'].set(str(rebuild))
root.after(POLL_MS, self.start)
else:
last = recent.load() # an update needs only the folder: refresh_form shows the hint and the recorded language
if last:
self.vars['dest'].set(last)
# recorded sources fill only empty fields; dest goes last, its trace runs refresh_form (update hint and
# recorded language). In update mode filled files are harmless: Extract.current hashes one only when its
# size or mtime differ from the recorded ones.
last = recent.load()
for name in ('base', 'update', 'keys', 'firmware', 'dest'):
if name in last and not self.vars[name].get().strip():
self.vars[name].set(last[name])
# ---- text -----------------------------------------------------------------------------------------------------
@@ -364,7 +368,7 @@ class App:
self.fit()
return
self.form_error.configure(text='')
recent.save(form.dest)
recent.save(form.dest, {name: getattr(form, name) for name in recent.SOURCES})
# in a repository the Python running this window: the tools' embeddable Python there has no ._pth entry for
# the repository, so `-m installer` would not find the package
python = Path(sys.executable) if self.layout.dev else self.layout.python