The maintenance tool that is bundled with online installers for Qt applications can supposedly be run headlessly with a "--checkupdates" flag that returns update information if available (see Qt Installer Framework: Auto Update). Unfortunately I cannot get this command to actually return anything, even when there is a known update available. I can start the maintenancetool from the command line and the update is visible, but trying to use the --checkupdates flag produces nothing.
QProcess update;
update.setWorkingDirectory(QDir::currentPath());
update.start("maintenancetool --checkupdates");
// Wait until the maintenancetool is finished
update.waitForFinished();
// Read the output
QByteArray data = update.readAllStandardOutput();
I can get this code to open the maintenancetool if I remove the --checkupdates flag, but data is always empty even if there is an update. If I try and run the process in the command line it also produces nothing, so I don't think it's a problem with the code. Any ideas? There doesn't seem to be a lot of information out there about this.
Although I don't know the reason for it, the problem appears to be that the --checkupdates
flag does not return any data. However, it does have the appropriate exit code based on whether or not there are updates available. I have rewritten my application to catch the exit code and start the maintenance tool (or not) accordingly. Feels like a hack, but it works.