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:
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.
Deploying our Program is now very easy.
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.
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.
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.
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.