Help installing SQL Server 2017 - VS Shell installation has failed with exit code 1638

I experienced this problem as well with SQL Server 2017 Developer and it appears to be just bad planning on the part of the SQL Server installation package people. The problem is that Visual Studio 2017 installs the Microsoft Visual C++ 2017 Redistributable (x86) and (x64) and the SQL Server installation tries to install the Microsoft Visual C++ 2015 Redistributables, which it can't because the SQL Server installation doesn't allow you to install an older version with the newer version installed.

This Microsoft Support article presents their explanation of the problem, and their recommended workarounds.

Solution 1: Install SQL Server first before installing Visual Studio 2017.

Solution 2 (what I did):

  1. Uninstall the Microsoft Visual C++ 2017 Redistributable (x86) and (x64),
  2. install SQL Server,
  3. then reinstall the Microsoft Visual C++ 2017 Redistributable (x86) and (x64).

They are a little hard to find, so here are the direct links:

X64: https://go.microsoft.com/fwlink/?LinkId=746572

x86: https://go.microsoft.com/fwlink/?LinkId=746571

Note: If you don't have Microsoft Visual C++ 2017 Redistributable installed at all, just install it from one of the above links, and retry installing SQL Server. It should work now.


You may have to repeat these steps when installed additional named instances of SQL Server 2017.


I had the same problem but I was upgrading from SQL Server 2016.

I uninstalled Microsoft Visual C++ 2015 Redistributable, both the x86 & x64, then it upgraded successfully.


I got the error when trying to repair my SQL Server 2017 installation. I found this link VC++ 2015 Redistributable installation returns error 1638 when newer version already installed, which says the issue is fixed in Cumulative Update 13 for SQL Server 2017.

It worked; I applied the update then ran the repair, and it finished without an error.