Give totk.exe, TotK-Setup.exe and the installer window the green ring icon: runtime/totk.ico is embedded through totk.rc and a new launcher.rc, and the release copies it into runtime/ for the Tk window

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-10-26 16:48:02 +03:00
1 parent e3e0eb06c8
commit a9a7762ead
8 files changed
+24 -7

No files matched your search

+3
View File
@@ -56,6 +56,9 @@ class App:
self.screen = None
root.title(self.cat('ui.title'))
icon = layout.runtime / 'totk.ico'
if os.name == 'nt' and icon.is_file():
root.iconbitmap(default=str(icon))
root.minsize(680, 560)
root.protocol('WM_DELETE_WINDOW', self.on_close)
style = ttk.Style(root)
+2 -1
View File
@@ -2,7 +2,8 @@
No console window. The two message strings come from the catalog (installer/text/<lang>.json, ids launcher.title and
launcher.python_missing); tools/make_release.py writes them into launcher_text.h before it compiles this file.
Build: llvm/bin/clang -O2 -mwindows launcher.c -o TotK-Setup.exe */
Build: llvm/bin/llvm-windres -I runtime -O coff launcher.rc -o launcher_rc.o, then
llvm/bin/clang -O2 -mwindows launcher.c launcher_rc.o -o TotK-Setup.exe */
#include <windows.h>
#include <wchar.h>
+3
View File
@@ -0,0 +1,3 @@
/* The icon of TotK-Setup.exe: runtime/totk.ico, the icon of totk.exe. tools/make_release.py compiles this file with
llvm-windres -I runtime and links it with launcher.c. */
1 ICON "totk.ico"
+1 -1
View File
@@ -6,7 +6,7 @@ Release (docs/installer.md "Release layout"), root = the unpacked folder:
and ../recomp on sys.path, so `python -m installer` imports from the release folder
recomp/, tools/ the lifter and the scripts; recomp/patches-v121.txt, tools/data/expected-v1.2.1.json
llvm/ llvm-mingw (bin/clang.exe)
runtime/ libtotkrt.a, the headers and install-side sources (romfs.c); runtime/deps/ holds
runtime/ libtotkrt.a, the headers, install-side sources (romfs.c) and totk.ico; runtime/deps/ holds
include/ + lib/ of Vulkan, SDL3, Opus, libvpx and VMA (build_game.py --deps)
bin/ totk_xlate.exe (+ totk_xlate.id), hactool.exe, ninja.exe, SDL3.dll, libopus-0.dll
data/shader_list.tsv the MacNativeGames shader list
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

+4 -2
View File
@@ -1,3 +1,5 @@
/* The application manifest of totk.exe (totk.manifest). tools/build_game.py compiles it with the runtime objects, so it
is also a member of libtotkrt.a, which the release links with --whole-archive. */
/* The application manifest of totk.exe (totk.manifest) and its icon (totk.ico, also the icon of TotK-Setup.exe and of
the installer window). tools/build_game.py compiles it with the runtime objects, so it is also a member of
libtotkrt.a, which the release links with --whole-archive. */
1 24 "totk.manifest"
1 ICON "totk.ico"
+5 -1
View File
@@ -281,7 +281,11 @@ def ninja_file(gen, out, mods, pool_depth, skip=(), prebuilt=False, runtime_lib=
sources += [out / 'modules.c']
for src in sources:
o = runtime_object(out, src)
lines.append(f'build {ninja_path(o)}: {"rc" if src.suffix == ".rc" else "cc_rt"} {ninja_path(src)}')
if src.suffix == '.rc': # windres writes no depfile: the files totk.rc embeds are listed by hand
lines.append(f'build {ninja_path(o)}: rc {ninja_path(src)} | {ninja_path(RUNTIME / "totk.manifest")} '
f'{ninja_path(RUNTIME / "totk.ico")}')
else:
lines.append(f'build {ninja_path(o)}: cc_rt {ninja_path(src)}')
rt.append(o)
objs['runtime'] = rt
every = [o for v in objs.values() for o in v]
+6 -2
View File
@@ -97,7 +97,7 @@ LLVM_SKIP_SUFFIXES = {'.idl', '.tlb'}
TOOLS_FILES = ['build_game.py', 'check_content.py', 'extract.py', 'make_romfs_patches.py', 'prepare_shaders.py',
'romfs_index.py', 'shader_census.py']
TOOLS_DIRS = ['vendor/macnativegames', 'data'] # data/: expected hashes
RUNTIME_SUFFIXES = {'.h', '.inc'}
RUNTIME_SUFFIXES = {'.h', '.inc', '.ico'} # .ico: the installer window icon
PROBES = ['--probe-kernel', '--probe-vkexec', '--probe-nvn-tex', '--probe-shader']
@@ -393,8 +393,12 @@ def launcher_header(path):
def build_launcher(out, llvm):
work = MAIN_ROOT / 'build' / 'release-check' / 'launcher'
launcher_header(work / 'launcher_text.h')
env = clean_env(llvm / 'bin')
res = work / 'launcher_rc.o'
run([llvm / 'bin' / 'llvm-windres.exe', '-I', ROOT / 'runtime', '-O', 'coff',
ROOT / 'installer' / 'launcher' / 'launcher.rc', '-o', res], env=env)
run([llvm / 'bin' / 'clang.exe', '-O2', '-mwindows', '-Wall', '-Wl,-s', '-I', work,
ROOT / 'installer' / 'launcher' / 'launcher.c', '-o', out / 'TotK-Setup.exe'], env=clean_env(llvm / 'bin'))
ROOT / 'installer' / 'launcher' / 'launcher.c', res, '-o', out / 'TotK-Setup.exe'], env=env)
# ---- checks ----------------------------------------------------------------------------------------------------------