From f854d67e6f07d492047b79ab88d96bee534840fb Mon Sep 17 00:00:00 2001 From: itaskaev2 <165683571+itaskaev2@users.noreply.github.com> Date: Thu, 12 Nov 2026 11:17:51 +0100 Subject: [PATCH] Name the other program that holds totk.exe when the setup cannot link it When ld.lld cannot write the totk.exe it links in the setup's temp build folder (Permission denied), the setup showed only "Compiling totk.exe failed". In #1122 the holder was an antivirus that flagged the new exe, not a running game. The compile step now recognises that failure in the build log and says what to do: close the game, exclude the setup's and the install folder from the antivirus, restart Windows and run the setup again. Texts in en, ru, pt-BR and zh-Hans; build_game.py's own line names the antivirus too. Co-Authored-By: Claude Opus 5.5 --- installer/steps.py | 13 ++++++++++ installer/text/en.json | 1 + installer/text/pt-BR.json | 1 + installer/text/ru.json | 1 + installer/text/zh-Hans.json | 1 + tests/installer_test.py | 51 +++++++++++++++++++++++++++++++++++++ tools/build_game.py | 3 ++- 7 files changed, 70 insertions(+), 1 deletion(-) diff --git a/installer/steps.py b/installer/steps.py index 69dcefa0..7f6d9f4c 100644 --- a/installer/steps.py +++ b/installer/steps.py @@ -140,6 +140,17 @@ def linux_kernel(): return (int(m.group(1)), int(m.group(2))) if m else None +def link_output_locked(log): + """Whether a build failed because another program holds the exe the linker writes: ld.lld cannot write it and clang + cannot remove it (Permission denied). A game started from the temp build folder does that, and so does an + antivirus that flagged or quarantined the new totk.exe there (#1122).""" + try: + text = Path(log).read_text(encoding='utf-8', errors='replace') + except OSError: + return False + return 'failed to write output' in text and 'Permission denied' in text + + def run_tool(ctx, step, script, args, parse=None, cwd=None): """Run a tool script with the bundled Python. Its output goes to /logs/-