Qt WinAPI - Lesson 002. How to make win installer for Qt apllication?

WinAPI, DLL, InnoSetup, Windows, Qt, Инсталлятор

In the previous article we learned how to quickly collect all used in the project DLL-libraries. And now it is time to talk about how to build an installer for OS Windows. For a long time I use quite comfortable opensource tool called InnoSetup, which allows just a few clicks to collect a multilingual installer.

The installer utility is going from a script, you can write to blows, or use a script to create the script. The second embodiment is sufficiently effective and easier.

Build installer

Step one. Running the build script

To run the script, go to the menu and choose to create a new one: File > New or combination of keys Ctrl + N.

Then click on the button Next.

Step Two. Defining the program data

In this step, setting up your program's data:

  1. Application Name;
  2. The version of the application;
  3. Publisher application;
  4. Website application.

After that, follow the next (Next button).

Step Three. Setting a folder to install the application

In this step, select the folder where you install the application, if required, and can specify whether to allow the user to change the destination folder or not.

Step Four. Selecting the folders and files that will be included in the package

In this step, you must select the executable file (* .exe), folders, and your application libraries.

Step Five. Setting advanced options of the installer

In this step, we set up the icons that will be created when you install the application, and user rights to configure these icons during installation.

Step Six. Defining the license agreement

Unless of course you have time to write ...

Step Seven. Set up the language of the installer

Step Eight. Setting the output folder and the name of the installer

In this step, we configure the path to the folder where the installer will be built and the name and icon of the installer. The following steps click Next and finally Finish .

Step Nine. Build installer

After the end of the script for the preparation of the script utility will offer to build the installer.

From build installer initially refused recommend if you have a folder with their attachments. As still need to manually register the file path of an assembly that are in those folders.

To do this, locate the unit [Files], and in it the line where the selected folder contents.

In this case, the line:

Source: "D:\gui_stm32\imageformats\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

It is necessary to correct the setting DestDir, as shown below, otherwise the installer will dump all the files in the pile.

Source: "D:\gui_stm32\imageformats\*"; DestDir: "{app}\imageformats"; Flags: ignoreversion recursesubdirs createallsubdirs

Coclusion

Summing up, I can say that the utility copes with its functionality in the "Excellent"

And to download from the official website at the following link: InnoSetup

Just do not forget to collect all the DLL project in the same folder as was done in the previous article.

Video

10% refund of hotel reservation amount on Booking
10% refund of hotel reservation amount on Booking
We offer a link with a 10% return on the amount of the order when booking a hotel through Booking
Support the author Donate

Comments

Only authorized users can post comments.
Please, Log in or Sign up
G
July 24, 2019, 4:20 a.m.
G0tzef

C++ - Test 005. Structures and Classes

  • Result:66points,
  • Rating points-1
VK
July 24, 2019, 3:49 a.m.
Viktoriia Komarova

C++ - Test 001. The first program and data types

  • Result:40points,
  • Rating points-8
G
July 24, 2019, 3:25 a.m.
G0tzef

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:80points,
  • Rating points4
Last comments
July 23, 2019, 12:14 p.m.
IscanderChe

Вот ссылка: https://github.com/iscander-che/TestReportViewer .
July 23, 2019, 5:42 a.m.
Evgenij Legotskoj

Хорошо, хотя конечно это С, а не С++ )))) Но если вдруг будут проблемы, то решение через класс со статическими переменными вы видели ))
July 23, 2019, 5:33 a.m.
IscanderChe

"Не потребует каждый раз объявлять extern в других файлах". И так не требует. У меня в тестовом классе эти переменные используются без дополнительного объявления. Так же объявил их в cpp-файле о…
July 23, 2019, 5:28 a.m.
IscanderChe

В репозиторий могу сегодня вечером выложить. "Или ее надо компилить самому под дистриб?" Тут я не совсем понимаю, что вы имеете ввиду. Я выложу в репозиторий исходный код утилиты, и всё.
July 23, 2019, 4:32 a.m.
Evgenij Legotskoj

Есть комментарий по вашему коду. Лучше бы вместо глобальных переменных в стиле Си, то есть с использоавнием extern, написали бы статические переменные в рамках класса. IMHO - это будет выглядеть…
Now discuss on the forum
July 24, 2019, 4:57 a.m.
Mihailll

Это не помогает. Ниже мой код Rectangle{ //Flickable { //contentX: 100 id: rectangleForListView y: parent.height * 0.15 height: parent.height * 0.…
July 24, 2019, 3:17 a.m.
Evgenij Legotskoj

Ну вот теперь я несколько в ступоре. Запустите из консоли проект и посмотрите тогда, на что ругается. Также, следовало бы посмотреть в настройках самой виртуальной машины, что по поддержке OpenG…
July 23, 2019, 8:20 a.m.
Mihailll

Так работает QFile f1(dbAdress); f1.setPermissions(QFileDevice::WriteOther);
July 23, 2019, 7:11 a.m.
Pavel K.

Советую использовать нечто такое или такое
July 22, 2019, 10:50 a.m.
Pavel K.

Благодарю.Буду пробовать.
Looking for a Job?
5,000.00 руб. - 15,000.00 руб.
Дизайнер
Moskovskiy, Moscow, Russia
25,000.00 руб. - 30,000.00 руб.
Разработчик Qt/C++
Barnaul, Altai Krai, Russia

For registered users on the site there is a minimum amount of advertising

EVILEG
About
Services
Join us
© EVILEG 2015-2019
Recommend hosting TIMEWEB