How could we detect users vcredist installed when using Qt Installer Framework



  • I am using Qt Installer Framework. I use MSVC 2015 as compiler to build our product.
    Then when installing on target machine, vcredist_x86.msi will be installed too, but I need to know whether client has installed vcredist bundle so that not to bother client.


  • Moderators

    It's not a direct answer to your question but you can install the redist in quiet mode (the /install /quiet switches) so it won't bother the user and it will do nothing if it's already installed.



  • the /install /quiet switches are working fine unless the host is already containing a newer version of the redistributables. In this case vcredist will fail with error 1638 that should be ignored - the problem is that there is no switch to ignore automatically when this error shows up - so users might face that.![alt text](0_1559049441899_b3e2af5d-4d5a-49ca-af61-2e9c8e0ac17f-image.png image url)



  • @Laurent-Schall said in How could we detect users vcredist installed when using Qt Installer Framework:

    gnore automatically when this error shows up - so users might face that.![alt tex

    Would this help you?

    Component.prototype.createOperations = function()
    {
        // Call the base createOperations and afterwards set some registry settings
        // so that the simulator finds its fonts and applications find the simulator
        component.createOperations();
    
        // return value 3010 means it need a reboot, but in most cases it is not needed for running Qt application
        // return value 5100 means there's a newer version of the runtime already installed
        component.addElevatedOperation("Execute", "{0,3010,1638,5100}", "@TargetDir@\\vcredist\\vcredist_x64.exe", "/norestart", "/q");
    }
    


  • You can add this to the Controller() function in your installer script:

    function Controller() {
        installer.setMessageBoxAutomaticAnswer("installationErrorWithRetry", QMessageBox.Ignore);
        installer.setMessageBoxAutomaticAnswer("installationError", QMessageBox.Ignore);
    }
    

    This will automatically click "ignore" on the message box that comes up when the Visual C++ redistributable is already installed.

    See the docs for more info.


Log in to reply