Start the rebuild window and its setup run with a Python that finds the installer

The rebuild command puts the release folder on sys.path itself: totk.exe starts it in the install folder, and only the
Windows release Python's ._pth names that folder. In a repository the window and its setup run use the Python that
runs the setup, since the tools' embeddable Python there has neither tkinter nor the repository on its path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-11-01 17:40:22 +03:00
1 parent 4310407226
commit 3668271182
4 files changed
+21 -9

No files matched your search

+3 -2
View File
@@ -83,8 +83,9 @@ Ninja recompiles only those: a new or edited code cheat costs the lift (under a
and a few dozen chunks, not a full compile, and the shaders stay prepared.
`build-cache/rebuild.txt` holds the command that opens the setup window in its rebuild mode on the install folder
(`python -m installer.gui --rebuild <install folder>`), one argument per line. When an enabled mod has code cheats or
ExeFS patch files the build lacks, `totk.exe` runs it at start and exits (`runtime/cheats.c` `rebuild_if_needed`); the
(`installer/gui.py --rebuild <install folder>`, started through `python -c` so the release folder is on `sys.path`
whatever the working folder), one argument per line. When an enabled mod has code cheats or ExeFS patch files the build
lacks, `totk.exe` runs it at start and exits (`runtime/cheats.c` `rebuild_if_needed`); the
window runs the setup on the folder at once and starts the game again when it succeeds. A failed or cancelled rebuild
offers to start the game with the code it has; `build-cache/rebuild.skip` then keeps the same files from starting it
again, until "Rebuild the game now" on the Cheats or Mods tab. `[mods] mods_rebuild = off` turns it off. The rebuild