Skip to content


Validate that Dropbox runs after downloading it
Browse files Browse the repository at this point in the history
Validate that Dropbox can run by running `dropboxd /testrun 0`.
Show an error message that points users to the system requirements
help page if it won't run.

origin commit:
  • Loading branch information
samertm authored and raveit65 committed Jan 9, 2019
1 parent 3d511a6 commit 192451f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ WARNING = u"In order to use Dropbox, you must download the proprietary daemon."
GPG_WARNING = u"Note: python-gpg (python-gpgme for Ubuntu 17.04 and lower) is not installed, we will not be able to verify binary signatures."
ERROR_CONNECTING = u"Trouble connecting to Dropbox servers. Maybe your internet connection is down, or you need to set your http_proxy environment variable."
ERROR_SIGNATURE = u"Downloaded binary does not match Dropbox signature, aborting install."
ERROR_INVALID_DROPBOX = u"Could not run Dropbox. Make sure your computer meets the minimum requirements:\n"

Expand Down Expand Up @@ -288,6 +289,35 @@ class DownloadState(object):
if not self.local_file.closed:

def is_dropbox_valid(self):
Validate that Dropbox runs, so we can show an error
message to the user if it doesn't work.
Returns True if Dropbox can run, false otherwise.
db_path = DROPBOXD_PATH.encode(sys.getfilesystemencoding())
f = open("/dev/null", "w")
a = subprocess.Popen([db_path, "/testrun", "0"], preexec_fn=os.setsid, cwd=os.path.expanduser("~"),
stderr=sys.stderr, stdout=f, close_fds=True)
except Exception, ex:
print ex
return False

# in seconds
interval = 0.5
wait_for = 30
for i in xrange(int(wait_for / interval)):
ret_val = a.poll()
if ret_val is None:
return ret_val == 0

return False

def load_serialized_images():
global box_logo_pixbuf, window_icon
import gtk
Expand Down Expand Up @@ -408,6 +438,8 @@ if GUI_AVAILABLE:

def finished():
self.update_progress(UNPACKING, 1.0)
if not

def error(ex):
Expand Down Expand Up @@ -592,6 +624,9 @@ else:
setprogress(UNPACKING, 1.0)

if not download.is_dropbox_valid():


class CommandTicker(threading.Thread):
Expand Down

0 comments on commit 192451f

Please sign in to comment.