diff options
Diffstat (limited to 'desktop/install/get-tor-windows.py')
-rw-r--r-- | desktop/install/get-tor-windows.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/desktop/install/get-tor-windows.py b/desktop/install/get-tor-windows.py index 8b3e3c72..33de056b 100644 --- a/desktop/install/get-tor-windows.py +++ b/desktop/install/get-tor-windows.py @@ -43,17 +43,15 @@ def main(): root_path = os.path.dirname( os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) ) - working_path = os.path.join(os.path.join(root_path, "build"), "tor") + working_path = os.path.join(root_path, "build", "tor") exe_path = os.path.join(working_path, exe_filename) - dist_path = os.path.join( - os.path.join(os.path.join(root_path, "dist"), "onionshare"), "tor" - ) + dist_path = os.path.join(root_path, "src", "onionshare", "resources", "tor") # Make sure the working folder exists if not os.path.exists(working_path): os.makedirs(working_path) - # Make sure the zip is downloaded + # Make sure Tor Browser is downloaded if not os.path.exists(exe_path): print("Downloading {}".format(exe_url)) r = requests.get(exe_url) @@ -71,26 +69,24 @@ def main(): sys.exit(-1) # Extract the bits we need from the exe - cmd = [ + subprocess.Popen([ "7z", "e", "-y", exe_path, "Browser\TorBrowser\Tor", "-o%s" % os.path.join(working_path, "Tor"), - ] - cmd2 = [ + ]).wait() + subprocess.Popen([ "7z", "e", "-y", exe_path, "Browser\TorBrowser\Data\Tor\geoip*", "-o%s" % os.path.join(working_path, "Data"), - ] - subprocess.Popen(cmd).wait() - subprocess.Popen(cmd2).wait() + ]).wait() - # Copy into dist + # Copy into the onionshare resources if os.path.exists(dist_path): shutil.rmtree(dist_path) os.makedirs(dist_path) |