fix: align resource and runtime paths

This commit is contained in:
2026-06-15 17:13:36 +08:00
parent 519bb9a6d2
commit a6a8504ea8
3 changed files with 20 additions and 5 deletions
+8 -2
View File
@@ -30,8 +30,14 @@ def get_app_dir():
def get_resource_path(relative_path):
"""Return absolute Path for a file under <app_dir>/resources/."""
return get_app_dir() / "resources" / relative_path
"""Return absolute Path for a resource file.
Development resources live under src/resources/. In a PyInstaller onedir
build, resources are copied next to the executable under resources/.
"""
if getattr(sys, "frozen", False):
return get_app_dir() / "resources" / relative_path
return get_app_dir() / "src" / "resources" / relative_path
def get_config_path(relative_path):