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 Updated to NodeBB v4.3 + New Features

Deploying Qt app in Windows

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 557 Views 1 Watching
  • 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 22 Apr 2019, 05:20 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
    • K Offline
      K Offline
      Kent-Dorfman
      wrote on 22 Apr 2019, 05:53 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.

      I light my way forward with the fires of all the bridges I've burned behind me.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 22 Apr 2019, 07:17 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 22 Apr 2019, 14:15
        2
        • C Christian Ehrlicher
          22 Apr 2019, 07:17

          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 22 Apr 2019, 14:15 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
          • C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 22 Apr 2019, 17:35 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

            4/5

            22 Apr 2019, 14:15

            • Login

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