Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper way to deploy QML applications on Windows

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?

like image 465
Aleksei Petrenko Avatar asked Feb 04 '16 08:02

Aleksei Petrenko


1 Answers

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

like image 139
RvdK Avatar answered Sep 27 '22 19:09

RvdK