mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-30 17:56:19 -05:00
Update helpers.get_resource_path to correctly find resources in frozen macOS app bundles
This commit is contained in:
parent
42d2b0b417
commit
6f5a3aedbb
@ -42,9 +42,14 @@ def get_resource_path(filename):
|
|||||||
elif p == 'Linux' and sys.argv and sys.argv[0].startswith(sys.prefix):
|
elif p == 'Linux' and sys.argv and sys.argv[0].startswith(sys.prefix):
|
||||||
# OnionShare is installed systemwide in Linux
|
# OnionShare is installed systemwide in Linux
|
||||||
resources_dir = os.path.join(sys.prefix, 'share/onionshare')
|
resources_dir = os.path.join(sys.prefix, 'share/onionshare')
|
||||||
elif getattr(sys, 'frozen', False): # Check if app is "frozen" with cx_Freeze
|
|
||||||
# http://cx-freeze.readthedocs.io/en/latest/faq.html#using-data-files
|
elif getattr(sys, 'frozen', False):
|
||||||
resources_dir = os.path.join(os.path.dirname(sys.executable), 'resources')
|
# Check if app is "frozen"
|
||||||
|
# https://pythonhosted.org/PyInstaller/#run-time-information
|
||||||
|
if p == 'Darwin':
|
||||||
|
resources_dir = sys._MEIPASS
|
||||||
|
elif p == 'Windows':
|
||||||
|
resources_dir = os.path.join(os.path.dirname(sys.executable), 'resources')
|
||||||
|
|
||||||
return os.path.join(resources_dir, filename)
|
return os.path.join(resources_dir, filename)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user