Changed GUI build to pyinstaller.

This commit is contained in:
Joey Payne 2015-09-27 18:00:48 -06:00
commit 7c2a837c9d
2 changed files with 21 additions and 9 deletions

View file

@ -7,16 +7,22 @@ cp -rf files Web2ExeMac-CMD/files/
rm -rf build dist Web2Executable.app
sudo python build_mac_setup.py py2app --iconfile icon.icns
#sudo python build_mac_setup.py py2app --iconfile icon.icns
pyinstaller -w --hidden-import PIL.Jpeg2KImagePlugin --hidden-import PyQt4 --hidden-import configobj --hidden-import pkg_resources --distpath Web2ExeMac --onefile -n Web2Executable main.py
sudo chown -R joey dist/Web2Executable.app
sudo chown -R joey dist/ build/
mv dist/Web2Executable.app Web2Executable.app
#sudo chown -R joey dist/Web2Executable.app
#sudo chown -R joey dist/ build/
#mv dist/Web2Executable.app Web2Executable.app
rm -rf Web2Executable.app/Contents/Frameworks/QtDesigner*
rm -rf Web2Executable.app/Contents/Frameworks/QtXml*
rm -rf Web2Executable.app/Contents/Frameworks/QtWebKit*
rm -rf Web2Executable.app/Contents/Frameworks/QtScript*
mv Web2ExeMac/Web2Executable.app .
#rm -rf Web2Executable.app/Contents/Frameworks/QtDesigner*
#rm -rf Web2Executable.app/Contents/Frameworks/QtXml*
#rm -rf Web2Executable.app/Contents/Frameworks/QtWebKit*
#rm -rf Web2Executable.app/Contents/Frameworks/QtScript*
cp icon.icns Web2Executable.app/Contents/Resources/icon-windowed.icns
cp -rf files Web2Executable.app/Contents/MacOS/
rm -rf build dist

View file

@ -42,11 +42,17 @@ from configobj import ConfigObj
inside_packed_exe = getattr(sys, 'frozen', '')
CWD = os.getcwd()
if inside_packed_exe:
# we are running in a |PyInstaller| bundle
CWD = os.path.dirname(sys.executable)
else:
# we are running in a normal Python environment
CWD = os.getcwd()
def get_file(path):
parts = path.split('/')
independent_path = os.path.join(CWD, *parts)
print independent_path
return independent_path
TEMP_DIR = get_temp_dir()