QT Creator Deployment For Windows
-
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? -
QT's tools. windeployqt and binarycreator.exe
-
QT's tools. windeployqt and binarycreator.exe
@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
-
Hi,
You might want to consider using cmake which has package building infrastructure through cpack which might help with your process automation.
-
Hi,
You might want to consider using cmake which has package building infrastructure through cpack which might help with your process automation.
@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.
-
@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.
@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.