Do QT based GUI applications work in Windows PE?

791 views Asked by At

I tried running a QT C++ GUI sample in WinPE. It should just open an empty window.

It complains about missing d3d11.dll and dxgi.dll.

  1. QT tries to use OpenGL, if there is no suitable driver, it uses DirectX with ANGLE. I tried removing the DirectX dependency by calling Qapplication::setAttribute(Qt::AA_UseSoftwareOpenGL) before the Qapplication instantiaton. No change, still requires those two dlls.

  2. I tried to copy those two files from my regular Windows, and now the error is: “The procedure entry point CheckIsMSIXPackage could not be located in the dynamic link library dxgi.dll”

I don't need any HW acceleration, how could I make it run?

  • QT version: 5.14.2 (dynamic linking)
  • WinPE version: Windows 10 2004
  • Compiler: Visual Studio 2019 and Mingw 8.1 (I have tried both, same results)
3

There are 3 answers

0
Andreas On

It's late but since I just ran into this problem myself...

Apparently this dependency is introduced by the Rendering Hardware Interface, and what worked for me for WinPE 1809 was to build Qt 5.15 (.7 and .8) from source - in Msys2, by the way - after removing/commenting out the line include(rhi/rhi.pri) in qtbase/src/gui/gui.pro, and the configure command line includes -no-directwrite -no-opengl -no-icu.

0
NoelBlanc-Caro On

Too late ? Not the solution but only an idea. Actually I use Winpe WinPe 2009. When i install VirtualBox 6.1.16 in this winpe, i add opengl32.dll and other files. VirtualBox uses QT5 files. And i get the same error. With Depends.exe, i see that opengl32.dll needs this ChechIsMSIXPackage and loock for it in kernelBase.dll. But because kernelBase.dll which comes with winpe2009 doesn't contain this API, i take this kernelBase.dll from a normal W10 (in the ISO/Install.wim). And, in my case, virtualBox works well, QT5 also, opengl32 also.

0
mappu On

Qt 5.12 does not depend on dxgi.dll but Qt 5.15 definitely seems to.

One option is to roll back your project to Qt 5.12, I can personally confirm that Qt 5.12 projects work great under Windows PE.

(This is assuming you are using the prebuilt Qt binaries from Maintenance Tool - otherwise there may be a config option to recompile Qt to avoid this).