See the question and my original answer on StackOverflow

It turns out waiting (patiently :-)) for the next version of the Visual Studio Installer seems to have fixed the problems.

Also, Microsoft has a troubleshooting page available here: Troubleshooting Visual Studio 2017 installation and upgrade failures. I will quote the most important (a.k.a not obvious) parts for future reference:

1) Try to delete Visual Studio Installer data to remove corrupted files:

The Visual Studio Installer bootstrapper is a minimal light-weight executable that installs the rest of the Visual Studio Installer. Deleting Visual Studio Installer files and then rerunning the bootstrapper might solve some upgrade failures. To do this, follow these steps:

  • Close the Visual Studio Installer.
  • Delete the Visual Studio Installer packages and MDA folders to remove potentially corrupted downloaded files if they exist. Typically, these directories are C:\ProgramData\Microsoft\Visual Studio\Packages.
  • Run the Visual Studio Installer bootstrapper. You may find the bootstrapper in your Downloads folder with a file name that follows a vs_[Visual Studio edition]__*.exe pattern. If you don't find that application, you can download the bootstrapper by going to the Visual Studio downloads page and clicking download for your edition of Visual Studio. Run this executable to reset your installation metadata.
  • Try to install or update Visual Studio again. [...]. Note This step will reinstall Visual Studio Installer files and reset installation metadata.

2) As a last resort, you can run InstallCleanup.exe.

InstallCleanup.exe is a utility that's packaged with the Visual Studio Installer, and it cleans up installation files. This isn't a full reinstall. This utility deletes cache and instance data for Visual Studio 2017 and deletes existing corrupt, partial and full instances of Visual Studio 2017.

  • Close the Visual Studio Installer.
  • Open an administrator command prompt. To do this, follow these steps:
  • On the Start menu, click Run (Start + R).
  • Type cmd.
  • Right-click Command Prompt, and then choose Run as administrator.
  • Type the full path of the InstallCleanup.exe utility, and pass the following command line switch: -f. By default, the path of the utility is as follows: C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\layout\InstallCleanup.exe
  • Rerun the bootstrapper that's described in 1)
  • Try to install or update Visual Studio again.