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
AD

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

  • Result:50points,
  • Rating points-4
m

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

  • Result:80points,
  • Rating points4
m

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

  • Result:20points,
  • Rating points-10
Last comments
i
innorwallNov. 14, 2024, 5:09 p.m.
Qt/C++ - Tutorial 068. Hello World using the CMAKE build system in CLion ditropan pristiq dosing With the Yankees leading, 4 3, Rivera jogged in from the bullpen to a standing ovation as he prepared for his final appearance in Chicago buy priligy pakistan
i
innorwallNov. 14, 2024, 12:05 p.m.
EVILEG-CORE. Using Google reCAPTCHA 2001; 98 29 34 priligy buy
i
innorwallNov. 14, 2024, noon
PyQt5 - Lesson 007. Works with QML QtQuick (Signals and slots) priligy 30mg Am J Obstet Gynecol 171 1488 505
i
innorwallNov. 14, 2024, 10:54 a.m.
Django - Tutorial 003. Model, Template, View on Django Hair follicles are believed to produce approximately 20 individual hair shafts over the life of the follicle as the follicle progresses through cycles of hair production, shedding ejection, invo…
i
innorwallNov. 14, 2024, 7:03 a.m.
How to make game using Qt - Lesson 3. Interaction with other objects what is priligy tablets What happens during the LASIK surgery process
Now discuss on the forum
i
innorwallNov. 14, 2024, 11:39 a.m.
добавить qlineseries в функции priligy amazon canada 93 GREB1 protein GREB1 AB011147 6
i
innorwallNov. 11, 2024, 6:55 p.m.
Всё ещё разбираюсь с кешем. priligy walgreens levitra dulcolax carbs The third ring was found to be made up of ultra relativistic electrons, which are also present in both the outer and inner rings
9
9AnonimOct. 25, 2024, 4:10 p.m.
Машина тьюринга // Начальное состояние 0 0, ,<,1 // Переход в состояние 1 при пустом символе 0,0,>,0 // Остаемся в состоянии 0, двигаясь вправо при встрече 0 0,1,>…

Follow us in social networks