allow continuing on unsupported platform if desired
This commit is contained in:
40
portable_computing_toolkit_installer/ui/installer_wizard.py
Normal file → Executable file
40
portable_computing_toolkit_installer/ui/installer_wizard.py
Normal file → Executable file
@@ -111,27 +111,27 @@ class InstallerWizard(QtWidgets.QWizard):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
if not platform.system() == 'Windows' or int(platform.release()) < 7:
|
if not platform.system() == 'Windows' or int(platform.release()) < 7:
|
||||||
reply.abort()
|
if QtWidgets.QMessageBox.question(self, "", "This toolkit requires Microsoft Windows 7 or newer to be used. Continue anyway?") in (QtWidgets.QMessageBox.No, 0):
|
||||||
process_dialog.cancel()
|
reply.abort()
|
||||||
self._display_error("This toolkit requires Microsoft Windows 7 or newer")
|
process_dialog.cancel()
|
||||||
return False
|
|
||||||
elif not platform.machine() == 'AMD64':
|
|
||||||
reply.abort()
|
|
||||||
process_dialog.cancel()
|
|
||||||
self._display_error("Parts of this toolkit require a 64-bit processor. Please open an issue on Github if you absolutely need it all 32-bit")\
|
|
||||||
.buttonClicked.connect(lambda: webbrowser.open_new_tab(self._project_page/"issues"))
|
|
||||||
return False
|
|
||||||
else:
|
|
||||||
while reply.isRunning():
|
|
||||||
QtWidgets.QApplication.instance().processEvents()
|
|
||||||
QtCore.QThread.currentThread().msleep(100)
|
|
||||||
if not reply.error():
|
|
||||||
self.license.setHtml(bytearray(reply.readAll()).decode("utf-8"))
|
|
||||||
return True
|
|
||||||
else:
|
|
||||||
self._display_error(f"Encountered a {QtCore.QMetaEnum.valueToKey(reply.error())} while testing Internet connectivity")
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if not platform.machine().lower() in ('amd64', 'x86_64'):
|
||||||
|
if QtWidgets.QMessageBox.question(self, "", "Parts of this toolkit require a 64-bit processor. Continue anyway?") in (QtWidgets.QMessageBox.No, 0):
|
||||||
|
reply.abort()
|
||||||
|
process_dialog.cancel()
|
||||||
|
return False
|
||||||
|
|
||||||
|
while reply.isRunning():
|
||||||
|
QtWidgets.QApplication.instance().processEvents()
|
||||||
|
QtCore.QThread.currentThread().msleep(100)
|
||||||
|
if not reply.error():
|
||||||
|
self.license.setHtml(bytearray(reply.readAll()).decode("utf-8"))
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
self._display_error(f"Encountered an error while testing Internet connectivity:\n\n{reply.errorString()}")
|
||||||
|
return False
|
||||||
|
|
||||||
def _display_error(self, message, details = None):
|
def _display_error(self, message, details = None):
|
||||||
"""Displays an error message.
|
"""Displays an error message.
|
||||||
|
|
||||||
@@ -365,7 +365,7 @@ class InstallerWizard(QtWidgets.QWizard):
|
|||||||
assert self._download_error.empty()
|
assert self._download_error.empty()
|
||||||
|
|
||||||
|
|
||||||
@QtCore.pyqtSignal(str, int, int)
|
@QtCore.pyqtSlot(str, int, int)
|
||||||
def track_progress(self, tool_name, bytes_received, bytes_total):
|
def track_progress(self, tool_name, bytes_received, bytes_total):
|
||||||
if tool_name not in [tool["name"] for tool in self.__tools__]:
|
if tool_name not in [tool["name"] for tool in self.__tools__]:
|
||||||
return
|
return
|
||||||
|
|||||||
0
portable_computing_toolkit_installer/ui/installer_wizard.ui
Normal file → Executable file
0
portable_computing_toolkit_installer/ui/installer_wizard.ui
Normal file → Executable file
Reference in New Issue
Block a user