IscanderChe
Aug. 2, 2019, 12:37 p.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.

  1. # ICTrackerServer.rc
  2.  
  3. IDI_ICON1 ICON "images/ICTracker.ico"
  4.  
  5. #include <windows.h>
  6.  
  7. #define VER_FILEVERSION 0,1
  8. #define VER_FILEVERSION_STR "0.1\1"
  9. #define VER_PRODUCTVERSION 0,1
  10. #define VER_PRODUCTVERSION_STR "0.1\1"
  11. #define VER_FILEDESCRIPTION_STR "ICTrackerServer"
  12. #define VER_INTERNALNAME_STR "ICTrackerServer"
  13. #define VER_LEGALCOPYRIGHT_STR "Copyright (C) 2019, Iscander Che"
  14. #define VER_ORIGINALFILENAME_STR "ICTrackerServer.exe"
  15. #define VER_PRODUCTNAME_STR "ICTrackerServer"
  16.  
  17. VS_VERSION_INFO VERSIONINFO
  18. FILEVERSION VER_FILEVERSION
  19. PRODUCTVERSION VER_PRODUCTVERSION
  20. BEGIN
  21. BLOCK "StringFileInfo"
  22. BEGIN
  23. BLOCK "040904E4"
  24. BEGIN
  25. VALUE "FileDescription", VER_FILEDESCRIPTION_STR
  26. VALUE "FileVersion", VER_FILEVERSION_STR
  27. VALUE "InternalName", VER_INTERNALNAME_STR
  28. VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
  29. VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
  30. VALUE "ProductName", VER_PRODUCTNAME_STR
  31. VALUE "ProductVersion", VER_PRODUCTVERSION_STR
  32. END
  33. END
  34.  
  35. BLOCK "VarFileInfo"
  36. BEGIN
  37. VALUE "Translation", 0x0419, 1252
  38. END
  39. END
  1. # ICTrackerServer.pro
  2.  
  3. 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.

  1. 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.

  1. ;------------------------------------------------------------------------------
  2. ;
  3. ; Установочный скрипт для Inno Setup 5.6.1
  4. ; для ПО ICTracker
  5. ; (c) Iscander Che, 26.07.2019
  6. ;
  7. ;------------------------------------------------------------------------------
  8.  
  9. ;------------------------------------------------------------------------------
  10. ; Определяем некоторые константы
  11. ;------------------------------------------------------------------------------
  12.  
  13. ; Имя приложения
  14. #define Name "ICTracker"
  15. ; Версия приложения
  16. #define Version "0.1"
  17. ; Фирма-разработчик
  18. #define Publisher "Iscander Che"
  19. ; Сафт фирмы разработчика
  20. #define URL "iscander.che@gmail.com"
  21. ; Имя исполняемого модуля
  22. #define ExeName "ICTracker.exe"
  23. ; Имя папки по умолчанию
  24. #define DirName "ICTracker"
  25. ; Корневой путь по умолчанию
  26. #define RootDir "G:\repos_wc"
  27.  
  28. ;------------------------------------------------------------------------------
  29. ; Параметры установки
  30. ;------------------------------------------------------------------------------
  31. [Setup]
  32.  
  33. ; Уникальный идентификатор приложения,
  34. ;сгенерированный через Tools -> Generate GUID
  35. AppId={{C73A79D0-8EDD-4AEE-9F14-4720AFF94765}
  36.  
  37. ; Прочая информация, отображаемая при установке
  38. AppName={#Name}
  39. AppVersion={#Version}
  40. AppPublisher={#Publisher}
  41. AppPublisherURL={#URL}
  42. AppSupportURL={#URL}
  43. AppUpdatesURL={#URL}
  44.  
  45. ; Путь установки по-умолчанию
  46. DefaultDirName={pf}\{#DirName}
  47. ; Имя группы в меню "Пуск"
  48. DefaultGroupName={#Name}
  49.  
  50. ; Каталог, куда будет записан собранный setup и имя исполняемого файла
  51. OutputDir={#RootDir}\{#DirName}\bin
  52. OutputBaseFileName={#Name}_v.{#Version}_setup
  53.  
  54. ; Файл иконки
  55. SetupIconFile={#RootDir}\{#DirName}\ICTrackerServer\images\ICTracker.ico
  56.  
  57. ; Параметры сжатия
  58. Compression=lzma
  59. SolidCompression=yes
  60.  
  61. ;------------------------------------------------------------------------------
  62. ; Устанавливаем языки для процесса установки
  63. ;------------------------------------------------------------------------------
  64. [Languages]
  65. Name: "english"; MessagesFile: "compiler:Default.isl"; LicenseFile: "License_ENG.txt"
  66. Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"; LicenseFile: "License_RUS.txt"
  67.  
  68. ;------------------------------------------------------------------------------
  69. ; Опционально - некоторые задачи, которые надо выполнить при установке
  70. ;------------------------------------------------------------------------------
  71. [Tasks]
  72. ; Создание иконки на рабочем столе
  73. Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
  74.  
  75.  
  76. ;------------------------------------------------------------------------------
  77. ; Файлы, которые надо включить в пакет установщика
  78. ;------------------------------------------------------------------------------
  79. [Files]
  80.  
  81. ; Исполняемый файл
  82. Source: "{#RootDir}\{#DirName}\build\release\{#Name}Server.exe"; DestDir: "{app}"; Flags: ignoreversion
  83.  
  84. ; Прилагающиеся ресурсы
  85. Source: "{#RootDir}\{#DirName}\build\release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
  86.  
  87. ;------------------------------------------------------------------------------
  88. ; Указываем установщику, что иконки он должен взять из исполняемого файла
  89. ;------------------------------------------------------------------------------
  90. [Icons]
  91.  
  92. Name: "{group}\{#Name}"; Filename: "{app}\{#ExeName}"
  93.  
  94. Name: "{commondesktop}\{#Name}"; Filename: "{app}\{#ExeName}"; Tasks: desktopicon
  95.  
  96. ;------------------------------------------------------------------------------
  97. ; Удаление ключей реестра при деинсталляции приложения
  98. ;------------------------------------------------------------------------------
  99. [Registry]
  100.  
  101. 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.

  1. rem makebin.bat
  2.  
  3. del /q build\release\Test_*.*
  4. copy license\LICENSE_GPL.txt build\release
  5. "%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!

By article asked0question(s)

3

Do you like it? Share on social networks!

Evgenii Legotckoi
  • Aug. 5, 2019, 3 p.m.

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

IscanderChe
  • Aug. 5, 2019, 4:02 p.m.

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

Evgenii Legotckoi
  • Aug. 5, 2019, 4:06 p.m.

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

IscanderChe
  • Aug. 5, 2019, 4:16 p.m.

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

Evgenii Legotckoi
  • Aug. 5, 2019, 4:17 p.m.

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

IscanderChe
  • Aug. 5, 2019, 4:23 p.m.

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

Evgenii Legotckoi
  • Aug. 5, 2019, 4:26 p.m.

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

IscanderChe
  • Aug. 5, 2019, 4:59 p.m.

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

Evgenii Legotckoi
  • Aug. 5, 2019, 5:01 p.m.

Open Source и есть Community ))

IscanderChe
  • Aug. 5, 2019, 5:05 p.m.

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

Evgenii Legotckoi
  • Aug. 5, 2019, 5:34 p.m.

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

IscanderChe
  • Dec. 26, 2019, 1:04 a.m.

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

Comments

Only authorized users can post comments.
Please, Log in or Sign up
  • Last comments
  • AK
    April 1, 2025, 11:41 a.m.
    Добрый день. В данный момент работаю над проектом, где необходимо выводить звук из программы в определенное аудиоустройство (колонки, наушники, виртуальный кабель и т.д). Пишу на Qt5.12.12 поско…
  • Evgenii Legotckoi
    March 9, 2025, 9:02 p.m.
    К сожалению, я этого подсказать не могу, поскольку у меня нет необходимости в обходе блокировок и т.д. Поэтому я и не задавался решением этой проблемы. Ну выглядит так, что вам действитель…
  • VP
    March 9, 2025, 4:14 p.m.
    Здравствуйте! Я устанавливал Qt6 из исходников а также Qt Creator по отдельности. Все компоненты, связанные с разработкой для Android, установлены. Кроме одного... Когда пытаюсь скомпилиров…
  • ИМ
    Nov. 22, 2024, 9:51 p.m.
    Добрый вечер Евгений! Я сделал себе авторизацию аналогичную вашей, все работает, кроме возврата к предидущей странице. Редеректит всегда на главную, хотя в логах сервера вижу запросы на правильн…
  • Evgenii Legotckoi
    Oct. 31, 2024, 11:37 p.m.
    Добрый день. Да, можно. Либо через такие же плагины, либо с постобработкой через python библиотеку Beautiful Soup