Option to disable sandbox on Windows network drive

This commit is contained in:
sgourdas 2024-08-16 00:04:07 +03:00
parent 32f0ee581e
commit 26f610c830
2 changed files with 5 additions and 3 deletions

View File

@ -177,5 +177,6 @@
"export-reading-list": "Export reading list",
"export-reading-list-error": "An error has occured during export of the reading list.",
"import-reading-list": "Import reading list",
"import-reading-list-error": "An error has occured during import of the reading list."
"import-reading-list-error": "An error has occured during import of the reading list.",
"disable-sandbox": "Application was launched from a network drive. This is known to cause compatibility issues due to the sandbox. Do you want to take the risks and disable it?"
}

View File

@ -26,8 +26,9 @@ int main(int argc, char *argv[])
std::string driveLetter = kiwix::getExecutablePath().substr(0, 3);
UINT driveType = GetDriveTypeA(driveLetter.c_str());
if(driveType == DRIVE_REMOTE) {
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", QByteArray("--no-sandbox"));
qInfo() << "Disabled sandbox";
int msgboxID = MessageBoxA(NULL, gt("disable-sandbox"), gt("about-kiwix-desktop-title"), MB_YESNO | MB_ICONQUESTION);
if (msgboxID == IDYES)
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", QByteArray("--no-sandbox"));
}
#endif
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)