aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2021-12-21 14:15:52 -0800
committerMicah Lee <micah@micahflee.com>2021-12-21 14:15:52 -0800
commitf4fb212dbc7d0a027080c5f8c325c32ee2362072 (patch)
tree59595cfed29918387143fd67389277e62047ae85 /cli
parentbd12949652b577ae993f26db278531dd4223ce7b (diff)
downloadonionshare-f4fb212dbc7d0a027080c5f8c325c32ee2362072.tar.gz
onionshare-f4fb212dbc7d0a027080c5f8c325c32ee2362072.zip
Fix finding tor binary paths in Windows
Diffstat (limited to 'cli')
-rw-r--r--cli/onionshare_cli/common.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/onionshare_cli/common.py b/cli/onionshare_cli/common.py
index a8e32411..d7f3fdac 100644
--- a/cli/onionshare_cli/common.py
+++ b/cli/onionshare_cli/common.py
@@ -329,8 +329,19 @@ class Common:
tor_geo_ip_file_path = os.path.join(prefix, "share/tor/geoip")
tor_geo_ipv6_file_path = os.path.join(prefix, "share/tor/geoip6")
elif self.platform == "Windows":
+ # In Windows, the Tor binaries are in the onionshare package, not the onionshare_cli package
base_path = self.get_resource_path("tor")
+ base_path = base_path.replace("onionshare_cli", "onionshare")
tor_path = os.path.join(base_path, "Tor", "tor.exe")
+
+ # If tor.exe isn't there, mayber we're running from the source tree
+ if not os.path.exists(tor_path):
+ base_path = os.path.join(os.getcwd(), "onionshare", "resources", "tor")
+ tor_path = os.path.join(base_path, "Tor", "tor.exe")
+
+ if not os.path.exists(tor_path):
+ print("Error: Cannot find tor.exe")
+
obfs4proxy_file_path = os.path.join(base_path, "Tor", "obfs4proxy.exe")
snowflake_file_path = os.path.join(base_path, "Tor", "snowflake-client.exe")
meek_client_file_path = os.path.join(base_path, "Tor", "meek-client.exe")