Visual Studio 2017/2019 Installation finished with errors – Couldn’t install Microsoft.VisualC.Redist.12

installationvisual c++visual studiovisual studio 2017visual-studio-2019

I have just upgraded from Windows 7 to Windows 10 and I tried installing Visual Studio 2017 professional on my pc and I get the following error:

Couldn't install Microsoft.VisualC.Redist.12

I have tried:

  1. Giving full permissions on both x86 and x64 executables\ and rerun the installation without success
  2. With full permissions and an administrator account running the files outside the installer but I get "Windows cannot access the specified device, path, or file"
  3. Deleting the folders in the C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualC.Redist.12* and repairing multiple times without success.
  4. Complete uninstall and reinstall without success
  5. Completely removed my antivirus application and tried all of the above steps without success
  6. I have repeated the same steps with the installer of vs2019 and I get the same error

Please let me know if you need any further details.

Exact error:

Package ‘Microsoft.VisualC.Redist.12,version=12.0.30501,chip=x86’ failed to install.
Search URL
https://aka.ms/VSSetupErrorReports?q=PackageId=Microsoft.VisualC.Redist.12;PackageAction=Install;ReturnCode=-2147467259
Details
Return code: -2147467259
Return code details: Access is denied

Any help would be greatly appreciated!

Best Answer

  • After multiple experiments mentioned above this is what worked in my case.

    Steps to follow after the Visual Studio Installation fails with a warning:

    1. Download the latest Visual C++ 2013 Redistributables x86 and x64
    2. Install them without restarting Windows
    3. Copy/Replace each of the executables under the following paths: C:\ProgramData\Microsoft\VisualStudio2019\Packages\Microsoft.VisualC.Redist.12,version=12.0.30501,chip=x86 C:\ProgramData\Microsoft\VisualStudio2019\Packages\Microsoft.VisualC.Redist.12,version=12.0.30501.1,chip=x64

    4. Open the Visual studio installer

    5. Select Modify without selecting any additional features

    Once Modify is selected the installation will start, the pasted files will be replaced by a _package.json file and the installation will continue with the rest of the features without any issues.

  • Related Question