diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py index e728577e..b8f7e299 100644 --- a/onionshare/onionshare.py +++ b/onionshare/onionshare.py @@ -223,7 +223,18 @@ def start_hidden_service(port): except SocketError: pass if not controller: - raise NoTor(translated("cant_connect_ctrlport").format(controlports)) + if sys.platform == 'win32' or sys.platform == 'darwin': + additional_instructions = "If Tor is installed, please make sure that it is running and try launching" \ + " Onionshare again.\nIf Tor is not installed, please download and " \ + "install it from www.torproject.com" + raise NoTor(translated("cant_connect_ctrlport").format(controlports, additional_instructions)) + elif sys.platform == 'linux2': + def start_torbrowser_launcher(): + """will attempt to start package with a try/except block, if an exception is raised, will + instruct to download tor browser bundle.""" + pass + raise NoTor(translated("cant_connect_ctrlport").format(controlports, "is Tor running?")) + controller.authenticate() # set up hidden service diff --git a/onionshare/strings.json b/onionshare/strings.json index 6512cbef..d9063bc2 100644 --- a/onionshare/strings.json +++ b/onionshare/strings.json @@ -3,7 +3,7 @@ "closing_hole": "Closing hole in firewall.", "calculating_sha1": "Calculating SHA1 checksum.", "connecting_ctrlport": "Connecting to Tor control port to set up hidden service on port {0}.", - "cant_connect_ctrlport": "Cannot connect to Tor control port on port {0}. Is Tor running?", + "cant_connect_ctrlport": "Cannot connect to Tor control port on port {0}. {1}", "give_this_url": "Give this URL to the person you're sending the file to:", "ctrlc_to_stop": "Press Ctrl-C to stop server", "not_a_file": "{0} is not a file.",