File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,3 +18,5 @@ build_venv/
1818# PyInstaller Outputs
1919build /
2020dist /
21+ * .spec
22+
Original file line number Diff line number Diff line change @@ -105,14 +105,21 @@ Every designed primer is automatically checked for:
105105
106106### macOS
107107
108- 1 . Double-click the ** ` Primerool.app ` ** application icon.
109- 2 . It will automatically install dependencies if needed, and launch as a native desktop application with a dedicated dock icon.
108+ 1 . Navigate to the ` dist/ ` folder and double-click the ** ` Primerool.app ` ** bundle.
109+ 2 . It will instantly launch as a native PyInstaller desktop application with a custom dock icon.
110+
111+ ** Building for macOS:**
112+ To compile the standalone OS X application yourself, run the automated packager:
113+ ``` bash
114+ ./scripts/build_mac.sh
115+ ```
116+ This will generate the ` dist/Primerool.app ` and ` Primerool.dmg ` installers.
110117
111118### Windows
112119
1131201 . Double-click ** ` Run_primerool.bat ` **
1141212 . If Python isn't installed, it's downloaded automatically — close the window and run the ` .bat ` again after installation
115- 3 . On the second run, the app launches as a native desktop application
122+ 3 . On the second run, the app installs all dependencies and launches as a native desktop application window.
116123
117124### Development / Manual Setup
118125
Original file line number Diff line number Diff line change @@ -26,12 +26,13 @@ def _api(source: str):
2626
2727def get_resource_path (relative_path ):
2828 """Get absolute path to resource, works for dev and for PyInstaller."""
29- try :
30- # PyInstaller creates a temp folder and stores path in _MEIPASS
31- base_path = sys ._MEIPASS
32- except Exception :
29+ if getattr (sys , 'frozen' , False ):
30+ if sys .platform == 'darwin' and '.app/Contents/MacOS' in sys .executable :
31+ base_path = os .path .abspath (os .path .join (os .path .dirname (sys .executable ), '..' , 'Resources' ))
32+ else :
33+ base_path = getattr (sys , '_MEIPASS' , os .path .dirname (sys .executable ))
34+ else :
3335 base_path = os .path .dirname (os .path .abspath (__file__ ))
34-
3536 return os .path .join (base_path , relative_path )
3637
3738app = Flask (__name__ ,
You can’t perform that action at this time.
0 commit comments