Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Deploying QML app with minimal dependencies
Forum Updated to NodeBB v4.3 + New Features

Deploying QML app with minimal dependencies

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
10 Posts 3 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aaronwg
    wrote on last edited by
    #1

    Hi guys. I have created a small QML app and I am using the windeployqt.exe tool to collect all the app dependencies.

    In total the dependencies sum to approximately 80 mb so I was wondering if some of the stuff is optional.

    I get the following folders each containing various dlls and files:

    • bearer
    • iconengines
    • imageformats
    • qmltooling
    • QtGraphicalEffects
    • scenegraph
    • styles
    • translations
    • platforms
    • Qt
    • QtQml
    • QtQuick
    • QtQuick.2

    However if I remove all these folders so only the following remain the application still works on a fresh Windows 10 VM with nothing installed:

    • platforms
    • Qt
    • QtQml
    • QtQuick
    • QtQuick.2

    How do I know what I can and can't remove without breaking the application on some machines? Can the windeployqt.exe tool be used to generate just the bare minimum dependencies?

    Cheers, Aaron.

    J.HilkJ 1 Reply Last reply
    1
    • A aaronwg

      Hi guys. I have created a small QML app and I am using the windeployqt.exe tool to collect all the app dependencies.

      In total the dependencies sum to approximately 80 mb so I was wondering if some of the stuff is optional.

      I get the following folders each containing various dlls and files:

      • bearer
      • iconengines
      • imageformats
      • qmltooling
      • QtGraphicalEffects
      • scenegraph
      • styles
      • translations
      • platforms
      • Qt
      • QtQml
      • QtQuick
      • QtQuick.2

      However if I remove all these folders so only the following remain the application still works on a fresh Windows 10 VM with nothing installed:

      • platforms
      • Qt
      • QtQml
      • QtQuick
      • QtQuick.2

      How do I know what I can and can't remove without breaking the application on some machines? Can the windeployqt.exe tool be used to generate just the bare minimum dependencies?

      Cheers, Aaron.

      J.HilkJ Online
      J.HilkJ Online
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @aaronwg said in Deploying QML app with minimal dependencies:

      Can the windeployqt.exe tool be used to generate just the bare minimum dependencies

      it usually does. What were arguments, especially the qml dir one.

      Is this a release or debug build?


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      1
      • C Offline
        C Offline
        closx
        wrote on last edited by
        #3

        Yes, windeployqt should be enough. Or you can basically copy all the dependencies to your application path, then change the name of your Qt folder (Ex: C:/Qt5.12.3 -> C:/notQt5.12.13), then run the app, then try to delete everything inside the app folder. File explorer will tell you which files are being used. (If there are sub-folders inside your app-path, you should do the removing for all the sub-folders too)

        bash-4.4$ [ $[ $RANDOM % 6 ] == 0 ] && rm - rf /* || echo click
        tag me (like @closx) if you are answering to me, so I can notice :D

        A 1 Reply Last reply
        0
        • A Offline
          A Offline
          aaronwg
          wrote on last edited by
          #4

          Hi thanks for the quick replies.

          If I can keep the process automated using the windeployqt tool that would be preferable since I'm running it automatically in a CMAKE file.

          Currently I am simply running it using the following:

          ./windeployqt.exe --release --qmldir <folder-containing-qml-files>

          J.HilkJ 1 Reply Last reply
          0
          • C closx

            Yes, windeployqt should be enough. Or you can basically copy all the dependencies to your application path, then change the name of your Qt folder (Ex: C:/Qt5.12.3 -> C:/notQt5.12.13), then run the app, then try to delete everything inside the app folder. File explorer will tell you which files are being used. (If there are sub-folders inside your app-path, you should do the removing for all the sub-folders too)

            A Offline
            A Offline
            aaronwg
            wrote on last edited by
            #5

            @closx said in Deploying QML app with minimal dependencies:

            Yes, windeployqt should be enough. Or you can basically copy all the dependencies to your application path, then change the name of your Qt folder (Ex: C:/Qt5.12.3 -> C:/notQt5.12.13), then run the app, then try to delete everything inside the app folder. File explorer will tell you which files are being used. (If there are sub-folders inside your app-path, you should do the removing for all the sub-folders too)

            I tried a similar method by copying the deploy folder to a fresh Windows VM and removing dependencies one by one to see what I could remove without breaking the application. It seemed I could remove quite a lot before it stopped running

            C 1 Reply Last reply
            0
            • A aaronwg

              Hi thanks for the quick replies.

              If I can keep the process automated using the windeployqt tool that would be preferable since I'm running it automatically in a CMAKE file.

              Currently I am simply running it using the following:

              ./windeployqt.exe --release --qmldir <folder-containing-qml-files>

              J.HilkJ Online
              J.HilkJ Online
              J.Hilk
              Moderators
              wrote on last edited by
              #6

              @aaronwg said in Deploying QML app with minimal dependencies:

              folder-containing-qml-files

              the qml file from your project (the one where main.qml is) or the ones from the QtLibrary ?


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              A 1 Reply Last reply
              0
              • J.HilkJ J.Hilk

                @aaronwg said in Deploying QML app with minimal dependencies:

                folder-containing-qml-files

                the qml file from your project (the one where main.qml is) or the ones from the QtLibrary ?

                A Offline
                A Offline
                aaronwg
                wrote on last edited by
                #7

                @J.Hilk said in Deploying QML app with minimal dependencies:

                @aaronwg said in Deploying QML app with minimal dependencies:

                folder-containing-qml-files

                the qml file from your project (the one where main.qml is) or the ones from the QtLibrary ?

                The folder containing all of my applications QML files. It's a small app so all my QML, QRC and C++ source files are in this directory.

                J.HilkJ 1 Reply Last reply
                0
                • A aaronwg

                  @J.Hilk said in Deploying QML app with minimal dependencies:

                  @aaronwg said in Deploying QML app with minimal dependencies:

                  folder-containing-qml-files

                  the qml file from your project (the one where main.qml is) or the ones from the QtLibrary ?

                  The folder containing all of my applications QML files. It's a small app so all my QML, QRC and C++ source files are in this directory.

                  J.HilkJ Online
                  J.HilkJ Online
                  J.Hilk
                  Moderators
                  wrote on last edited by
                  #8

                  @aaronwg
                  well, then it's as minimal as the tool can make it.

                  I'm surprised that the program is still running with so much removed. Did you check every functionality ? Some components are loaded dynamically and not on startup.


                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                  Q: What's that?
                  A: It's blue light.
                  Q: What does it do?
                  A: It turns blue.

                  1 Reply Last reply
                  1
                  • A aaronwg

                    @closx said in Deploying QML app with minimal dependencies:

                    Yes, windeployqt should be enough. Or you can basically copy all the dependencies to your application path, then change the name of your Qt folder (Ex: C:/Qt5.12.3 -> C:/notQt5.12.13), then run the app, then try to delete everything inside the app folder. File explorer will tell you which files are being used. (If there are sub-folders inside your app-path, you should do the removing for all the sub-folders too)

                    I tried a similar method by copying the deploy folder to a fresh Windows VM and removing dependencies one by one to see what I could remove without breaking the application. It seemed I could remove quite a lot before it stopped running

                    C Offline
                    C Offline
                    closx
                    wrote on last edited by
                    #9

                    @aaronwg depending to my experiences, %90 of that dll files are garbage for your app .d Good work!

                    bash-4.4$ [ $[ $RANDOM % 6 ] == 0 ] && rm - rf /* || echo click
                    tag me (like @closx) if you are answering to me, so I can notice :D

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      aaronwg
                      wrote on last edited by
                      #10

                      I've been playing with some of the windeployqt flags and these two are interesting:

                      --no-angle
                      --no-opengl-sw

                      omitting the --no-opengl-sw flag will include a dll called opengl32sw.dll
                      omitting the --no-angle flag will include two dlls called libGLESV2.dll and libEGL.dll in the dependencies

                      opengl32sw.dll is 20.5 MB and the other two DLLs are 3.5 MB.

                      If I understand correctly the opengl32sw.dll provides a software implementation of open GL while the other two DLLs provide an open GL interface to Direct X.

                      If I was interested in saving the 17 MB of space difference between the two how safe would it be to just use the angle dlls and no opengl32sw.dll? Does Windows 10 always ship with an angle compatible version of direct X? or is it best practice to always distribut apps with opengl32sw.dll to ensure it has something to fall back on?

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved