During the process of distributing an MSI package to the remote Windows Server 2012 R2 hosts via the Start-Process cmdlet, I ran across an interesting behaviour. In some cases, that MSI package was installed without any issues; in others, it was failing silently generating an event ID 10837 in the Application log.
With the verbose logging enabled, the following error message was observed in the MSI log file:
Installation success or error status: 1603.
The error status 1603 is documented on Microsoft Technet. However, none of those scenarios listed in the article applied to my case. I was able to install that MSI package locally with no issues, and the error popped up randomly when doing installation via PowerShell.
With more testing, I have realised the issue was only popping up when the user account, from which the script was running, had never previously log on to the target system.
I asked one of my colleagues, who has a better understanding of how Windows Installer works, to help with this case. After a thorough investigation, he pointed me to the following lines in the MSI log file:
MSI (s) (2C:C4) [02:22:15:584]: SECREPAIR: New Hash Database creation complete.
MSI (s) (2C:C4) [02:22:15:651]: SECREPAIR: CryptAcquireContext: Could not create the default key container
MSI (s) (2C:C4) [02:22:15:651]: SECREPAIR: Crypt Provider not initialized. Error:-2146892987
MSI (s) (2C:C4) [02:22:15:651]: SECUREREPAIR: Failed to CreateContentHash of the file: installer.msi: for computing its hash. Error: -2146892987
MSI (s) (2C:C4) [02:22:15:651]: SECREPAIR: Failed to create hash for the install source files
MSI (s) (2C:C4) [02:22:15:651]: Note: 1: 2262 2: SourceHash 3: -2147287038
MSI (s) (2C:C4) [02:22:15:651]: SECUREREPAIR: SecureRepair Failed. Error code: 8009034524E29A18
Action start 2:22:15: ProcessComponents.
The requested operation cannot be completed. The computer must be trusted for delegation and the current user account must be configured to allow delegation.
Apparently, in 2014 Microsoft released a security bulletin MS14-049 containing a patch to fix a vulnerability in the Windows Installer service. However, after you install this security update it breaks the MSI package installation. This is documented as a ‘Known issue 1’ in the bulletin and explained in more details here.
To resolve this issue, Microsoft recommends installing update 3000988.
Another option, which is documented in the same bulletin under the ‘Known issue 2’ section, is to opt-out the affected programs by using registry settings. However, this workaround implies more manual work and removes the defence-in-depth security feature for those programs.
I have tested those options and can confirm they both working. Hope this article saves you some time with troubleshooting a similar problem.