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

maintenancetool exit before all operations are really done

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 3.2.0
    • General
    • None
    • All

    Description

      I am calling the maintenance tool from the installer to make an automatic uninstallation and I need to add a check loop after the installer.execute function call to be sure that the uninstallation is really completed.

      The installer.execute function is synchrone according to the documentation. So I shouldn't have to add a wait.

      Here is my code:

      Component.prototype.componentPerformInstallationPageEntered = function()
      {
          var dir = installer.value("TargetDir");
          if (installer.fileExists(dir)) {
              if (systemInfo.productType === "windows"  && installer.fileExists(dir + "/Map Editor.exe")) {
                  installer.execute("\"" + dir + "/maintenancetool.exe\"", "--script=" + dir + "/scripts/auto_uninstall.js");
              }
              else if (installer.fileExists(dir + "/Map Editor")) {
                  installer.execute("sh", ["-c" , "\"" + dir + "/maintenancetool\" --script=\"" + dir + "/scripts/auto_uninstall.js\""]);
              }
      
              while (installer.fileExists(dir))
                  delay(50);
          }
      }
      
      

      Code of the auto_uninstall.js script:

      function Controller()
      {
          installer.gainAdminRights();
      	
          gui.clickButton(buttons.NextButton);
          gui.clickButton(buttons.CommitButton);
      
          installer.uninstallationFinished.connect(this, this.uninstallationFinished);
      }
      
      Controller.prototype.uninstallationFinished = function()
      {
          gui.clickButton(buttons.NextButton);
      }
      
      Controller.prototype.FinishedPageCallback = function()
      {
          gui.clickButton(buttons.FinishButton);
      }
      

       

      If I don't put the wait the installation can be corrupted.

       

       I think that this issue is mainly on Windows, but I am not sure for other OS.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            installerteam Installer Team
            flamaros Xavier Bigand
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes