11

Recently I needed to create a deployment package for my Qt-QML application. This process is quite tedious, as you need to manually find and copy dependencies. As described in (official?) Qt Wiki:

Copy the following into C:\Deployment\

 - The release version of MyApp.exe
 - All the .dll files from C:\Qt\5.2.1\mingw48_32\bin\
 - All the folders from C:\Qt\5.2.1\mingw48_32\plugins\ (If you used QML)
 - All the folders from C:\Qt\5.2.1\mingw48_32\qml\

Do the deletion steps below in C:\Deployment\ and all of its subdirectories.
After each deletion, launch C:\Deployment\MyApp.exe and test it.
If it stops working, restore the files you just deleted.

 - Launch MyApp.exe. While it is running, try to delete all DLLs.
   The DLLs that aren't used will go to the recycle bin,
   leaving behind only the DLLs that you need.
   (This trick doesn't work for .qml and qmldir files, however).
 - (If you used QML) Delete a few .qml files and try relaunching MyApp.exe.
   Repeat until you try all .qml files.
 - (If you used QML) Delete qmldir files from the folders that have no more DLLs or .qml files

For any modern tool such procedure looks completely ridiculous. Yes, I know about windeployqt.exe, but it doesn't find all the .dll dependencies and does not help at all with .qml dependencies.

Is anyone aware of more practical approaches to this problem, how do people deal with this in big projects? Are there any tools that could help?

Are Qt developers planning to do something about it?

7
  • "Are Qt developers planning to do something about it?" Not if they don't know that windeployqt isn't working, no. They'll never know if you don't file bug reports. Also, this is not really the place to ask that kind of question; there is a mailing list where you can speak with Qt developers. By the way, windeployqt does find .qml dependencies, as I've used it successfully a week or two ago. Commented Feb 4, 2016 at 8:16
  • Not for my project though, windeployqt doesn't put QtQuick, QtQuick.2, GraphicalEffects and similar folders into my deploy folder. It also fails with .dll dependencies of dependencies and with non-Qt dependencies. I decided to ask here because of the instruction I've found on qt wiki. If deployment tool worked, who would write such instruction? Commented Feb 4, 2016 at 8:20
  • Well, probably I should post this as a windeployqt bug to Qt bug tracker, thanks. Commented Feb 4, 2016 at 8:20
  • The official documentation is linked to in that Wiki article. Anyone who bothers to create a Qt Account can edit that Wiki, I think. Commented Feb 4, 2016 at 12:52
  • 1
    I'm not aware of any tool that automatically finds all Qt dependencies while leaving out the unneeded files. However, if you'd like to talk directly to Qt developers, you can subscribe to the Interest mailing list and post there: lists.qt-project.org/mailman/listinfo/interest Commented Feb 5, 2016 at 4:19

1 Answer 1

25

For windeployqt there is the option --qmldir.

windeployqt --qmldir f:\myApp\sources f:\build-myApp\myApp.exe

So it checks also the import and fetches the qml dlls too.

All of this is described in the linked article

Sign up to request clarification or add additional context in comments.

1 Comment

This doesn't work. My app just starts and stops =) with no errors

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.