mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Change the way we declare root by pyinstaller docs
This commit is contained in:
parent
a96753d3a7
commit
ea11863e35
11
main.py
11
main.py
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user