VS Shell installation has failed with exit code 1638

-> SQL Server 2016 installation failed with below error,

TITLE: Microsoft SQL Server 2016 Setup
The following error has occurred:
VS Shell installation has failed with exit code 1638.

For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=13.0.5026.0&EvtType=0x5B39C8B9%25401434%25403

-> In my case, all components completed fine except Integration Services. Below was the error found during setup for Integration services,

Action required:
Use the following information to resolve the error, and then try the setup process again.
Feature failure reason:
An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Error details:
§ Error installing Microsoft Visual C++ 2015 Redistributable
VS Shell installation has failed with exit code 1638.
Error code: 1638
Log file: C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20191119_153017\VCRuntime140_x64_Cpu64_1.log
Visit http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=13.0.5026.0&EvtType=VCRuntime140_x64%40Install%400×1638 to get help on troubleshooting.
Product Update:
Product Update has successfully applied KB 4052908 <http://support.microsoft.com/?id=4052908&gt;. These updates have set the patch level of the Setup operation to 13.2.5026.0.

-> Above error is pretty clear that it is not able to install Microsoft Visual C++ 2015 Redistributable.

-> Details.txt contained below message/error,

(04) 2019-11-19 15:42:11 Slp: The directory monitor thread is interrupted due to the following exception while monitoring the notifications for directory ‘C:\Program Files\Microsoft SQL Server\’
(04) 2019-11-19 15:42:11 Slp: The following is an exception stack listing the exceptions in outermost to innermost order
(04) 2019-11-19 15:42:11 Slp: Inner exceptions are being indented
(04) 2019-11-19 15:42:11 Slp:
(04) 2019-11-19 15:42:11 Slp: Exception type: Microsoft.SqlServer.Configuration.Sco.MonitorThreadInterruptedException
(04) 2019-11-19 15:42:11 Slp: Message:
(04) 2019-11-19 15:42:11 Slp: The directory monitor thread is interrupted. Message: ‘The directory monitor thread is interrupted due to a StopMonitor call.’
(04) 2019-11-19 15:42:11 Slp: HResult : 0x86a40016
(04) 2019-11-19 15:42:11 Slp: FacilityCode : 1700 (6a4)
(04) 2019-11-19 15:42:11 Slp: ErrorCode : 22 (0016)
(04) 2019-11-19 15:42:11 Slp: Data:
(04) 2019-11-19 15:42:11 Slp: ErrorMessage = The directory monitor thread is interrupted due to a StopMonitor call.
(04) 2019-11-19 15:42:11 Slp: WatsonData = Microsoft.SqlServer.Configuration.Sco.MonitorThreadInterruptedException@22
(04) 2019-11-19 15:42:11 Slp: Stack:
(04) 2019-11-19 15:42:11 Slp: at Microsoft.SqlServer.Configuration.Sco.DirectoryMonitor.Monitor()

-> Tried this article. But Integration Services installation failed again with same error.

-> Checked Add/Remove programs for list of “Microsoft Visual C++ ….” installation and I could see Visual C++ 2013, 2015, 2017 Redistributable  installed.

-> I was installing SQL Server 2016 on a new server with no other SQL Server instances. So i thought of uninstalling Microsoft Visual C++ 2015, 2017 Redistributable both X64, X86 and start the install again. But, I couldn’t uninstall from Add/Remove programs.

-> When I click on Microsoft Visual C++ 2015, 2017 Redistributable and clicked on Modify or Uninstall, nothing happened. Couldn’t see any uninstall/Modify dialog box coming up. I even tried that after restarting the server, but no luck.

-> Executed below from administrative command prompt.

"C:\ProgramData\Package Cache\{80586c77-db42-44bb-bfc8-7aebbb220c00}\VC_redist.x64.exe" /uninstall

"C:\ProgramData\Package Cache\{3ee5e5bb-b7cc-4556-8861-a00a82977d6c}\VC_redist.x64.exe" /uninstall

"C:\ProgramData\Package Cache\{206898cc-4b41-4d98-ac28-9f9ae57f91fe}\VC_redist.x86.exe" /uninstall

"C:\ProgramData\Package Cache\{6c6356fe-cbfa-4944-9bed-a9e99f45cb7a}\VC_redist.x64.exe" /uninstall

-> Please note that, I performed above action as this was a new database server and had no worries of any existing SQL Server instances.

-> Rebooted the server and performed the SQL Server Integration Services install again and this time it installed just fine.

Thank You,
Vivek Janakiraman

The views expressed on this blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights.