Recently I encountered a strange problem when I tried to install an MSI based setup on Windows Vista. I ran through the dialog sequence and clicked the “Install Now” button. The progress bar dialog was displayed as usual, and I left the computer to get a cup of coffee, expecting that the software would be successfully installed when I return.
But to my surprise on my return I was greeted with the “Setup was interrupted before the software was installed” dialog. In the log I found the following entries:
MSI (s) (00:B8) [15:02:24:944]: MSI_LUA: Elevation required to install product, will prompt for credentials
MSI (s) (00:B8) [15:04:59:002]: MSI_LUA: Credential Request return = 0x800704C7
The operation was canceled by the user.
MSI (s) (00:B8) [15:04:59:052]: MainEngineThread is returning 1602
MSI error 1602 means “User cancelled installation” and error code 0x800704C7 translates to “The operation was canceled by the user”. But of course I did not cancel the installation. Michael Urman of Macrovision helped me to understand what was going on, and I was able to reproduce the problem - without coffee ;-)
Some time after the progress bar dialog was displayed, the UAC consent dialog came up and asked me if I wanted to proceed. After two minutes of waiting, the UAC dialog disappeared automatically and the setup was cancelled.
So the UAC Prompt has a 2 minute timeout after which the operation is cancelled automatically without user interaction. This timeout, which I didn’t find documented anywhere, applies to other UAC prompts as well, like control panel actions that require elevation etc.
Unfortunately the return code 0x800704C7 doesn’t indicate whether the operation was cancelled by the user or by the timeout.
Note that there actually was that UAC shield icon on the “Install Now” button, but it was too subtle to make me wait for the UAC dialog. In my tests I have seen delays of more than one minute after the Install Now button was pressed until the UAC dialog came up.
I contacted the Windows Installer team at Microsoft about this problem. Tyler Robinson, the Lead Program Manager, told me that both the MSI team and the UAC team are aware of the issue, but they don’t have a solution at this time. He identified two main factors that are causing the delay:
- System Restore. For compatibility reasons the restore point for the setup is created before the UAC prompt is displayed. Turning off system restore can speed things up.
- Digital signature verification. UAC has to verify the digital signature of the msi package because the UAC dialog has a different banner color and text for setups that have a valid digital signature, as described here. Depending on the size of the .msi file this verification can take a while.
So if you have users complaining that the setup failed unexpectedly on Vista, ask them whether they saw the UAC dialog.