Merge branch 'bug/win-root-path' into 'dev'

Change the way we declare root by pyinstaller docs

See merge request crafty-controller/crafty-4!491
This commit is contained in:
Iain Powrie 2022-10-22 19:59:44 +00:00
commit 2293257f89
2 changed files with 10 additions and 2 deletions

View File

@ -11,6 +11,7 @@
- Add timeout to socket for servers with incorrect port selection ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/482))
- Fix server_stats db file when deleting server ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/486))
- Fix "cannot render after finish" from backup_now ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/489))
- Fix Support Logs on windows by changing the way we declare projects working directory ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/491))
### Tweaks
- Fix sidebar to not move when scrolling ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/481))
- Add the rest of CSS predefined colors to themes ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/477))

11
main.py
View File

@ -197,8 +197,15 @@ if __name__ == "__main__":
if not controller.check_system_user():
controller.add_system_user()
project_root = os.path.dirname(__file__)
controller.set_project_root(project_root)
if getattr(sys, "frozen", False):
# If the application is run as a bundle, the PyInstaller bootloader
# extends the sys module by a flag frozen=True and sets the app
# path into variable _MEIPASS'.
application_path = sys._MEIPASS
else:
application_path = os.path.dirname(os.path.abspath(__file__))
controller.set_project_root(application_path)
controller.clear_unexecuted_commands()
controller.clear_support_status()