background-shape
feature-image

Qt Series S01E03: QtInstallerFramework & delivery

Previously, we saw how to automatize the creation of an offline and online installer using the Qt Installer Framework and GitHub Actions. In this episode, we will focus on the online installer. What to put on the web server? How can the user update the program?

Why? Using an online installer has several advantages:

  • Promote updates.
  • Lighter installer. Can fetch only selected packages.
  • Package by package updates.

OnlineRepository architecture

At the end of the previous episode, we produced an Installer executable and an OnlineRepository folder. The OnlineRepository is the folder to put on a web server at the endpoint of the URL specified in the config.xml file. When the user installs the program or runs the maintenance tool (more on that later), the tool will fetch this online repository, compare the currently installed version with the last version and install or update the program accordingly.

OnlineRepository
│   date_meta.7z
│   Updates.xml
│
└───Program
     │ 0.0.0data.7z 
     │ 0.0.0data.7z.sha1
     │ 0.0.0meta.7z

The Updates.xml file will contain information about the whole Program and the packages included in the installer.

The date_meta.7z archive contains our license, installscript.qs, and custom component readmecheckboxform.ui necessary for the installer (in the case of an online-only installer, the Installer executable will virtually contain nothing except an URL). If there are multiple packages, it will have all the metadata for all packages.

In the Program directory, we find our actual package data in 0.0.0data.7z, the hash in 0.0.0data.7z.sha1. The 0.0.0meta.7z will contain the metadata for this particular package. If there are several packages, it will have several folders like this one, one by package.

Web server

Deploying our Program is now very easy.

  1. Put the OnlineRepository on the web server at the correct URL.
  2. Ship the Installer executable to the user.

The OnlineRepository can be hosted on the program website. If there is no dedicated website, it is possible to use a GitHub or GitLab Page.

Promoting updates

Developer side

At each new version of the program or one of its packages, you can update the OnlineRepository (don’t forget to bump the version number) by recreating it and deploying it on the web server.

User side

The user can update packages by opening the MaintenanceTool included in the directory package. Note that in the previous episode, we have created a shortcut to the MaintenanceTool executable in the Start Menu on Windows to simplify the update process.

Conclusion

In this episode, we have seen how to deliver our program to the user through an online installer that will install and keep the program up-to-date. This approach can be applied to Windows, Linux, and macOS. It is the usual way of deployment for Windows. Remember that users prefer a dmg file on MacOs and a package or AppImage on Linux.