On Windows, QStandardPaths::writableLocation(QStandardPaths::DataLocation) will return a path that is not writable when being called from a low-integrity process. This causes problems for Qt applications & libraries, including QtWebEngine, that relies on the path being writable.
The function currently return %USERPROFILE%\AppData\Local, whereas it would probably be better to return %USERPROFILE%\AppData\LocalLow if running in a low integrity process.
"Low integrity" processes is a security sandboxing technique to make the filesystem read-only for a Windows application, with a few exceptions. It is typically used to run untrusted code more securely, but can also be used for protecting the integrity of an embedded device. Most of Qt already run fine on low-integrity, but the QStandardPaths::writableLocation implementation is causing problems for applications using QtWebEngine.
- Build QtWebEngine "minimal" sample (https://doc.qt.io/qt-5/qtwebengine-webengine-minimal-example.html) in debug mode.
- Start command prompt with admin permissions and run "icacls minimal.exe /setintegritylevel Low" so that it will run in low integrity.
- Start minimal.exe with a debugger attached.
- Observe the following (and many more) errors in the Visual Studio "Output" window:
My organization is also experiencing a more severe crash in an application using QtWebEngine that is triggered by the same root cause. However, this crash does not seem to occur in the "minimal" sample.