I am returning to this old topic because I have a similar need.
I use the Qt Installer Framework to install my Qt application written in C++.
I should point out that with the Qt Installer Framework, you can create two types of installers: “online”, which downloads what it needs to install from a remote repository, and “offline”, which contains everything it needs.
Offline installers have one drawback: they do not allow you to “update” from an older version to a newer one. As a result, if the software is already installed, you have to uninstall the previous version before installing a new one.
At the moment, I cannot create an “online” installer (which would solve the problem), so I have come up with a workaround for the “offline” installer which, thanks to a Qt script, silently uninstalls the old version.
Now, I need to insert a few seconds of “sleep” into the Qt script to give the uninstaller, which runs in the background, time to do its job. This is because users (including myself) are often a little too quick to move forward with the installation process and are told that “the destination folder is already in use” even though, when they try again a moment later, it is free and available for installation.