diff options
author | Micah Lee <micah@micahflee.com> | 2020-04-05 21:03:29 -0700 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2020-04-05 21:03:29 -0700 |
commit | da13a166a1a4867cb2555c9188e461da7c207d9a (patch) | |
tree | fd2d299e52fbb09fb5aee67a75831cc4457ccf73 /onionshare | |
parent | 4fdf53f4937c6f450a91fcb430e2bd6d2411af5a (diff) | |
parent | e253b065492ddc68df8ea43ba8a9458a60f45ecc (diff) | |
download | onionshare-da13a166a1a4867cb2555c9188e461da7c207d9a.tar.gz onionshare-da13a166a1a4867cb2555c9188e461da7c207d9a.zip |
Merge branch '910_flatpak' of github.com:micahflee/onionshare into 910_flatpak
Diffstat (limited to 'onionshare')
-rw-r--r-- | onionshare/common.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/onionshare/common.py b/onionshare/common.py index 7048c174..08c67899 100644 --- a/onionshare/common.py +++ b/onionshare/common.py @@ -97,8 +97,10 @@ class Common: ) 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" @@ -112,10 +114,11 @@ class Common: def get_tor_paths(self): if self.platform == "Linux": - tor_path = "/usr/bin/tor" - tor_geo_ip_file_path = "/usr/share/tor/geoip" - tor_geo_ipv6_file_path = "/usr/share/tor/geoip6" - obfs4proxy_file_path = "/usr/bin/obfs4proxy" + prefix = os.path.dirname(os.path.dirname(sys.argv[0])) + tor_path = os.path.join(prefix, "bin/tor") + tor_geo_ip_file_path = os.path.join(prefix, "share/tor/geoip") + tor_geo_ipv6_file_path = os.path.join(prefix, "share/tor/geoip6") + obfs4proxy_file_path = os.path.join(prefix, "bin/obfs4proxy") elif self.platform == "Windows": base_path = os.path.join( os.path.dirname(os.path.dirname(self.get_resource_path(""))), "tor" |