How to deploy a Windows application on a Windows 10 clean PC?
I've created an application with Qt 5.9.2. On my development laptop, the application works well, but when I try to run it on a clean Windows 10 PC, it doesn't start. I've used windeployqt, but without success. I have also copied all the C:\Qt\5.9.2\mingw53_32\bin dlls. I've tried with Mingw32 compiler and MSVC2017 64 bits compiler. In both cases the same, on development works well, but not in a clean PC.
For Mingw32, I've already copied all the C:\Qt\Tools\mingw530_32\bin dlls. For MSVC2017, I've downloaded and installed the redistributable package.
I have also tried with the gallery sample. Occurs the same.
How do you test on development laptop?
Always from creator?
It might be a dumb question, but are you copying also the actual Qt dlls and the Qt plugins?
@koahnig I've created a separated directory and put there the generated exe and the dlls that needs the application. Doing doble clic, it executes without problems.
On the clean PC, I've copied the same separated directory. No works. After, I've copied all the QT dlls found on the dirs I've mentioned. No works.
What exact modules are you using ?
@SGaist I've tried with gallery sample and occurs the same.
I've created a virtual machine with Windows 10 Home. After compile gallery sample with MSVC 2017 64 bit, I've copied the exe and all the dlls inside C:\Qt\5.9.2\msvc2017_64\bin and all the C:\Qt\5.9.2\msvc2017_64\plugins directory.
On the virtual machine I've installed "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.11.25325\vcredist_x64.exe".
Continues the same. On the development laptop works, on the Windows 10 virtual machine, doesn't start.
@SGaist It's a very basic app, only uses: QT += quickcontrols2
Did you pass the
[edit: fixed option name SGaist]
This post is deleted!
@SGaist I've put the --qmldir option on windeploy and the gallery sample works!!!
C:\Qt\5.9.2\msvc2017_64\bin\windeployqt.exe --qmldir C:\Qt\5.9.2\msvc2017_64\qml gallery.exe
@lqsa It works with my app!
Thank you very much.
Since you are using QtQuick Controls, you have to also deploy the related libraries/qml files. That's why you should point
windeployqtto your project qml folder with the
--qmldiroption so that it can parse them and deploy the needed dependencies.
@SGaist Sorry, I don't understand your answer. My qmls files are embeded in the application because are treated like resources, so it isn't necessary to copy them. If you see the previous command used, I put on the qmldir parameter the Qt directoy where are the general Qt Qml files.
It's not about having your qml files deployed it's about having them parsed so the tool can deploy the files from the related modules needed by your qml code to run properly.