From 056ac8ebea9bb29b864b34eab46263d51807c6d0 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 22 Oct 2026 22:03:52 +0200 Subject: [PATCH] Bundle Windows CRT with standalone editor packages (by Codex) --- CMakeLists.txt | 3 +++ tools/package/make_editor_package.py | 15 +++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 662b24d..5cfed66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1074,6 +1074,9 @@ if(MSVC) set(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT Runtime) set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE) include(InstallRequiredSystemLibraries) + if(OPENBMH_BUILD_EDITOR) + install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION . COMPONENT Editor) + endif() endif() add_executable(tax_animation_unit_tests tests/tax_animation_unit_tests.cpp) diff --git a/tools/package/make_editor_package.py b/tools/package/make_editor_package.py index 047c680..30ad686 100644 --- a/tools/package/make_editor_package.py +++ b/tools/package/make_editor_package.py @@ -78,19 +78,18 @@ def main(): with tempfile.TemporaryDirectory(prefix='editor-package-') as td: stage = Path(td) / name; stage.mkdir() exe = 'OpenBMHEditor.exe' if args.platform.startswith('windows') else 'OpenBMHEditor' - executable = build / exe - if not executable.exists(): - executable = build / 'Release' / exe - shutil.copy2(executable, stage / exe) - shutil.copytree(build / 'assets/editor', stage / 'assets/editor') + subprocess.run(['cmake', '--install', str(build), '--component', 'Editor', '--config', 'Release', + '--prefix', str(stage)], check=True) shutil.copytree(source / 'docs/licenses', stage / 'licenses') for file in ('LICENSE', 'THIRD_PARTY_NOTICES.md'): shutil.copy2(source / file, stage / file) shutil.copy2(source / 'docs/EDITOR.md', stage / 'EDITOR.md') if args.platform.startswith('windows'): - # Only runtime DLLs produced beside this editor are eligible. - for dll in executable.parent.glob('*.dll'): - shutil.copy2(dll, stage / dll.name) + # Uses the same app-local CRT/UCRT installation as the main game. + # A successful runner launch alone does not prove deployability. + for dll in ('vcruntime140.dll', 'msvcp140.dll'): + if not (stage / dll).is_file(): + raise RuntimeError('Required Windows runtime missing: ' + dll) (stage / 'BUILD.json').write_text(json.dumps({'commit': commit, 'platform': args.platform, 'editor_profile': 'editor-world-v1', 'game_data_included': False}, indent=2) + '\n') zip_tree(stage, args.out / (name + '.zip'))