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.