Qt provides a deployment tool for Windows: windeployqt
. The tool inspects a Qt application executable for its dependecies to Qt modules and creates a deployment directory with the necessary Qt files to run the inspected executable. A possible script may look like:
set PATH=%PATH%;<qt_install_prefix>/bin
windeployqt --dir /path/to/deployment/dir /path/to/qt/application.exe
The set
command is called to add Qt's bin
directory to the PATH
environment variable. windeployqt
is then called:
--dir
(default is the path where windeployqt
is called).The deployment directory can then be bundled with the executable.
NOTE:
If you are using pre-compiled Qt5.7.0 with vs2013 on Windows (not sure if all versions has this issue), there is a chance, that you need to manually copy <QTDIR>\5.7\msvc2015\qml
to your bin directory of your program. Otherwise the program will auto quit after start.
See also Qt documentation.