3

I need help to correctly deploy a Qt 5.14.1 x64 application to a client's Windows 10 PC. The application uses the QtWebEngineProcess to display a google map in one of the tabbed interface windows.

This used to work fine until either the Visual Studio 2019 (currently at the latest Version 16.4.5) was updated or the Version of QT was updated from the prior version - I think that used version 5.13.2. I cannot tell which change caused the error.

The problem is that when the application launches on the client's PC (without Visual Studio or Qt). When I double click on the application, it pauses for a few seconds and eventually it pops up a dialog indicating that it could not find Qt5Core.dll. (which is in the same folder as the application) and shortly thereafter it shows another dialog with error code 0xc0000022.

These are associated with a child process (QtWebEngineProcess.exe) that gets instantiated from my main application executable (app739.exe).

Comparing the working (prior) version to the current working version, I noticed that there was a new DLL dependency on VCRUNTIME140_1.dll. This seems to have something to do with exception handling, however the QtWebEngineProcess.exe does not have this dll listed as a dependency.

The application was deployed as follows:

F:\Common\coffey\CoPilotTesterV23.0\app739.exe 64 bit, release executable
Adding Qt5Svg for qsvgicon.dll
Skipping plugin qmldbg_debugger.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_inspector.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Skipping plugin qmldbg_local.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_messages.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_native.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_nativedebugger.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_preview.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Skipping plugin qmldbg_profiler.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_quickprofiler.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Skipping plugin qmldbg_server.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_tcp.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qsgd3d12backend.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Direct dependencies: Qt5Core Qt5Gui Qt5SerialPort Qt5Widgets Qt5WebEngineWidgets Qt5WebChannel
All dependencies   : Qt5Core Qt5Gui Qt5Network Qt5Positioning Qt5PrintSupport Qt5Qml Qt5Quick Qt5QuickWidgets Qt5SerialPort Qt5Widgets Qt5WebEngineCore Qt5WebEngineWidgets Qt5WebChannel
To be deployed     : Qt5Core Qt5Gui Qt5Network Qt5Positioning Qt5PrintSupport Qt5Qml Qt5Quick Qt5QuickWidgets Qt5SerialPort Qt5Svg Qt5Widgets Qt5WebEngineCore Qt5WebEngineWidgets Qt5WebChannel
Qt5QmlModels.dll is up to date.
Qt5Core.dll is up to date.
Qt5Gui.dll is up to date.
Qt5Network.dll is up to date.
Qt5Positioning.dll is up to date.
Qt5PrintSupport.dll is up to date.
Qt5Qml.dll is up to date.
Qt5Quick.dll is up to date.
Qt5QuickWidgets.dll is up to date.
Qt5SerialPort.dll is up to date.
Qt5Svg.dll is up to date.
Qt5Widgets.dll is up to date.
Qt5WebEngineCore.dll is up to date.
Qt5WebEngineWidgets.dll is up to date.
Qt5WebChannel.dll is up to date.
libGLESV2.dll is up to date.
libEGL.dll is up to date.
d3dcompiler_47.dll is up to date.
opengl32sw.dll is up to date.
qgenericbearer.dll is up to date.
qsvgicon.dll is up to date.
qgif.dll is up to date.
qicns.dll is up to date.
qico.dll is up to date.
qjpeg.dll is up to date.
qsvg.dll is up to date.
qtga.dll is up to date.
qtiff.dll is up to date.
qwbmp.dll is up to date.
qwebp.dll is up to date.
qwindows.dll is up to date.
qtposition_positionpoll.dll is up to date.
qtposition_serialnmea.dll is up to date.
qtposition_winrt.dll is up to date.
windowsprintersupport.dll is up to date.
qwindowsvistastyle.dll is up to date.
Deploying: QtWebEngineProcess...
QtWebEngineProcess.exe is up to date.
F:\Common\coffey\CoPilotTesterV23.0\app739.exe 64 bit, release executable
Adding Qt5Svg for qsvgicon.dll
Skipping plugin qmldbg_debugger.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_inspector.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Skipping plugin qmldbg_local.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_messages.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_native.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_nativedebugger.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_preview.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Skipping plugin qmldbg_profiler.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_quickprofiler.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Skipping plugin qmldbg_server.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qmldbg_tcp.dll due to disabled dependencies (Qt5Qml).
Skipping plugin qsgd3d12backend.dll due to disabled dependencies (Qt5Qml Qt5Quick).
Direct dependencies: Qt5Core Qt5Gui Qt5SerialPort Qt5Widgets Qt5WebEngineWidgets Qt5WebChannel
All dependencies   : Qt5Core Qt5Gui Qt5Network Qt5Positioning Qt5PrintSupport Qt5Qml Qt5Quick Qt5QuickWidgets Qt5SerialPort Qt5Widgets Qt5WebEngineCore Qt5WebEngineWidgets Qt5WebChannel
To be deployed     : Qt5Core Qt5Gui Qt5Network Qt5Positioning Qt5PrintSupport Qt5Qml Qt5Quick Qt5QuickWidgets Qt5SerialPort Qt5Svg Qt5Widgets Qt5WebEngineCore Qt5WebEngineWidgets Qt5WebChannel
Qt5QmlModels.dll is up to date.
Qt5Core.dll is up to date.
Qt5Gui.dll is up to date.
Qt5Network.dll is up to date.
Qt5Positioning.dll is up to date.
Qt5PrintSupport.dll is up to date.
Qt5Qml.dll is up to date.
Qt5Quick.dll is up to date.
Qt5QuickWidgets.dll is up to date.
Qt5SerialPort.dll is up to date.
Qt5Svg.dll is up to date.
Qt5Widgets.dll is up to date.
Qt5WebEngineCore.dll is up to date.
Qt5WebEngineWidgets.dll is up to date.
Qt5WebChannel.dll is up to date.
libGLESV2.dll is up to date.
libEGL.dll is up to date.
d3dcompiler_47.dll is up to date.
opengl32sw.dll is up to date.
qgenericbearer.dll is up to date.
qsvgicon.dll is up to date.
qgif.dll is up to date.
qicns.dll is up to date.
qico.dll is up to date.
qjpeg.dll is up to date.
qsvg.dll is up to date.
qtga.dll is up to date.
qtiff.dll is up to date.
qwbmp.dll is up to date.
qwebp.dll is up to date.
qwindows.dll is up to date.
qtposition_positionpoll.dll is up to date.
qtposition_serialnmea.dll is up to date.
qtposition_winrt.dll is up to date.
windowsprintersupport.dll is up to date.
qwindowsvistastyle.dll is up to date.
icudtl.dat is up to date.
qtwebengine_devtools_resources.pak is up to date.
qtwebengine_resources.pak is up to date.
qtwebengine_resources_100p.pak is up to date.
qtwebengine_resources_200p.pak is up to date.
en-US.pak is up to date.

