Uploaded image for project: 'Qt Installer Framework'
  1. Qt Installer Framework
  2. QTIFW-2625

Consider replacing .vbs hack to update MaintenanceTool.exe on Windows

    XMLWordPrintable

Details

    • User Story
    • Resolution: Fixed
    • P2: Important
    • 4.5.0
    • None
    • General

    Description

      MaintenanceTool uses a temporary .vbs script to do an update of itself on Windows.

      This sometimes causes issues with Virus Scanners (see e.g. QTIFW-1113, mailing list , forum). It is also problematic in cases where the cscript host is disabled, see QTIFW-956.
       
      An alternative approach that Julien Cugnière suggests on development@qt-project.org is:

      [...] In windows a running executable cannot replace itself, but it can rename itself. The way I've done it in the past is:

      • The running executable renames itself.
      • It then creates the new executable with the correct name.
      • Just before returning from main, it starts the new executable (there
        is a short window of time where both the old and new one can be
        running, but it doesn't matter if the old one is not using any
        resources any more ; if need be, the new one can be given a flag to
        wait for the old one to exit).

      I find it simpler, and much less likely to trigger an antivirus than a
      vbs file

      This indeed sounds much simpler, though it needs to be understood if this approach also works in case of elevated installation (where MaintenanceTool "spawns" itself as an elevated process). How about giving it a try?

      Attachments

        Issue Links

          For Gerrit Dashboard: QTIFW-2625
          # Subject Branch Project Status CR V

          Activity

            People

              arttu.tarkiainen Arttu Tarkiainen
              kkohne Kai Köhne
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes