Closed NWylynko closed 4 years ago
third commit e3a2814
adds a function that returns the directory that the program is running in so the image can be open. This is needed on macos because a .app is just a folder and the directory its run from is not the same directory the program is run from. So it crashes on launch because it cant open the image. this fixes it by using sys._MEIPASS
which only works when getting run my the pyinstaller app. it needs to be in a try except because it will fail when the program.py file is run for development, so it fails over to local directory which is what it should be.
third commit
e3a2814
adds a function that returns the directory that the program is running in so the image can be open. This is needed on macos because a .app is just a folder and the directory its run from is not the same directory the program is run from. So it crashes on launch because it cant open the image. this fixes it by usingsys._MEIPASS
which only works when getting run my the pyinstaller app. it needs to be in a try except because it will fail when the program.py file is run for development, so it fails over to local directory which is what it should be.
I currently have it set up to copy over the images folder to the application. Therefore the path images/ThePassiveInvestorPNG.png
can still be used. Is this what you were trying to fix with this commit? As the .exe does not seem to crash for me with the current set-up.
I currently have it set up to copy over the images folder to the application. Therefore the path
images/ThePassiveInvestorPNG.png
can still be used. Is this what you were trying to fix with this commit? As the .exe does not seem to crash for me with the current set-up.
I'm building and running it on MacOs and the app will crash if this fix isn't used, it won't effect the windows version from what i can tell but you should probs test it to double check.
Added, and slightly adjusting, much of what you added. Thank you for that. I do have a few questions though:
start dist\ThePassiveInvestor.exe
. I ask this because there is a subfolder created within the dist folder named 'ThePassiveInvestor'. Therefore you have to write start dist\ThePassiveInvestor\ThePassiveInvestor.exe
.
.DS_store is an auto generated file by MacOs that shouldn't be commited, .vs_code is a generated folder that is created when a dev changes a setting with visual studio code so its only local to that dev and shouldn't be commited because it will effect other devs environments in annoying ways.
added infomation to help devs who arent familiar with how to build the app.