from pathlib import Path import os import struct project_root = Path(SPECPATH).parent assets_root = project_root / 'src' / 'cbb_refresh_verify' / 'assets' bridge_path = project_root / 'tools' / 'status_bridge' / 'bin' / 'CbbStatusBridge32.exe' verify_probe_path = project_root / 'tools' / 'status_bridge' / 'bin' / 'VerifyProbe32.exe' # App-local x86 runtime belongs beside the x86 bridge, separate from Qt/Python. bridge_runtime = [] if bridge_path.is_file(): runtime_root = Path(os.environ.get('WINDIR', r'C:\Windows')) / 'SysWOW64' for name in ('mfc140.dll', 'msvcp140.dll', 'vcruntime140.dll', 'concrt140.dll'): runtime = runtime_root / name if not runtime.is_file(): raise RuntimeError(f'Install the Microsoft VC++ 2015-2022 x86 runtime before packaging: {runtime}') data = runtime.read_bytes() pe_offset = struct.unpack_from('