This is the dependency info:

F:\Common\coffey\CoPilotTesterV23.0>dumpbin /dependents app739.exe
Microsoft (R) COFF/PE Dumper Version 14.24.28316.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file app739.exe

File Type: EXECUTABLE IMAGE

  Image has the following dependencies:

    BTI42964.dll
    Qt5WebEngineWidgets.dll
    Qt5Widgets.dll
    Qt5Gui.dll
    Qt5SerialPort.dll
    Qt5WebChannel.dll
    Qt5Core.dll
    MSVCP140.dll
    WS2_32.dll
    BTICard64.dll
    KERNEL32.dll
    VCRUNTIME140.dll
    VCRUNTIME140_1.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-math-l1-1-0.dll
    api-ms-win-crt-convert-l1-1-0.dll
    api-ms-win-crt-locale-l1-1-0.dll
    api-ms-win-crt-filesystem-l1-1-0.dll
    api-ms-win-crt-time-l1-1-0.dll
    SHELL32.dll
    api-ms-win-crt-utility-l1-1-0.dll

  Summary

        C000 .data
       13000 .pdata
       FF000 .rdata
        3000 .reloc
       4C000 .rsrc
      1BC000 .text

enter image description here

enter image description here

johnco3
  • 2,401
  • 4
  • 35
  • 67

