How to ignore vc_redist error 1638?
-
Using QIFW 4.8 for Windows when attempting to install a vc_redist an error 1638 is produced if the machine already has a more recent version installed and this message is displayed in an error box that requires the user to click one of the buttons.
The documentation and other messages on this forum seem to indicate that the message box can be automatically dismissed by some combination of
installer.autoAcceptMessageBoxes()
orinstaller.autoRejectMessageBoxes()
andinstaller.setMessageBoxAutomaticAnswer(...)
. However I can't get this to work.The message box produced by the installer has "Retry", "Ignore" and "Cancel" options so I figure that one of the following would suffice since they are the only message box types that have these three options.
installer.setMessageBoxAutomaticAnswer("installationErrorWithRetry", QMessageBox.Ignore); installer.setMessageBoxAutomaticAnswer("stopProcessesForUpdates", QMessageBox.Ignore);
however that doesn't seem to have any effect.
Adding
installer.autoRejectMessageBoxes()
causes cancellation and rollback while addinginstaller.autoAcceptMessageBoxes()
seems to cause automatic activation of "Retry" and it gets stuck in a loop that can only be exited by clicking cancel, which rolls back the installation.What am I doing wrong here? And how can this be made to work?
-
It turns out that the required name is not listed in the documentation. The following gets the expected result:
installer.setMessageBoxAutomaticAnswer("installationErrorWithCancel", QMessageBox.Ignore);
I discovered this by inspecting the source and knowing how it works I see that the clue for this is this line in the log:
installationErrorWithCancel : Installer Error : Error during installation process (com.microsoft.vcredist):
-