Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Deploying Qt5 on Windows 7: Too Difficult

Deploying Qt5 on Windows 7: Too Difficult

Scheduled Pinned Locked Moved Installation and Deployment
26 Posts 13 Posters 37.3k 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.
  • M Offline
    M Offline
    matti-
    wrote on last edited by
    #10

    Ahem, next issue arises. We're using SQLite from QtQuick 2.0 projects javascript (QtQuick.LocalStorage 2.0) .. and now that we're deploying on windows outside the QtCreator sandbox, none of the SQL stuff works. I havent yet figured out how to make the app log into a console (CONFIG += console does not seem to do the trick) with console.log() so Im not getting much info whats wrong - we tried adding the sqldrivers plugin directory under the app dir but that didnt help. Whats needed..?

    While Qt/QML is sweet, building the windows deployment package is a real pain in the arse :o

    • Matti

    Author of <a href="http://mmark.777-team.org/">MMark13</a>

    1 Reply Last reply
    0
    • N Offline
      N Offline
      Nantunest
      wrote on last edited by
      #11

      It's really too cumbersome to deploy a qt/qml application on Windows.

      After a lot of googling and trying now my app is working.

      I am using SQLite in my project, but I am using the C++ library <QtSql/QSqlDatabase>.

      I have:

      exedir/sqldrivers/qsqlite.dll
      exedir/platforms/qwindows.dll
      exedir/QtQuick.2/...
      exedir/qml/exe_name/qmlfiles.qml
      exedir/icudt49.dll
      exedir/icuin49.dll
      exedir/icuuc49.dll
      exedir/libEGL.dll
      exedir/libGLESv2.dll
      exedir/Qt5Core.dll
      exedir/Qt5Gui.dll
      exedir/Qt5Network.dll
      exedir/Qt5Qml.dll
      exedir/Qt5Quick.dll
      exedir/Qt5Sql.dll
      exedir/Qt5V8.dll
      exedir/D3DCompiler_43.dll
      exedir/exe

      I am new to qt/qml, the most difficult part was to figure out where the plugin folder had to be.

      Each plugin folder (sqldrivers, QtQuick.2 ...) you use have to be in the exe folder, right?

      There is a way to change search path for plugins?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        matti-
        wrote on last edited by
        #12

        Yes theres QQmlEngine::addPluginPath() for that.

        Aha so SQLite stuff works from C++ side with those, awesome, today's task will be to make it work somehow, hopefully with the existing code (from .pragma library javascript file..)

        • M

        Author of <a href="http://mmark.777-team.org/">MMark13</a>

        1 Reply Last reply
        0
        • M Offline
          M Offline
          matti-
          wrote on last edited by
          #13

          Adding QtQuick/LocalStorage did the trick for the JS part..

          My working set now is:
          @
          │ D3DCompiler_43.dll
          │ icudt49.dll
          │ icuin49.dll
          │ icuuc49.dll
          │ libEGL.dll
          │ libGLESv2.dll
          │ log.txt
          │ binary.exe
          │ binary.exe.embed.manifest
          │ Qt5Core.dll
          │ Qt5Gui.dll
          │ Qt5Multimedia.dll
          │ Qt5MultimediaQuick_p.dll
          │ Qt5Network.dll
          │ Qt5Qml.dll
          │ Qt5Quick.dll
          │ Qt5Sql.dll
          │ Qt5V8.dll
          │
          ├───platforms
          │ qwindows.dll
          │
          ├───QtMultimedia
          │ declarative_multimedia.dll
          │ plugins.qmltypes
          │ qmldir
          │ Video.qml
          │
          ├───QtQuick
          │ └───LocalStorage
          │ plugins.qmltypes
          │ qmldir
          │ qmllocalstorageplugin.dll
          │
          ├───QtQuick.2
          │ plugins.qmltypes
          │ qmldir
          │ qtquick2plugin.dll
          │
          └───sqldrivers
          qsqlite.dll
          @

          I really find it intolerable that the plugin system just silently fails when it cannot load something instead of showing a message (at least in console, preferable in a MessageBox). Totally nasty to debug.

          • M

          Author of <a href="http://mmark.777-team.org/">MMark13</a>

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SlimIT
            wrote on last edited by
            #14

            I had a blank screen after launching my app but when i added
            @
            ├───QtQuick
            │ └───LocalStorage
            │ plugins.qmltypes
            │ qmldir
            │ qmllocalstorageplugin.dll
            │
            ├───QtQuick.2
            │ plugins.qmltypes
            │ qmldir
            │ qtquick2plugin.dll
            @
            the problem was resolved.

            Thank you.

            1 Reply Last reply
            0
            • T Offline
              T Offline
              teemo10
              wrote on last edited by
              #15

              I'm a little confused by what the docs have under: Writing a qmltypes File found here: http://qt-project.org/doc/qt-5.0/qtqml/qtqml-modules-qmldir.html

              First it says:

              bq.
              As such qmltypes files have no effect on the functionality of a QML module. Their only use is to allow tools such as Qt Creator to provide code completion, error checking and other functionality to users of your module.

              It also says:

              bq.
              Any module that uses plugins should also ship a type description file.

              So should we distribute "plugins.qmltypes" files with our app, provided that I am not interested in providing any editing capabilties to my end user on the shipped files?

              1 Reply Last reply
              0
              • Q Offline
                Q Offline
                qttester5
                wrote on last edited by
                #16

                I have included all of the files and directories mentioned in this thread as well as ALL of the plugins in the mingw directory to be extra safe, and my app also just shows a white screen; in fact I am using an included Qt Quick demo app, the Minehunt application. There is just no way I can get it to actually run correctly in an environment that does not have Qt installed already. It runs fine in Creator. This is so frustrating. No errors, not crashes, just a white screen.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SlimIT
                  wrote on last edited by
                  #17

                  [quote author="qttester5" date="1377757029"]I have included all of the files and directories mentioned in this thread as well as ALL of the plugins in the mingw directory to be extra safe, and my app also just shows a white screen; in fact I am using an included Qt Quick demo app, the Minehunt application. There is just no way I can get it to actually run correctly in an environment that does not have Qt installed already. It runs fine in Creator. This is so frustrating. No errors, not crashes, just a white screen.[/quote]

                  what is your grafic card ? have you tested it under other machines ?

                  1 Reply Last reply
                  0
                  • Q Offline
                    Q Offline
                    qttester5
                    wrote on last edited by
                    #18

                    If it was a problem with my graphics card, then why can the project run fine on the same machine, in a different VM that has Qt installed?

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SlimIT
                      wrote on last edited by
                      #19

                      maybe the correct drivers are installed on the VM and not on the Real Machine.

                      1 Reply Last reply
                      0
                      • Q Offline
                        Q Offline
                        qttester5
                        wrote on last edited by
                        #20

                        No, I am using two identical VMs on same machine. One with and one without Qt.

                        1 Reply Last reply
                        0
                        • Z Offline
                          Z Offline
                          zing0000
                          wrote on last edited by
                          #21

                          In my App, I create a dialog QML object dynamically.

                          When deploying, I found that I had to add
                          QtQuick-->Controls
                          The DLL is under a further subdir, "Private"

                          I ended up deploying the whole Controls directory for an added 6MB to the package!

                          Thanks to the contributors above, I would never have got here without their encouragement.

                          1 Reply Last reply
                          0
                          • D Offline
                            D Offline
                            DavidGGG
                            wrote on last edited by
                            #22

                            Seems like a headache. For me this works:

                            1. Use Microsoft's free tool "Process Explorer" to get a list of all DLLs used while running the exe in release mode via QT Creator (they can be showed in lower pane)
                            2. Copy all of these to the same directory as the exe, not bothering with adding any subfilders

                            http://technet.microsoft.com/sv-se/sysinternals/bb896653.aspx

                            1 Reply Last reply
                            0
                            • K Offline
                              K Offline
                              koahnig
                              wrote on last edited by
                              #23

                              See also my answer in the "other post. ":http://qt-project.org/forums/viewthread/30301/P30/#163354

                              That tool is interesting. Thanks for sharing. ;-)

                              Vote the answer(s) that helped you to solve your issue(s)

                              1 Reply Last reply
                              0
                              • D Offline
                                D Offline
                                DavidGGG
                                wrote on last edited by
                                #24

                                Actually I was a bit optimistic there.. The stand-alone exe ran on my primary PC but only because it had Qt installed, It didn't execute on another PC.

                                AFAIKT Process Explorer actually does reveal all DLLs used, with path. I did some further investigations on my primary PC by adding DLLs and folders to where Qt put my exe and renaming the folders Qt wants to use until I see in Proc Expl that it uses the ones I want it to, by making use of that Qt gives me an error message when starting the exe from within it with ctrl+R (otherwise it would be hard to guess which folder structre it wants).

                                A few conclusions from that adventure:

                                • It often needs more than the DLLs, so when you have identified a DLL it wants, then copy the entire directory with the DLL (you can try to optimize later by deleting files but the non-DLL files are usually very small, and the ones ending with "d" you can skip, they are for debug mode)
                                • When I rename a folder that Qt wants to use, sometimes it know about an alternate folder. For one group of DLLs, Qt itself took over the DLLs and fetched them in such an alternate folder, so they were no longer under my app in Proc Expl but under Qt, and I had to reboot Qt to stop it from doing that.

                                The folders imageformats, platforms, QtQuick and QtQuick.2 should be in the exe's folder, together with the rest of the DLLs; eactly which, you clearly see in Proc Expl. Could add screenshot but can't see the forum supports it.

                                Still doesn't work though. Don't now why, but I'd suspect it's something other than DLLs missing. And I don't have more time for this right now.

                                PS One DLL you and everybody else seem to require is Qt5V8.dll but it doesn't exist on my PC. Perhaps from an older version?

                                1 Reply Last reply
                                0
                                • JKSHJ Offline
                                  JKSHJ Offline
                                  JKSH
                                  Moderators
                                  wrote on last edited by
                                  #25

                                  [quote author="DavidGGG" date="1393184567"]Actually I was a bit optimistic there.. The stand-alone exe ran on my primary PC but only because it had Qt installed, It didn't execute on another PC.[/quote]To check a deployment package on your development PC, rename your Qt installation folder. This effectively turns your PC into a Qt-free environment, so when you launch your application it won't use your development DLLs.

                                  [quote]Still doesn't work though. Don't now why, but I'd suspect it's something other than DLLs missing. And I don't have more time for this right now.[/quote]If you use QML, you also need the qmldir files. See http://qt-project.org/wiki/Deploy_an_Application_on_Windows

                                  [quote]PS One DLL you and everybody else seem to require is Qt5V8.dll but it doesn't exist on my PC. Perhaps from an older version?[/quote]V8 is the JavaScript engine used by QML in Qt 5.0 and 5.1. It's no longer used in Qt 5.2.

                                  [quote]Could add screenshot but can't see the forum supports it.[/quote]For now, you'll need to upload it to an external site. The forum can display external images. Anyway, there is a screenshot of the deployment folder at http://qt-project.org/wiki/Deploy_an_Application_on_Windows

                                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                  1 Reply Last reply
                                  0
                                  • E Offline
                                    E Offline
                                    ermylistru
                                    wrote on last edited by
                                    #26

                                    Qt is absolutely great, fast and easy to develop apps.
                                    But some points in it, for us newbies, are a real problem. One of them is deployment, for example, on Windows.
                                    I had this problem and solved it as I think in a very stupid and simple way, and I want to share it in hope that it can help someone.
                                    After compiling release version of the app, putting the exe file in a separate folder and running, I surely got a long list of messages about missing dlls, which I successfully took in "mingw482_32\bin" folder and put in my app root folder. Also I knew about the need in "bin\plugins\platforms\qwindows.dll" and copied it also. On the dev computer now the app ran OK, but if I started it on another computer, it didn't work. Windows didn't show any warning messages, but the app window did not appear on the screen, app started and was shown in task manager, but not on the screen.
                                    I thought it might be some missing libs or plugins, which the app took from Qt install folder, to test it I renamed Qt installation folder on dev machine and vualia - app didn't work on dev machine either. So it was the point.
                                    But how to find out which plugins the app depends on? There are quite a lot of them. I searched and read a lot on the forum here, I tried Dependancy Walker, MS Process Explorer and windeployqt.exe, all are not good to give results in a fast and comfortable way.
                                    After some hours of headache a stupid idea came to my mind - I just began renaming folders in Qt install folder to make them unavailable for the app. I began from the top level dirs, found the one, the lack of which made my app to stop working, and then proceded to its subdirectories. In 5 minutes I found out that my app needed ..\mingw482_32\qml\QtQuick\Window.2 and qml\QtQuick.2 directories, which I coppied to my app folder like that – myappfolder\QtQuick\Window.2 and myappfolder\QtQuick.2 and it made everything work perfectly.
                                    I understand that this is a really stupid method, but it became a hundred times faster than seaching and learning all those wierd tools which are as far from deployment as stars from earth, imho.

                                    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