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. QT Creator Deployment For Windows

QT Creator Deployment For Windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 692 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.
  • yldzmuhammedY Offline
    yldzmuhammedY Offline
    yldzmuhammed
    wrote on last edited by
    #1

    Hello everyone,
    I am very new to the QT. I have an application which almost completed development.
    Now, I want to deploy and distribute it. I saw lots of explanations on the web. But non of them were automatized and made by hand every time. Now I want to be able to create an Installer every build my project with release config.
    But I do not know how to do it. Since I am not an expert on make, pre/post build concepts I am having hard time to figure this out.
    Can you guide me how to automatize the deploy process?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      What tool do you use (want to use) to build your installer?

      1 Reply Last reply
      0
      • yldzmuhammedY Offline
        yldzmuhammedY Offline
        yldzmuhammed
        wrote on last edited by
        #3

        QT's tools. windeployqt and binarycreator.exe

        J.HilkJ 1 Reply Last reply
        0
        • yldzmuhammedY yldzmuhammed

          QT's tools. windeployqt and binarycreator.exe

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @yldzmuhammed the easiest way is probably, creating a batch file that does all the console commands, you usually do by hand, and execute that one post linking process.

          you can to that via Qt's QMAKE_POST_LINK from inside the *.pro file.

          QMAKE_POST_LINK = CMD /c CALL "C:\path\to\my\batch.cmd"

          I'm sure something similar is also possible via cmake, if that's what you're using


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          1
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            You might want to consider using cmake which has package building infrastructure through cpack which might help with your process automation.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            yldzmuhammedY 1 Reply Last reply
            0
            • SGaistS SGaist

              Hi,

              You might want to consider using cmake which has package building infrastructure through cpack which might help with your process automation.

              yldzmuhammedY Offline
              yldzmuhammedY Offline
              yldzmuhammed
              wrote on last edited by
              #6

              @SGaist said in QT Creator Deployment For Windows:

              Hi,

              You might want to consider using cmake which has package building infrastructure through cpack which might help with your process automation.

              I have to use qmake. Is there a way to do this with qmake?

              @J-Hilk said in QT Creator Deployment For Windows:

              @yldzmuhammed the easiest way is probably, creating a batch file that does all the console commands, you usually do by hand, and execute that one post linking process.

              you can to that via Qt's QMAKE_POST_LINK from inside the *.pro file.

              QMAKE_POST_LINK = CMD /c CALL "C:\path\to\my\batch.cmd"

              I'm sure something similar is also possible via cmake, if that's what you're using

              I created a powershell script and looks like it works. But I am not sure how to run it from qt creator after build.

              J.HilkJ 1 Reply Last reply
              0
              • yldzmuhammedY yldzmuhammed

                @SGaist said in QT Creator Deployment For Windows:

                Hi,

                You might want to consider using cmake which has package building infrastructure through cpack which might help with your process automation.

                I have to use qmake. Is there a way to do this with qmake?

                @J-Hilk said in QT Creator Deployment For Windows:

                @yldzmuhammed the easiest way is probably, creating a batch file that does all the console commands, you usually do by hand, and execute that one post linking process.

                you can to that via Qt's QMAKE_POST_LINK from inside the *.pro file.

                QMAKE_POST_LINK = CMD /c CALL "C:\path\to\my\batch.cmd"

                I'm sure something similar is also possible via cmake, if that's what you're using

                I created a powershell script and looks like it works. But I am not sure how to run it from qt creator after build.

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #7

                @yldzmuhammed quite literally like I wrote earlier.

                for example I have a batch file to connect network drives the the windows explorer. That is located on my desktop. So I add QMAKE_POST_LINK += CMD /c CALL "C:\Users\jhilk\Desktop\Connect_Network_Drives.cmd" anywhere in my pro file:

                QT       += core gui
                
                greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                
                CONFIG += c++11
                
                # You can make your code fail to compile if it uses deprecated APIs.
                # In order to do so, uncomment the following line.
                #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                
                SOURCES += \
                    main.cpp \
                    mainwindow.cpp
                
                HEADERS += \
                    mainwindow.h
                
                FORMS += \
                    mainwindow.ui
                
                QMAKE_POST_LINK += CMD /c CALL "C:\Users\jhilk\Desktop\Connect_Network_Drives.cmd"
                
                # Default rules for deployment.
                qnx: target.path = /tmp/$${TARGET}/bin
                else: unix:!android: target.path = /opt/$${TARGET}/bin
                !isEmpty(target.path): INSTALLS += target
                
                

                and once each rebuild, that batch file is executed.


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                1 Reply Last reply
                2

                • Login

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