Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to download update installation automatically
Qt 6.11 is out! See what's new in the release blog

How to download update installation automatically

Scheduled Pinned Locked Moved Solved General and Desktop
14 Posts 4 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    canid
    wrote on last edited by canid
    #1

    hello,I want the program to download and install automatically. I can let the program download the installation file, but I don't know how to install it automatically in the background,How do I do that?thanks!

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      The answer depends heavily on the platform, on some it is impossible to update silently (Android for example). Check how Chrome and Firefox are doing it.

      (Z(:^

      C 1 Reply Last reply
      0
      • sierdzioS sierdzio

        The answer depends heavily on the platform, on some it is impossible to update silently (Android for example). Check how Chrome and Firefox are doing it.

        C Offline
        C Offline
        canid
        wrote on last edited by
        #3

        @sierdzio
        Yes, how to install silently in Windows, I see some games can be done, such as StarCraft 2, thank you

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          On Windows it should be enough to run the installer with QProcess, passing silent flag with it.

          The problem is, of course, when the installer replaces the executable (which is in use). I don't know what is the recommended way to work around it. You probably need to start a detached QProcess, then programmatically exit the application, then the installer should re-open the app.

          (Z(:^

          C 1 Reply Last reply
          1
          • sierdzioS sierdzio

            On Windows it should be enough to run the installer with QProcess, passing silent flag with it.

            The problem is, of course, when the installer replaces the executable (which is in use). I don't know what is the recommended way to work around it. You probably need to start a detached QProcess, then programmatically exit the application, then the installer should re-open the app.

            C Offline
            C Offline
            canid
            wrote on last edited by canid
            #5

            @sierdzio
            Yes,How does QProcess pass the silent flag? thanks

            sierdzioS 1 Reply Last reply
            0
            • B Offline
              B Offline
              Bonnie
              wrote on last edited by
              #6

              I think Firefox has a background service to do the silent installation.
              Seems like that it will wait untill all of the Firefox instances are manually exited and then install the update files silently.
              And I feel that must be very complicated...

              1 Reply Last reply
              1
              • C canid

                @sierdzio
                Yes,How does QProcess pass the silent flag? thanks

                sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                @canid said in How to download update installation automatically:

                @sierdzio
                Yes,How does QProcess pass the silent flag? thanks

                That's a question to your installer, not me :-) Each installer technology handles it differently. And you can cook up a custom installer, too.

                (Z(:^

                C 1 Reply Last reply
                0
                • sierdzioS sierdzio

                  @canid said in How to download update installation automatically:

                  @sierdzio
                  Yes,How does QProcess pass the silent flag? thanks

                  That's a question to your installer, not me :-) Each installer technology handles it differently. And you can cook up a custom installer, too.

                  C Offline
                  C Offline
                  canid
                  wrote on last edited by
                  #8

                  @sierdzio
                  I use QProcess:: Start () to get the upgrade installed automatically, but how do I get the callback to restart after it's installed

                  JonBJ 1 Reply Last reply
                  0
                  • C canid

                    @sierdzio
                    I use QProcess:: Start () to get the upgrade installed automatically, but how do I get the callback to restart after it's installed

                    JonBJ Online
                    JonBJ Online
                    JonB
                    wrote on last edited by
                    #9

                    @canid
                    Do you mean you want to know when the QProcess is finished, or something else?

                    C 1 Reply Last reply
                    0
                    • JonBJ JonB

                      @canid
                      Do you mean you want to know when the QProcess is finished, or something else?

                      C Offline
                      C Offline
                      canid
                      wrote on last edited by
                      #10

                      @JonB
                      Yes, I had some difficulties writing code when qprocess is finished

                      JonBJ 1 Reply Last reply
                      0
                      • C canid

                        @JonB
                        Yes, I had some difficulties writing code when qprocess is finished

                        JonBJ Online
                        JonBJ Online
                        JonB
                        wrote on last edited by
                        #11

                        @canid
                        OK, so search the doc page for finished, and you'll come across signal https://doc.qt.io/qt-5/qprocess.html#finished. Put a slot on that. When it's hit, the sub-process has finished.

                        1 Reply Last reply
                        1
                        • B Offline
                          B Offline
                          Bonnie
                          wrote on last edited by Bonnie
                          #12

                          Does your installing include upgrading this currently running executable file and other files being used by it like the dlls?
                          If yes you can't wait the process to be finished, but exit immediately after starting the process detached, otherwise those files can never be upgraded.

                          C 1 Reply Last reply
                          1
                          • B Bonnie

                            Does your installing include upgrading this currently running executable file and other files being used by it like the dlls?
                            If yes you can't wait the process to be finished, but exit immediately after starting the process detached, otherwise those files can never be upgraded.

                            C Offline
                            C Offline
                            canid
                            wrote on last edited by
                            #13

                            @Bonnie
                            My code writes like this, the installation program also started, but did not output "started". What's wrong with it?

                            QProcess *process = new QProcess(this);
                            process->start("D:\\mysoft.exe", QStringList()<<"/SILENT");
                            connect(process,&QProcess::started,this,[](){
                                    qDebug()<<"started";
                                });
                            
                            B 1 Reply Last reply
                            0
                            • C canid

                              @Bonnie
                              My code writes like this, the installation program also started, but did not output "started". What's wrong with it?

                              QProcess *process = new QProcess(this);
                              process->start("D:\\mysoft.exe", QStringList()<<"/SILENT");
                              connect(process,&QProcess::started,this,[](){
                                      qDebug()<<"started";
                                  });
                              
                              B Offline
                              B Offline
                              Bonnie
                              wrote on last edited by
                              #14

                              @canid
                              You should connect the signal before you call start.

                              1 Reply Last reply
                              3

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved