Take the 2-minute tour ×

Well i've been looking how to do an auto updater on google, however no success.

What i would plan is to create an updater (ANother exe called by QProcess though the principal exe) but here ihave some questions:

How do i make the QProcess silent? If there's a new version, how do i show a notification on the window from where the process has been started (I meant i've create the process in Game.exe, i want to send a notification to Game.exe from Updater.exe that there's a new version available.)

Thanks for the answers.

share|improve this question
You need Inter-process communication, Qt has a collection of D-Bus classes that are good for this. –  cmannett85 Dec 17 '11 at 10:25
add comment

1 Answer

First, I've never encountered a need to create anything other than a QThread to handle my update needs. The QProcess would be helpful if, once the user updates, you want to download, install, and relaunch the program while the user continues with the main program. (But this can all be achieved with a shell script, python script, even BAT file)

When you use QProcess, you will have to rely on the signals readyReadStandardError() and readyReadStandardOutput(). Then the application that your process is calling should send its output to stderr or stdout. Updater.exe should write to either of these files.

I would imagine your Updater to make use of QNetworkAccessManager::finished(QNetworkReply *reply). When this slot is called, please do something nicer than this:

void Updater::replyFinished(QNetworkReply *reply){
    QString r(reply->readAll());
        qDebug() << "yes";
        qDebug() << "no";

If Updater.exe is going to be a full blown GUI application, do not call the show() method unless it's needed and it should appear to run in the background. I would prefer a script, but you know me.

Then your Game.exe will set up a QProcess. You can pass arguments to the process within the QProcess::start() function.

Good arguments that will help direct your update process would be:

  • Game.exe version number
  • "check_for_updates"
  • "ignore_updates"
  • "download_update"

finally, in Game.exe:


void Game::readProcessReply(){
    QString r(process->readAllStandardError());
        //show your dialog here
        //do nothing
share|improve this answer
add comment

Your Answer


