IscanderChe
IscanderCheAug. 2, 2019, 2:37 a.m.

Simple Tracker project. Part 8: the formation of the distribution and the results

Content

In conclusion, we will prepare the files obtained during compilation for distribution. It doesn't matter if the project is local. It is more convenient to have an installer handy, just in case. With it, you can, for example, automatically clean up the registry when you remove a program from a disk.

But let's start with the fact that we attribute the executable file, as is done in other applications: we set the version number, product name, copyright and icon of the executable file.


To do this, we will create an rc-file and add it to the corresponding directive of the pro-file.

# ICTrackerServer.rc

IDI_ICON1   ICON    "images/ICTracker.ico"

#include <windows.h>

#define VER_FILEVERSION             0,1
#define VER_FILEVERSION_STR         "0.1\1"
#define VER_PRODUCTVERSION          0,1
#define VER_PRODUCTVERSION_STR      "0.1\1"
#define VER_FILEDESCRIPTION_STR     "ICTrackerServer"
#define VER_INTERNALNAME_STR        "ICTrackerServer"
#define VER_LEGALCOPYRIGHT_STR      "Copyright (C) 2019, Iscander Che"
#define VER_ORIGINALFILENAME_STR    "ICTrackerServer.exe"
#define VER_PRODUCTNAME_STR         "ICTrackerServer"

VS_VERSION_INFO VERSIONINFO
FILEVERSION     VER_FILEVERSION
PRODUCTVERSION  VER_PRODUCTVERSION
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904E4"
        BEGIN
            VALUE "FileDescription",    VER_FILEDESCRIPTION_STR
            VALUE "FileVersion",        VER_FILEVERSION_STR
            VALUE "InternalName",       VER_INTERNALNAME_STR
            VALUE "LegalCopyright",     VER_LEGALCOPYRIGHT_STR
            VALUE "OriginalFilename",   VER_ORIGINALFILENAME_STR
            VALUE "ProductName",        VER_PRODUCTNAME_STR
            VALUE "ProductVersion",     VER_PRODUCTVERSION_STR
        END
    END

    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x0419, 1252
    END
END
# ICTrackerServer.pro

RC_FILE = ICTrackerServer.rc

We will do the same for the client.

To collect dll files for standalone operation of the executable file, we will use the windeployqt utility.

windeployqt %путь_к_папке_с_исполняемым_файлом%\ICTrakerServer.exe

We will do the same for the client.

Now let's build the distribution. To do this, we will use the Inno Setup program.

Let's create a build script in Inno Setup itself. You can do this using the wizard, but you can also manually adjust the template below. I once wrote a template from an example from the network.

;------------------------------------------------------------------------------
;
;       Установочный скрипт для Inno Setup 5.6.1
;       для ПО ICTracker
;       (c) Iscander Che, 26.07.2019
;
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
;   Определяем некоторые константы
;------------------------------------------------------------------------------

; Имя приложения
#define   Name       "ICTracker"
; Версия приложения
#define   Version    "0.1"
; Фирма-разработчик
#define   Publisher  "Iscander Che"
; Сафт фирмы разработчика
#define   URL        "iscander.che@gmail.com"
; Имя исполняемого модуля
#define   ExeName    "ICTracker.exe"
; Имя папки по умолчанию
#define   DirName    "ICTracker"
; Корневой путь по умолчанию
#define   RootDir    "G:\repos_wc"

;------------------------------------------------------------------------------
;   Параметры установки
;------------------------------------------------------------------------------
[Setup]

