Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How could we detect users vcredist installed when using Qt Installer Framework
Forum Update on Monday, May 27th 2025

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

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
5 Posts 5 Posters 2.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • jiancaiyangJ Offline
    jiancaiyangJ Offline
    jiancaiyang
    wrote on last edited by
    #1

    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.

    我们自己的论坛:http://qtdream.com
    擅长三维角色仿真动画。

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      2
      • L Offline
        L Offline
        Laurent Schall
        wrote on last edited by Laurent Schall
        #3

        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)

        1 Reply Last reply
        0
        • I Offline
          I Offline
          iieklund
          wrote on last edited by
          #4

          @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");
          }
          
          1 Reply Last reply
          0
          • S Offline
            S Offline
            SecondFlight
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved