# -*- mode: python ; coding: utf-8 -*- import json from pathlib import Path # Load config.json config_path = Path("config.json") with config_path.open("r", encoding="utf-8") as f: config = json.load(f) # Extract values version = config.get("app_version", "0.0.0") arch = config.get("architecture", "x64") python_version = config.get("python_version", "3.x") os = config.get("app_os", "Windows") name = config.get("app_name", "Application") # Construct dynamic name name = f"{name}-{os}-{arch}-v{version}" # Optional icon path (can still be overridden via environment if needed) from os import getenv icon = getenv("ICON_PATH", "") # Data files to bundle datas = [ ("data/assets/*", "data/assets/"), ("data/", "data/") ] binaries = [] a = Analysis( ["main.py"], pathex=[], binaries=binaries, datas=datas, hiddenimports=[], hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], noarchive=False, optimize=0, ) pyz = PYZ(a.pure) exe = EXE( pyz, a.scripts, a.binaries, a.datas, [], name=name, icon=icon if icon else None, debug=False, bootloader_ignore_signals=False, strip=False, upx=True, upx_exclude=[], runtime_tmpdir=None, console=False, disable_windowed_traceback=False, argv_emulation=False, target_arch=None, codesign_identity=None, entitlements_file=None, )