Need help on proper way to deploy to Windows
-
Checkout the "license conditions here":http://qt-project.org/products/licensing
I am not a lawyer.However, to my understanding but with dlls you are more flexible in terms of using Qt libs with your own applications in case you want to distribute.
For deployment of applications "with dlls you need to check this":http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html which referenced already. It depends on your preferences and those of the people you give your applications. Either it is good enough to use an archive or probably you can use an installer.
-
Ah, it looks like I misunderstood the initial response in this thread and that a static executable is not in fact the only way to distribute a Qt application onto a machine that does not have Qt installed, that I can use the shared library option which, as I think you describe, is in fact the typical way to do so. In which case I would simply provide the dlls for the Qt framework.
When you say "good enough to use an archive" are you referring to a zip archive, they simply unzip and everything is in place?
If I were to use an installer, what would you recommend?
-
[quote author="qttester5" date="1376915625"]
When you say "good enough to use an archive" are you referring to a zip archive, they simply unzip and everything is in place?[/quote]
Yes,
[quote author="qttester5" date="1376915625"]
If I were to use an installer, what would you recommend?[/quote]
"There is a page":http://qt-project.org/wiki/Qt-Installer-Framework You can check also the tags on the right of your initial post. -
The instructions on this page: http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html mention use of "nmake" however despite that Qt is installed on my system as a shared library environment (with Qt Creator) there is no nmake I can find anywhere, even after searching Windows.
Furthermore, I am wondering if the Build & Run options within Qt Creator can do all of this for you, and create a directory with all the self-contained files in it, with proper libraries?
-
Hi,
nmake comes with Visual Studio
-
As commented by SGaist nmake comes with MSVC
Just a more general note from C++-programmer's view, you can download and install Qt libs. However, those are in principle not good for anything when you want to do your own apps. You need in addition a compiler.
On windows you got two principle choices MSVC and MinGW.
MSVC (called also Microsoft Visual Studio) comes in different flavors/versions (2005-2013?). The express version comes for free and can be used with Qt creator as IDE. However, it cannot be distributed with Qt sdk, you have to download and install separately.
MinGW is an opensource compiler suite. The Qt sdk for MinGW has the compiler included. -
I installed the Windows online installer for Qt here, fourth on the list:
http://qt-project.org/downloads
If I want to actually build following the instructions on the Windows deployment page, which refer to nmake, do I instead need to install a different Qt SDK? I'm sorry of the question seems basic but this just isn't clear and I feel a bit lost on the overall process. I just need to get to the point where I can follow the approach to deploy with the shared libraries included in an archive and run an app on a machine that doesn't have Qt installed previously.
-
OK, no problem, that clears a bit the picture. The deployment page is something you do not have to worry about at the moment.
Check the options you have installed. If you do not have MS Visual Studio (MSVC) and do not have a preference of using this, you should go for MinGW. This is probably easiest for you.
Start the "Qt maintenance tool" and there the "package manager" you will find the install components.
Under tools there should be "MinGW4.8 (32bit)" (This is the MinGW compiler) selected and under Qt 5.1.0 you should have the very same setting "MinGW4.8 (32bit)" (these are the Qt libs) selected (Android stuff and MSVC stuff, you probably do not need).In general that is all you have to do and after starting the Qt creator you can start with the tutorials "(e.g. Getting started)":http://qt-project.org/doc/qt-5.1/qtdoc/gettingstarted.html#creating-applications-using-qt
-
I have written some small test apps in Qt Creator but when I build them, the resulting binaries cannot be run on another system, only on mine, which has Qt installed. The key problem I have is how to build them for distribution to other computers.
When I look at Maintenance Tool and try to click on Package Manager, it says "at least one valid and enabled repository required for this action to succeed."
However I know I installed MinGW with Qt so it is there, but I don't know what settings in Creator to use to make sure I am building something that will stand on its own on another machine that does not have Qt installed?
-
If you want static linking:
Buy qt commercial license. With static linking you don't need to have various qt dll s in your executable folder and only one exe file.
For dynamic linking: {lgpl, commercial usage}
use dependency walker to find all the dependencies like qtgui.dll, etc. The qt dependencies will be in QtInstallationFolder/bin. External third party dependencies like database or qwt will be in the bin where the these libraries where installed.
If you are using nmake, you will also need two msvcp100.dll and msvcr100.dll. These are to be placed along side your exe or installed at client system using microsoft visual studio redistrubitable (vcredist_x86.exe). This is downloadable and redistrubitable.
Then if you are using any plugins like image, or database, create a folder next to your exe file and name it as the folder was named in qt installation plugins folder. Thus all the codecs like qcncodec.dll will go to codecs folder. All imageformats like qgif4.dll will go to imageformats folder as it is named so in plugins folder.
Now dependency walker will show all dependencies resolved. You can double click and open your exe.
Use some packer to create a installer. There are lot of free and commercial packers. One of my favourites is innosetup. A very old and customizable is nsis. but it is too tenuous to understand. -
This has been the clearest help yet, thank you. Where can I get the dependency walker you'd recommend with Qt, for example is this one good? http://kb.froglogic.com/display/KB/Analyzing+dependencies+with+Dependency+Walker
-
[quote author="qttester5" date="1377063064"]This has been the clearest help yet, thank you. Where can I get the dependency walker you'd recommend with Qt, for example is this one good? http://kb.froglogic.com/display/KB/Analyzing+dependencies+with+Dependency+Walker[/quote]
The page you found is referencing the correct dependency walker. There is also some information on "this qt wiki page":http://qt-project.org/wiki/Show_library_dependencies#aea23489ce3aa9b6406ebb28e0cda430 Beware this page not completely up-to-date for Qt 5, since there are more dependencies than with Qt 4.Also the page you have posted contains already this information "in this section.":http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html#additional-libraries
In another section there is "the reference":http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html#creating-the-application-package to an additional plugin as required for Qt5 on windows systems
[quote]
The Qt Windows platform plugin platforms\qwindows.dll
[/quote]which is of vital importance.