Stop the runtime hook from planting a bundled config on first run

_compy_bundled_resources() in the PyInstaller runtime hook copied
config/app_config.json next to the .exe on first start. With the config no
longer bundled (see the first-run setup commit) that copy would simply fail,
but leaving the entry in place keeps the intent alive and would re-plant a stale
config if the file were ever added back to the bundle.

The hook now copies only the resource files (icons, intro video), and the
comment explains why the config is deliberately absent: the player must start
unconfigured so it asks the operator for the server details instead of
inheriting the build machine's settings.
This commit is contained in:
ske087
2026-09-13 10:15:26 +03:00
parent 079d8c7f9d
commit 864ea06996
+7 -2
View File
@@ -110,13 +110,18 @@ def _setup_paths():
def _copy_bundled_resources():
"""Copy bundled resource/config files to the local folders on first run."""
"""Copy bundled resource files to the local folders on first run.
NOTE: app_config.json is intentionally absent. It is not bundled (see
build.spec) because shipping it would plant the build machine's server
settings into a fresh install. The player instead starts unconfigured and
runs its first-run setup, writing a real config next to the .exe.
"""
exe_dir = Path(sys.executable).parent
internal_dir = Path(getattr(sys, '_MEIPASS', exe_dir))
# Files to copy (source in bundle -> destination next to .exe)
files_to_copy = [
('config/app_config.json', 'config/app_config.json'),
('config/resources/access-card.png', 'config/resources/access-card.png'),
('config/resources/arrow.png', 'config/resources/arrow.png'),
('config/resources/backward.png', 'config/resources/backward.png'),