What must be installed on client machine to run a QT Quick Application? - c++

I am developing a desktop application using QT Quick. I have been searching and reading the QT documentation (http://doc.qt.io/qtinstallerframework/ifw-tutorial.html) for creating an installer and how to use windeployqt.exe and binarycreator.exe to deploy on a windows machine. So far so good , but since I want to target this application for windows XP as well.
I want to know exactly what is required to be installed on the target machine to be able to run my application when using MinGW orMSVC2015 during building, so that I may include them in my installer or make the end user download them. Just like we download .Net Framework , Visual C++ Redistributable or DirectX when installing an application.

We use windeployqt to gather all the Qt official dependencis. Two parameters of windeployqt are quite useful:
--debug or --release: determine whether your app is in debug state or release state. windeployqt will put corresponding version of DLLs to your exe's directory;
--qml and put the directory of your QML files after it. windeployqt will search your given directory and put all the QML modules to your exe's directory.
2018-11-05 10:52:34:
It seems the second parameter --qml has been changed to --qmldir.

Related

Build (compile) a basic standalone .exe application using Qt-creator on Windows 8

I have installed Qt-5.7 on windows 8 because I couldn't build my released .exe from Linux (my favorite) in order to be used on Windows OS even after searching a lot on internet (Where there have to be cross-compilation...). After the installation, I just want to make sure that I can build/run a first application (one of the examples provided by default by Qt-creator "filesystembrows") and I have follow the official guide in order to build Qt as shared libraries, but the issue is that when I type the first command line I get: 'nmake' is not recognized as an internal or external command' Also it still show the same message even though a update the variable environment of the system with C:\Qt\Qt5.7.0\5.7\mingw53_32\bin which one is the default path set-up when installing Qt on windows. Any help just to make a stand alone .exe for Windows (as shared libraries ) please
Why not build your project by using qtcreator ?
Did you test your build environnement by making a test application with qtcreator ?
P.S.: If you want, I can explain how to build application using Visual Studio as a compiler and QtCreator as an IDE.
nmake is a build tool provided with Visual Studio and with Windows SDK. You don't have it, apparently.
It seems you're using a mingw build of Qt; it comes with a bundled copy of mingw. There, the build tool is simply called make.

Can I deploy Qt as a "system library" on Windows?

I am new to Qt, I installed Qt 5.6 and Microsoft compiler (I have Visual studio 2015 community).
It works.
I am focused on QML desktop applications on Windows 7/8/10.
I can't find informations about how to deploy Qt dlls once: if I make many applications that I deploy inside corporate LAN, I would like to install all the Qt dll required in one central location, so then I will speed up the edit/compile/test/deploy cycle.
I want to install every app in its respective folder, but the Qt "runtime" and dll only ONCE, not in EVERY app's folder.
That would be a huge time waste and space (and money).
How can I do? Is this possible?
thanks
Use cqtdeployer with deploySystem option.
This utility can deploy system libraries.
Warning, deploying system libraries may cause some qt modules to work incorrectly.
install catdeployer from online installer
open cmd
and call cqtdeployer with options:
cqtdeployer myApp.exe -qmlDir path/to/my/QML/folder -qmake path/to/my/qmake.exe -deploySystem
Where:
myApp.exe -you deployment application (release version)
-qmlDir path/to/my/QML/folder - this is path to your project qml folder
-qmake path/to/my/qmake.exe - the path to qmake that you were going with.
-deploySystem - option to capture system libraries.
If you wish, you can add the qif option to the end, this will force cqtdeployer to create an installer for your program.
cqtdeployer myApp.exe -qmlDir path/to/my/QML/folder -qmake path/to/my/qmake.exe -deploySystem qif

How to make a standalone mac app using qtcreator

I have build an app using C++ and Qt on QtCreator. The result is a .app file.
Now, when I am running it from the Qt Creator it is running fine.
But when I am running it on a different machine (with no Qt installed) it is not running.
I have figured out the reason is because my .app file is not deployed properly (as there is no framework folder added in the .app)
But I am now having trouble solving it. I am following this link but not getting anywhere as it for console purely.
Is there a way I can fix it using Qt Creator?
A Qt application relies upon Qt's libraries, which must be shipped with the application, inside the built application bundle. The steps for deploying a Qt application for OS X are detailed in the documentation.
If you're not using any other libraries, besides those of Qt, you just need to run the tool macdeployqt, which is part of the Qt installation, in the bin directory. You can set this up to run as a build step in Qt Creator, but I suggest only doing it before you actually deploy the final bundle to another machine.
Calling macdeployqt will copy the necessary Qt frameworks into the bundle and setup the paths to the frameworks so that the binary in the bundle knows where to find them.
If you use any other frameworks or libraries, you need to copy those yourself and set the references to them using install_name_tool

Creating set up for Qt Project

I have Qt application on Lnux. I want to create a executable/set up for this so as to distribute it on Windows and there is no need to install Qt. I have created the executable for this by including all the dlls
but to run it user needs to go inside the folder.
I want such user do not need to go inside any folder,he can directly click the icon can run it. Or such tha user downloads the set up, and install it.
What can be done for this?
You can use the Qt Installer Framework which could be downloaded here. The Qt Installer Framework provides a set of tools to create installers for Linux, Microsoft Windows, and Mac OS X.
You can compile the Installer Framework on your own, but i think using a prebuilt one is more convenient. You can see the Qt Installer Framework Manual for a complete guide on how to make off-line and on-line installers. Creating installers is described here.
A tutorial for creating simple installers for small projects is available here.

Qt5 Application Does Not Run

I created an application using Qt 5 (compiled with Visual Studio '12). It works on my machine.
However, it doesn't work when I attempt to run it on another machine. The output I collected through cmd yielded an empty file.
The directory structure is as follows:
myapp.exe
icudt52.dll
icuin52.dll
icuuc52.dll
libEGL.dll
libGLESv2.dll
msvcp120.dll
msvcr120.dll
Qt5Core.dll
Qt5Gui.dll
platforms/qminimal.dll
platforms/qwindows.dll
The most relevant post I found was Application deployed with QT5 libraries does not start on Windows 7 - yet the solution (including qwindows.dll & qminimal.dll) didn't work.
Any ideas?
Windows will report a number of launch errors just when you double click on your exe outside Qt Creator. It looks like you have included most or all of these already.
Your development machine typically will not have problems launching and running its qt plugins because of the LibraryPaths that are searched by your exe. http://qt-project.org/doc/qt-5/qcoreapplication.html#libraryPaths
Dependency Walker will do the job and show you what you need to know, but the output is pretty complex and can be hard to decipher.
The easiest way I have found to figure out what Qt plugin dlls I am using at runtime on Windows is to do the following:
Exit Qt Creator.
Open the install folder for the compiler you are using with Qt in Explorer. For example:
C:/Qt/5.3/msvc2010_opengl/
Create a copy of the plugins folder in place (Copy of plugins folder in the same path as plugins, so its parent is msvc2010_opengl in this case).
In another explorer window, open your exe (Qt program) on your development machine. Run a minimal test of your program to make sure the major features are working. (Many runtime plugins don't get loaded until QObjects that use them are instantiated).
Delete the plugins folder in the Qt path.
Windows will lock up all the dlls that are in use by your exe and prevent you from deleting a number of dlls. Click skip for all the un-deletable folders and files.
Now go into each of the folders that you couldn't delete before and try to delete all the individual dll's in each folder. Click skip for all the un-deletable dlls.
Now when you are all done, you are left with a skeleton of a plugins folder, only showing dlls that your application is using.
It will probably include the folders: accessibility, platforms and imageformats and more depending on what you included in your .pro file.
Close your exe.
Copy the contents of your stripped down plugins folder to sit right next to your exe.
Restore your backup of the plugins folder (delete the stripped down plugins folder from your Qt path and restore the Copy of plugins).
Now you should be good to go. Test on a non-development machine.
A Note on VS C++ Runtimes
Also on some machines when deploying Qt with MSVC, the msvcrXXX.dll doesn't match what the rest of the system is using. Instead of deploying msvcrXXX.dll, instead in our installers at our office, we include the Microsoft C++ Redistributable Installer and run it in the install script. And on a few machines they had corrupted Redistributables, and we had to do a force install of redistributables to fix the `Referral from server' error we would sometimes get.
You can find the latest installer for MSVC Redistributables here Latest Supported Visual C++ Downloads.
Hope that helps.
You have to deploy your application before copying dll files manually.
To deploy your Qt application on Windows you can use windeployqt which can be found in:
< QTDIR >/bin/windeployqt
Example batch script may work on deploying your Qt Application (run with PowerShell or cmd):
C:\Qt\Qt5.x.x\5.x.x\MSVCx_x\bin\windeployqt <APP_PATH>/myapp.exe
After deploying your app, try to run your myapp.exe and note which dll files are missing.
Copy / paste required dll files from QTDIR/bin to your < APP_PATH >
for more information about deploying:
Windows Deploying Tool - windeployqt
Deploying on Windows