Fix PyInstaller to point to new resources directory, for OSX and Windows

This commit is contained in:
Micah Lee 2016-04-12 15:21:47 -07:00
parent e81f809882
commit 0b588e543a
2 changed files with 7 additions and 7 deletions

View File

@ -10,10 +10,10 @@ a = Analysis(
pathex=['.'],
binaries=None,
datas=[
('../images/*', 'images'),
('../locale/*', 'locale'),
('../onionshare/*.html', 'html'),
('../version.txt', '.')
('../resources/images/*', 'images'),
('../resources/locale/*', 'locale'),
('../resources/html/*', 'html'),
('../resources/version.txt', '.')
],
hiddenimports=[],
hookspath=[],

View File

@ -41,9 +41,9 @@ def get_resource_path(filename):
resources_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))), 'resources')
else:
# Check if app is "frozen" with pyinstaller
# https://pythonhosted.org/pyinstaller/#run-time-information
if getattr(sys, 'frozen', false):
resources_dir = sys._meipass
# https://pythonhosted.org/PyInstaller/#run-time-information
if getattr(sys, 'frozen', False):
resources_dir = sys._MEIPASS
else:
resources_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))), 'resources')