The setup installs a build kit into the game folder, and the game's rebuild for code mods runs from it (#845)

The rebuild for ExeFS patches, code cheats and mod plugins ran the setup window from the setup folder, whose absolute
path build-cache/rebuild.txt held, with the generated C and objects in that folder's temp/. A moved or deleted setup
folder left code mods without a rebuild.

- A new Kit step after the check copies the release folder without TotK-Setup.exe into <game>/build-kit
  (installer/layout.py KIT_ITEMS), and every later step runs its tools from there. A newer setup replaces the kit,
  the kit's own rebuild keeps it.
- The release's temp folder is <game>/build-cache/work, so the lift cache and the objects stay with the game.
- rebuild.txt names the kit relative to the game folder; runtime/cheats.c and runtime/romfs.c resolve relative
  entries against the exe's folder.
- runtime_key drops the lines of clang --version that name its folder, so a rebuild from the kit or a moved game
  folder keeps the compile and prepare steps the setup recorded.
- An update over an install of an older setup moves that setup's temp folder into build-cache/work when both are on
  one disk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-11-17 10:54:17 +03:00
1 parent d33d8d2e2f
commit 501f0d3e6f
17 files changed
+410 -65

No files matched your search

+11
View File
@@ -379,6 +379,17 @@ static inline char *plat_last_sep(const char *path) {
if (*p == '/' || *p == '\\') last = (char *)p;
return last;
}
// 1 when path does not depend on the working directory: it starts with a separator (a root or UNC path) or, on
// Windows, with a drive letter and a separator.
static inline int plat_path_absolute(const char *path) {
if (path[0] == '/' || path[0] == '\\') return 1;
#ifdef _WIN32
char c = path[0];
return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) && path[1] == ':' && (path[2] == '/' || path[2] == '\\');
#else
return 0;
#endif
}
// Environment variable as UTF-8 into out; its length, or 0 when unset, empty or too long for cap.
size_t plat_getenv(const char *name, char *out, size_t cap);
// The user's UI language as a BCP-47 tag ("ru-RU", "en-US"); "" when the system gives none. Valid for the process.