aboutsummaryrefslogtreecommitdiff
path: root/onionshare
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2019-11-27 14:54:41 -0800
committerMicah Lee <micah@micahflee.com>2019-11-27 14:54:41 -0800
commit347d6ab19f911b12b6274f365cf9b2a6b122f37b (patch)
treee25685e7948ebcb8fe7af081e09963137e56a62a /onionshare
parentb9bec64e07a5f431fefe95d62e29f078fb268bbe (diff)
downloadonionshare-347d6ab19f911b12b6274f365cf9b2a6b122f37b.tar.gz
onionshare-347d6ab19f911b12b6274f365cf9b2a6b122f37b.zip
Make Common.get_resource_path find the resource path relative to the binary, instead of using an absolute path
Diffstat (limited to 'onionshare')
-rw-r--r--onionshare/common.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/onionshare/common.py b/onionshare/common.py
index d97f0ccb..48f52098 100644
--- a/onionshare/common.py
+++ b/onionshare/common.py
@@ -97,8 +97,10 @@ class Common(object):
)
elif self.platform == "BSD" or self.platform == "Linux":
- # Assume OnionShare is installed systemwide in Linux, since we're not running in dev mode
- prefix = os.path.join(sys.prefix, "share/onionshare")
+ # Look for resources relative to the binary, so if the binary is /usr/bin/onionshare-gui and
+ # the resource dir is /usr/share/onionshare, then the resource dir relative to the binary dir
+ # is ../share/onionshare
+ prefix = os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), "share/onionshare")
elif getattr(sys, "frozen", False):
# Check if app is "frozen"