Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Deploy and run a simple UWP Application with QT



  • Hi all,

    I am wondering if some guy could help me with this issue. What I need is easy to explain, just running an application compiled in QT for UWP (I am using Qt for UWP 5.15.0 64bits - MSVC 2019). My OS is Windows 10 Home running on a Desktop.

    What I've done:

    1. Build and compile from QT Creator. OK
    2. Edit manifest and install application using PowerShell and winrtrunner tool (both ways work). OK
    3. Once the application is started via winrtrunner tool it retieves an error
      C:\Users\tyousef\Desktop\QT App\UWP_POCAnalyzer>winrtrunner --start
      Test.exe
      qt.winrtrunner: Using the Appx profile.
      qt.winrtrunner: Package already installed.
      qt.winrtrunner: Failed to activate application: 0x8027025b "La aplicación no se inició"

    Visually it seems to initiate the application (logo screen is displayed) but it crashes inmediately. It is nothing to do with my code, I try to do it with a single project from QT Creator examples and it happens the same.

    Other point that could help is to install and run a Debugger for UWP applications in QT Creator. When running it says that "Unable to find the platform plugin" but that folder exists with the required DLLs in the debug folder.

    A single Hello World application is enough for me, if someone can help me.

    Thanks in advance.

    Tay



  • Hi, did you also run windeployqt on your test.exe?



  • @hskoglund said in Deploy and run a simple UWP Application with QT:

    windeployqt

    Yes, thanks for answering. I ran windeployqt just to have all the dependencies in the same directory as the executable.



  • @TayMarthin21 Anybody else has a suggestion to fix this issue??


  • Lifetime Qt Champion

    @TayMarthin21 said in Deploy and run a simple UWP Application with QT:

    all the dependencies in the same directory as the executable

    Keep in mind that plug-ins and platform plug-in need a special treatment. It is explained here: https://doc.qt.io/qt-5/windows-deployment.html
    Example from the link:

    The executable	                        plugandpaint.exe
    The Basic Tools plugin	                plugins\pnp_basictools.dll
    The ExtraFilters plugin	                plugins\pnp_extrafilters.dll
    The Qt Windows platform plugin   	platforms\qwindows.dll
    The Qt Windows Vista style plugin	styles\qwindowsvistastyle.dll
    The Qt Core module	                Qt5Core.dll
    The Qt GUI module	                Qt5Gui.dll
    The Qt Widgets module	                Qt5Widgets.dll
    


  • @jsulm Thank you. As I said, I am able to build and run a QT application and deployment works as well, but the problem comes when I try to do the "same" when compiling a UWP project. Compiling is ok, but it fails when launching the application. I am doing it under a desktop Windows 10 environment, so I think it should work. Due to this application is built as an UWP program, I need to overwrite the manifest file for the App, and errors related to that are fixed now. So, to run this application, as far as I know, I have to use WinRTRunner tool (a double click on the EXECUTABLE gives me errors about some DLLs which are installed and specified inside the manifest file) , and that fails. I don't now how to debug the application, but it happens when any application I built, even with the examples that are coming with QT installation.

    Please, could you give me a simple guide to build (done ok!) and Run a simple UWP application developed under QT framework?
    Once a simple "Hello World" application is running, just is a question to adapt the environment to my App.

    Thanks a lot again,
    Regards,
    Tay



  • Hi, did you enable "Developer mode" in your Windows 10?



  • @hskoglund Yes, it is in Developer Mode.



  • @jsulm Hello! After some days working with other stuff, I came back to this issue. Ok, I have some progress. Now, from QT Creator I can try to start the debugger and there is no error about "Unable to find the platform plugin". I fixed it by commenting in the environment variables the path to other QT compilers and left only the one that applies to UWP WinRT. With that I have another new error that I have to investigate "Failure during startup. Aborting. Cannot establisg connection to the WinRT debugging helper". I think is related to the debugger. I will try first with Release version because now the platform/plugin DLL qwinrt.dll is copied successfully while deploying with windeployqt. Thanks again for your help. In the meantime if you have any idea about this new issue, suggestions are welcomed!!!

    Tay



  • Hmm, I have the same: Windows 10 Home set to Developer mode and with Qt UWP 5.15.0 64-bits for MSVC 2019. To test it, I created an empty vanilla Qt widgets app, and built it in Release mode with Qt 5.15.0 UWP 64-bit (MSVC 2019).

    When I run it from inside Qt Creator, I see a green Qt logo splash momentarily and then there's a white window.

    If I quit the app and Qr Creator and want to run it standalone (outside of Qt Creator), I can do that by launching a CMD window, and type:

    cd C:\Users\User\Documents\build-untitled-Qt_5_15_0_for_UWP_64bit_MSVC_2019-Release\release>
    C:\Qt\5..15.0\\winrt_x64_msvc2019\bin\winrtrunner.exe --start untitled.exe
    qt.winrtrunner: Using the Appx profile.
    qt.winrtrunner: Package already installed.
    qt.winrtrunner: App started with process ID 4032
    

    Note: windeployqt is not needed and I don't touch the AppxManifest.xml file.
    But if you repeat my procedure, the untitled.exe will not start for you?



  • @hskoglund Thanks a lot for your help, you are a genius. Ok, trying Release Mode without signing the App nor deployment by hand, I am able to run the app from QT Creator. Just pressing Run button in Release Mode and it displays a window with some widget I put into the Form. From the console, I tried again but a curious thing happens. If I use --start argument the application starts and a blank window appears. When using --test argument, the application starts perfectly, a window with the two widgets I added (EditBox and Radiobutton just for testing). I don't know why in test mode widgets are recognized but not in start mode. It seems like --test command adds some extra libs for debugging, I think that some DLL is missing but with --test command is included...just a suggestion.

    Thank you very much, this is a great beginning...anyway, it is still pending the installation of the App, but for the moment I have work with this.

    Thanks again,
    Kind Regards
    Tay


Log in to reply