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

Privilege elavation during installation results in "Execute" operation failure

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • 2.0.0
    • 1.5.0
    • General
    • None
    • Windows
    • 94a670a64ab40f4133313484f50e423f82901275

      I'm using the stock 1.5 Windows binary distribution; however, because the installation is executing on a Windows 7 64-bit target (QTIFW-514), the script was customized to ensure the default installation target was in "\Program Files", i.e.:

      function Component()
      {
          if (installer.value("os") === "win") {
              // <ApplicationsDir> maps to "C:\Program Files (x86)" if the installer
              // is 32-bit; so change.
              var appDir = installer.environmentVariable("ProgramW6432");
              if (appDir !== "") {
                  installer.setValue("TargetDir", appDir + "/TheApp")
              }
          }
      }
      

      It appears that this causes the elevation pop-up to appear before installation (which is not surprising, given the target directory); however, this also causes "Execute" operations to fail.

      E.g.: I tried with a simple batch script:

      Component.prototype.createOperations = function()
      {
          // Call default to extract from archive.
          component.createOperations();
      
          if (installer.value("os") === "win") {
              component.addOperation("Execute",
                                     "@TargetDir@/test.cmd");
          }
      }
      

      This fails with the dreaded "Process failed to start: The parameter is incorrect." error. Using addElevatedOperation() (or setting <RequiresAdminRights>) made no difference.

      Reading through similar issues, QTIFW-310 suggests adding a command argument to the Execute call, and this DID fix the issue. So it may be that they originate from the same underlying bug; but I thought it better to document the different cause.

      If the @TargetDir@ is set to point to a 'user' location, the dummy Execute parameter does not appear to be required.

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

            installerteam Installer Team
            chard Richard Hazlewood
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes