Unverified Commit 60aed8f4 authored by Paixu Aabuizia's avatar Paixu Aabuizia Committed by Kali Kaneko
Browse files

[bug] vindows initializer does not return state causing the application to always quit

- log the init_platform failure to the critical log
- return True/False in initializer
- remove implementation to install driver and display informative message instead
parent 9c3a713f
......@@ -302,6 +302,7 @@ class MainWindow(QtGui.QMainWindow, SignalTracker):
if not init_platform():
logger.critical('init_platform failed, quitting application.')
......@@ -257,36 +257,19 @@ def WindowsInitializer():
if not _windows_has_tap_device():
msg = QtGui.QMessageBox()
msg.setWindowTitle(msg.tr("TAP Driver"))
msg.setText(msg.tr("Bitmask needs to install the necessary drivers "
"for Encrypted Internet to work. Would you like to "
msg.setText(msg.tr("Bitmask needs a TAP Driver installed "
"for Encrypted Internet to work. Please reinstall "
"bitmask-client to proceed."))
msg.setInformativeText(msg.tr("Encrypted Internet uses VPN, which "
"needs a TAP device installed and none "
"has been found. This will ask for "
"administrative privileges."))
msg.setStandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
ret = msg.exec_()
if ret == QtGui.QMessageBox.Yes:
# XXX should do this only if executed inside bundle.
# Let's assume it's the only way it's gonna be executed under win
# by now.
driver_path = os.path.join(os.getcwd(),
dev_installer = os.path.join(driver_path,
if os.path.isfile(dev_installer) and \
stat.S_IXUSR & os.stat(dev_installer)[stat.ST_MODE] != 0:
inf_path = os.path.join(driver_path,
cmd = [dev_installer, "install", inf_path, "tap0901"]
ret = subprocess.call(cmd, stdout=subprocess.PIPE, shell=True)
logger.error("Tried to install TAP driver, but the installer "
"is not found or not executable")
"has been found. The bitmask-client "
"installer prompts for installing the "
"TAP Driver."))
logger.error('TAP Drivers not installed')
return False
return True
# Darwin initializer functions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment