Deploying Qt applications – Deploying on windows

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:

  • The path to the deployment directory is given an optional argument given with the parameter --dir (default is the path where windeployqt is called).
  • The path to the executable to be inspected is given as last argument.

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.

if you want to reproduce, please indicate the source:
Deploying Qt applications – Deploying on windows - CodeDay