Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Installer Framework and execution



  • Hello!
    I study how Installer Framework works and found the following thing: during the installation I have tried to install C++ redistributable and it was successfully done. The following code in installscript.qs does the job:

    // Check if redistributable is installed
    var registryVC2017x64 = installer.execute("reg", new Array("QUERY", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x64", "/v", "Installed"))[0];
    
    if (!registryVC2017x64) {
    	component.addElevatedOperation("Execute", "@TargetDir@/vc_redist.x64.exe", "/passive", "/norestart");
    }
    

    Then I have tried to install more: I took libusb-win32 driver that has been generated with the wizard:

    component.addElevatedOperation("Execute", "@TargetDir@/Driver/InstallDriver.exe");
    

    Driver's installer window opens, installation goes successful as well, but then I receive the following error:

    Error during installation process (myPackage):
    Execution failed (Unexpected exit code: 256): "PathToInstallDriver"
    

    So my question is: can I somehow process return codes of executions in installscript.qs. Or should I do something with executable (driver installer in my case) to return correct code?



  • @St-Stanislav I have found the same topic with no solution:
    https://forum.qt.io/topic/56816/qt-ifw-addoperation-reporting-error
    And something similar here:
    https://forum.qt.io/topic/101441/how-can-i-detect-the-addoperation-error-in-installer-script

    I have opened the appropriate bug ticket in libusb-win32 branch, but anyway there should be some way to check and process exit statuses in QInstaller.


Log in to reply