; Уникальный идентификатор приложения, 
;сгенерированный через Tools -> Generate GUID
AppId={{C73A79D0-8EDD-4AEE-9F14-4720AFF94765}

; Прочая информация, отображаемая при установке
AppName={#Name}
AppVersion={#Version}
AppPublisher={#Publisher}
AppPublisherURL={#URL}
AppSupportURL={#URL}
AppUpdatesURL={#URL}

; Путь установки по-умолчанию
DefaultDirName={pf}\{#DirName}
; Имя группы в меню "Пуск"
DefaultGroupName={#Name}

; Каталог, куда будет записан собранный setup и имя исполняемого файла
OutputDir={#RootDir}\{#DirName}\bin
OutputBaseFileName={#Name}_v.{#Version}_setup

; Файл иконки
SetupIconFile={#RootDir}\{#DirName}\ICTrackerServer\images\ICTracker.ico

; Параметры сжатия
Compression=lzma
SolidCompression=yes

;------------------------------------------------------------------------------
;   Устанавливаем языки для процесса установки
;------------------------------------------------------------------------------
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"; LicenseFile: "License_ENG.txt"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"; LicenseFile: "License_RUS.txt"

;------------------------------------------------------------------------------
;   Опционально - некоторые задачи, которые надо выполнить при установке
;------------------------------------------------------------------------------
[Tasks]
; Создание иконки на рабочем столе
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked 


;------------------------------------------------------------------------------
;   Файлы, которые надо включить в пакет установщика
;------------------------------------------------------------------------------
[Files]

; Исполняемый файл
Source: "{#RootDir}\{#DirName}\build\release\{#Name}Server.exe"; DestDir: "{app}"; Flags: ignoreversion

; Прилагающиеся ресурсы
Source: "{#RootDir}\{#DirName}\build\release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

;------------------------------------------------------------------------------
;   Указываем установщику, что иконки он должен взять из исполняемого файла
;------------------------------------------------------------------------------ 
[Icons]

Name: "{group}\{#Name}"; Filename: "{app}\{#ExeName}"

Name: "{commondesktop}\{#Name}"; Filename: "{app}\{#ExeName}"; Tasks: desktopicon

;------------------------------------------------------------------------------
;            Удаление ключей реестра при деинсталляции приложения              
;------------------------------------------------------------------------------
[Registry]

Root: HKCU; Subkey: "Software\ICTracker\Settings"; Flags: uninsdeletekey

You can run the assembly manually, through Inno Setup. This is handy when testing the assembly, because. errors in writing directives will be immediately shown. And you can do it from the command line (from a bat-file). We will use the second method, because before building the distribution:

1) you need to delete the test files Test_DataBase.exe (database tests), Test_Data.exe (generation of a test database for GUI testing) and Test_Server.exe (test client for testing the receipt of the task number and revision number by the server); in Inno Setup, there is the possibility of excluding files from the distribution, but I could not use it due to an incomplete understanding of the syntax of the Inno Setup directives;

2) add the license text to the set of distribution files.

rem makebin.bat

del /q build\release\Test_*.*
copy license\LICENSE_GPL.txt build\release
"%path_to_soft%\InnoSetup5\iscc" setup.iss

Everything, the assembly is ready to use. Now only functional tests and introduction to trial operation remain.

Results

Functional requirements are met, the architecture has not been changed.

Small changes were made to the appearance of the tracker due to the difficulty of interacting with a single drop-down list of task status. The form of the project creation dialog was simplified, leaving only projects without VCS support. Projects with VCS support are connected and archived automatically. The names of previously archived projects are not marked with the letter "(A)", since when they are extracted from the archive, the project automatically becomes active.

The main difficulties were in the development of the database: two tables were excluded from the database, a column was added in one table. For the future, this should be taken into account and a more thorough approach to the formation of the database structure (if necessary, its availability).

Thank you all for your attention. This completes the Simple Tracker project. Interesting projects!

We recommend hosting TIMEWEB
We recommend hosting TIMEWEB
Stable hosting, on which the social network EVILEG is located. For projects on Django we recommend VDS hosting.

Do you like it? Share on social networks!

Evgenii Legotckoi
  • Aug. 5, 2019, 5 a.m.

А не думали попробовать использовать Qt Installer Framework для сборки дистрибутива?

IscanderChe
  • Aug. 5, 2019, 6:02 a.m.

Насколько я понял из доков, его надо собирать статической сборкой Qt, а я с этим не в ладах...

Evgenii Legotckoi
  • Aug. 5, 2019, 6:06 a.m.

Нет, ничего подобного. В статье без статической сборки сделано.

IscanderChe
  • Aug. 5, 2019, 6:16 a.m.

Я имею ввиду, сам фреймворк, перед тем, как его использовать, надо собрать из исходников статическим Qt.

Evgenii Legotckoi
  • Aug. 5, 2019, 6:17 a.m.

нет. Его можно установить из Maintenance Tool, как и Qt Creator

IscanderChe
  • Aug. 5, 2019, 6:23 a.m.

У меня с Maintenance Tool засада. При открытии тула он требует логин-пароль Qtшного аккаунта, я ввожу то, что надо,а он не принимает его. И на этом всё. Я даже не могу установить другую версию Qt с того же аккаунта, приходится новый заводить.

Evgenii Legotckoi
  • Aug. 5, 2019, 6:26 a.m.

Вообще, можно всё установить и без аккаунта, он не очень-то и обязателен, если использовать Community Edition

IscanderChe
  • Aug. 5, 2019, 6:59 a.m.

В смысле? Я смотрю на странице https://www.qt.io/download, там только два варианта: Commercial и Open Source. Использую вторую.

Evgenii Legotckoi
  • Aug. 5, 2019, 7:01 a.m.

Open Source и есть Community ))

IscanderChe
  • Aug. 5, 2019, 7:05 a.m.

Так вот она и требует аккаунта.

Evgenii Legotckoi
  • Aug. 5, 2019, 7:34 a.m.

Ну это уже другой вопрос, что она требует аккаунта. У меня есть аккаунт и он работает ))

IscanderChe
  • Dec. 25, 2019, 2:04 p.m.

Поразбирался на досуге с QtIFW, вроде бы нормально. Спасибо за совет. Напрягает только, что на Windows 7 кнопка "Снять отметки выбора со всех компонентов" криво отображается, только часть текста видна. На Windows 10 всё в порядке с отображением текста.

Comments

Only authorized users can post comments.
Please, Log in or Sign up
e
  • ehot
  • March 31, 2024, 2:29 p.m.

C++ - Тест 003. Условия и циклы

  • Result:78points,
  • Rating points2
B

C++ - Test 002. Constants

  • Result:16points,
  • Rating points-10
B

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

  • Result:46points,
  • Rating points-6
Last comments
k
kmssrFeb. 8, 2024, 6:43 p.m.
Qt Linux - Lesson 001. Autorun Qt application under Linux как сделать автозапуск для флэтпака, который не даёт создавать файлы в ~/.config - вот это вопрос ))
Qt WinAPI - Lesson 007. Working with ICMP Ping in Qt Без строки #include <QRegularExpressionValidator> в заголовочном файле не работает валидатор.
EVA
EVADec. 25, 2023, 10:30 a.m.
Boost - static linking in CMake project under Windows Ошибка LNK1104 часто возникает, когда компоновщик не может найти или открыть файл библиотеки. В вашем случае, это файл libboost_locale-vc142-mt-gd-x64-1_74.lib из библиотеки Boost для C+…
J
JonnyJoDec. 25, 2023, 8:38 a.m.
Boost - static linking in CMake project under Windows Сделал всё по-как у вас, но выдаёт ошибку [build] LINK : fatal error LNK1104: не удается открыть файл "libboost_locale-vc142-mt-gd-x64-1_74.lib" Хоть убей, не могу понять в чём дел…
G
GvozdikDec. 18, 2023, 9:01 p.m.
Qt/C++ - Lesson 056. Connecting the Boost library in Qt for MinGW and MSVC compilers Для решения твой проблемы добавь в файл .pro строчку "LIBS += -lws2_32" она решит проблему , лично мне помогло.
Now discuss on the forum
a
a_vlasovApril 14, 2024, 6:41 a.m.
Мобильное приложение на C++Qt и бэкенд к нему на Django Rest Framework Евгений, добрый день! Такой вопрос. Верно ли следующее утверждение: Любое Android-приложение, написанное на Java/Kotlin чисто теоретически (пусть и с большими трудностями) можно написать и на C+…
Павел Дорофеев
Павел ДорофеевApril 14, 2024, 2:35 a.m.
QTableWidget с 2 заголовками Вот тут есть кастомный QTableView с многорядностью проект поддерживается, обращайтесь
f
fastrexApril 4, 2024, 4:47 a.m.
Вернуть старое поведение QComboBox, не менять индекс при resetModel Добрый день! У нас много проектов в которых используется QComboBox, в версии 5.5.1, когда модель испускает сигнал resetModel, currentIndex не менялся. В версии 5.15 при resetModel происходит try…
AC
Alexandru CodreanuJan. 19, 2024, 11:57 a.m.
QML Обнулить значения SpinBox Доброго времени суток, не могу разобраться с обнулением значение SpinBox находящего в делегате. import QtQuickimport QtQuick.ControlsWindow { width: 640 height: 480 visible: tr…

Follow us in social networks