Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Deploying Qt app in Windows
Forum Update on Monday, May 27th 2025

Deploying Qt app in Windows

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 488 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xtingray
    wrote on last edited by xtingray
    #1

    Hi!
    Sometime ago I created a Windows installer for my Qt app. It works perfectly but currently it requires a short .bat file to launch the software. This is the content of that file:

    @echo OFF
    set PATH=%QTAPP_HOME%\bin\raw;%QTAPP_HOME%\lib;%QTAPP%\lib\ssl;%QTAPP_HOME%\lib\qt5;%QTAPP_HOME%\lib\libav
    start qtapp.exe %1

    Trying to avoid the use of the .bat file, I tried to set the PATH variable from the main.cpp directly with no luck. I tried creating a qt.conf but it failed too. Now I ran out of ideas.
    Any time I execute the qtapp.exe binary I got an error saying that the program either can't find some plugin dll's or 3rd party libraries. Nevertheless, the .bat file works like a charm.

    This is the current tree structure of my app:

    • appDir
      • qtapp.bat
      • bin/
        • qtapp.exe
      • lib
        • qt5
        • libav
        • ssl
      • plugins
      • data

    I really appreciate any hint about how to enable the qtapp.exe binary to run directly. Thanks!


    Qt Developer

    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by
      #2

      IIRC, you either have to run it thru the batch file, or add the needed path components to the default PATH variable of your domain profile under windows.

      1 Reply Last reply
      0
      • Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Why don't you simply use a default directory structure as described here and use windeployqt to copy all needed files?

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        X 1 Reply Last reply
        2
        • Christian EhrlicherC Christian Ehrlicher

          Why don't you simply use a default directory structure as described here and use windeployqt to copy all needed files?

          X Offline
          X Offline
          xtingray
          wrote on last edited by
          #4

          @Christian-Ehrlicher I tried to do it, but the only way it seems to work is by putting all the project files in the same folder. My project has more than 50 files among libraries, plugins, and data. I think there must be a more elegant way of releasing a Qt app, isn't it?


          Qt Developer

          1 Reply Last reply
          0
          • Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Not for the dlls - but it's up to you where to put your own dlls and data. Fiddling around with some batch files is crying for problems.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved