PDA

View Full Version : On the way of making an app installable



franky
3rd February 2017, 21:42
Hi all,

I assume you, too, have done this process. If so please guide me.

I finished my app and ran it in both Debug and Release modes. And then made a folder named Cal on my desktop and brought the .exe file from the Release folder and put that .exe plus some .dll files onto it so that made it executable.

My machine is a win 7 x64 and use Qt Creator 5.7.
My Cal folder is on this path: C:\Users\ME\Desktop\Cal
And the Debug and Release folders are on this path: C:\Users\ME\Documents\Qt

My purpose as the title says, is making the app installable to send it to others and be sure that it will be installed on their Windows machines as well.
For this, I was advised to see and follow this Docs:
http://doc.qt.io/qt-5/deployment.html

I read the first page and until now I have a question. It says: "All you need to do is to build Qt and your application in release mode..."
Building the application means running it (because when we run some app it first will be built then run), but what does "building Qt" mean? Is Qt build-able!?

After reading that page I went for the next Qt For Windows page there:
http://doc.qt.io/qt-5/windows-deployment.html

I found the windeployqt.exe file in this path: C:\Qt\Qt5.7.0\5.7\mingw53_32\bin\windeployqt.exe

Now I'm at the beginning of the dark cadre on how to use that executable file.
It says: "The simplest way to use windeployqt is to add the bin directory of your Qt
installation (e.g. <QT_DIR\bin>) to the PATH variable and then run:
windeployqt <path-to-app-binary>"

Does it mean I should run that .exe file from some folder's path (say, the Release or Cal folder)?

Have I gone the way right?

Thank you.

d_stranz
3rd February 2017, 22:47
Step 1:


It says: "The simplest way to use windeployqt is to add the bin directory of your Qt installation (e.g. <QT_DIR\bin>) to the PATH variable

Go into Control Panel, System, Advanced Systems Settings, Environment Variable and add the path to your Qt bin directory, presumably "C:\Qt\Qt5.7.0\5.7\mingw53_32\bin" to the PATH variable if it is not already there. Do it correctly or your could break your Windows environment. Look at other entries in PATH and add your Qt path the same way. Put a semicolon (";") after your path information if it is not at the end of the list.

Step 2:


then run: windeployqt <path-to-app-binary>"

which in your case means to open an MS-DOS command window and type

windeployqt C:\Users\ME\Documents\Qt\Release\name-of-your-program.exe

(or you could cd to C:\Users\ME\Documents\Qt\Release and just type "windeployqt name-of-your-program.exe", where of course you put the actual name of your program instead of "name-of-your-program")

I have never used this tool, but I assume it will create a new EXE or MSI installer file that will contain everything needed to install your program on another PC. Do not do this with the Debug version of your program. It almost certainly will not work because a Debug mode program is not compatible with the Release mode Qt DLLs the deployment tool will copy into the installer.

franky
4th February 2017, 11:13
Thank you for your answer.
I used windeployqt that way and my Release folder changed like this:
http://uploads.im/ViqNX.jpg

After these I downloaded:

qt-installer-framework-opensource-2.0.1-x86.run
qt-installer-framework-opensource-2.0.1-x64.run
qt-installer-framework-opensource-2.0.1-src

And also have the Release folder that I used it for windeployqt by a Command Prompt in previous step.

Now my questions is, what is the rest of the process?
What other steps do I need to do for making the app installable please?

If you have any idea in mind, I would be very appreciative to hear it.
Thanks.

d_stranz
4th February 2017, 20:03
Well, apparently what the windeployqt tool does is to copy the Qt DLLs your app needs into your Release folder. It doesn't create an installer like I thought.

It looks like the Qt Installer Framework that you downloaded will actually create the installation program. Why don't you read the manual (http://doc.qt.io/qtinstallerframework/) and learn how to use it?

franky
4th February 2017, 20:45
Thank you.

Honestly I have been really confused and exhausted because it has been for long while trying just to make a installable app but it is very complicated and there is no clear way. but I don't know why. :(:(:(:(:

Thanks for your reply. I went for that page. And want to Offline Installer . I continue reading until next pages the section: Configuring Qt for Windows. There it says I should run a command line as follows:

configure -prefix %CD%\qtbase -release -static -static-runtime ... (A very long command. Please take a look at it there.)

But I don't have a configure.exe file to use that command.
Did you see? They are just confusing others. Why they should be that unclear? What is the reason? Shouldn't we be able to make a installable app?

I'm just confusing and confusing. Sorry.

d_stranz
5th February 2017, 01:22
Configuring Qt for Windows

No, no, no. You already have everything configured for Qt. Start reading the tutorial here. (http://doc.qt.io/qtinstallerframework/ifw-tutorial.html)

Creating installers using any tool is not easy. There is nothing that I know of that is simple like "Click a button" and it creates an installer for your program. So if you want to create a setup program that will install your app correctly, you are going to have to teach yourself how.

franky
5th February 2017, 10:14
Thank you for your guide. I appreciate it.

I followed the link you offered. I did these:

1- Went to [this page]http://doc.qt.io/qtinstallerframework/ifw-component-description.html for creating a package directory first. So I created a folder named package directory on my Desktop and created two subdirectories named data and meta in it.

2- Using a Notepad I created a package.xml file using the example that page offered for it. The xml file contains these:

<?xml version="1.0"?>

-<Package>
<DisplayName>Qt Calculator</DisplayName>
<Description>A Calculator Written in Qt by Purely C++ Code</Description>
<Version>1.1</Version>
<ReleaseDate>2017-03-23</ReleaseDate>
<Name>com.vendor.root.component2</Name>
<Dependencies>com.vendor.root.component1</Dependencies>
<Virtual>false</Virtual>
<Default>false</Default>
<ForcedInstallation>false</ForcedInstallation>
<Essential>false</Essential>
<Replaces>com.vendor.root.component2old</Replaces>
</Package>


I filled only the required fields and since this is the first time for me, I tried to make it concise as above.

Now I have two questions please:
1- Have I done the work correctly up to this point?

2- For the data subdirectory, the link says "The data directory contains the content that the installer extracts during the installation." What content does it mean? I have the Release folder plus qt-installer-framework-opensource-2.0.1-x86.run only.

What after it please: [Controller Scripting](http://doc.qt.io/qtinstallerframework/noninteractive.html) or [the main section](http://doc.qt.io/qtinstallerframework/ifw-tutorial.html) to follow the work?