3 Answers3

4

I have the same issue using Qt 5.15 and VS 2019. However, the problem only occurs when my application is deployed on a network drive. The same collection of files, where qt5Core.dll is in the same folder, works fine on all local drives.

1

Deploying Qt WebEngine Processes (differs from standard Qt5 applications deployment):

...
Qt WebEngine takes advantage of the multi-process model that the Chromium project offers. The multi-process model requires that the Qt WebEngine Process executable be deployed alongside your application.

The WebEngine process is executed for each QWebEngineView or WebEngineView instance. For example, a browser application with two tabs open should have two separate instances of the process running. This is a common approach used by most modern web engines to provide a stable browsing experience.

At runtime, Qt WebEngine looks for the QtWebEngineProcess executable in the directory that QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath) returns. For Qt installations, this is QTDIR/libexec (Linux) or QTDIR\bin (Windows). The path can be changed by defining a qt.conf file, for example. Alternatively, an executable path can be set as a value of the QTWEBENGINEPROCESS_PATH environment variable. On macOS, Qt WebEngine looks for the executable in .app/Helpers/QtWebEngineProcess
...

Firstly, you need to check what path QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath); returns.

Additionally: standard Qt5 applications deployment console tool for Windows - windeployqt

See also: Deploying Qt 5 App on Windows

Vladimir Bershov
  • 2,701
  • 2
  • 21
  • 51
  • Thanks for the above tips, however they don't really point to anything new. The underlying issue seem to be passing the DLL search path to a child process of my application. For some strange reason that baffles me, the tab containing a google maps attempts to launch QtWebEngineProcess.exe, which depends on Qt5Core.dll and this launched process stops as it cannot find the DLL (which is in the same current directory as the executable). After the dialogs are dismissed my main app runs (with a blank google maps page) and I can see that these Qt5*.dll files are in use by the main application. – johnco3 Mar 06 '20 at 19:51
  • @johnco3 seems webengine deployment is something special. Did you read [Deploying Qt WebEngine Applications](https://doc.qt.io/qt-5/qtwebengine-deploying.html) ? – Vladimir Bershov Mar 06 '20 at 19:54
  • useful link. I tried manually setting QTDIR to the location of the DLLs but still no luck. This does not explain why the previous version deployed fine. I wonder if there is some way of getting the internal logs of where QT is searching and failing to get the libraries from like in the console output of visual studio ide where it indicates loading and unloading various dlls and symbol files. – johnco3 Mar 06 '20 at 20:21
  • @johnco3 can you check output of the `QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath)` for both versions? Can you run both versions on a clean system? – Vladimir Bershov Mar 06 '20 at 20:27
  • I followed your suggestion - popping up a dialog box with the location. In my case it prints out the location of the executable with "/bin" appended. I thought this was strange as deployment saves the DLLs to the same folder as the executable. To be on the safe side, I made a bin sub folder and copied the DLLs there - but it still could not find them. – johnco3 Mar 06 '20 at 20:58
  • @ johnco3 have you resolved the problem? I encountered the same issue on Windows. – Jake W Jun 04 '20 at 12:02
  • @JakeW unfortunately not exactly. The workaround for me was to copy the files to a local folder and run from there. – johnco3 Jul 18 '20 at 03:10
  • 2
    @JakeW I know this is a long time after I replied previously - but as you can see I did resolve the issue - I needed to add the --no-sandbox environment variable `qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--no-sandbox")` See the accepted answer above – johnco3 Dec 27 '20 at 10:11
  • @johnco3 That's great, thanks for the update. – Jake W Dec 28 '20 at 12:07
1

I had a similar issue running QT 5.15.1 on Windows 10. QtWebEngineProcess.exe could not find Qt5Core.dll even though it was in the same folder as the executable. For me the problem was solved when i disabled sandboxing, see https://doc.qt.io/qt-5/qtwebengine-platform-notes.html.