Jim Beaumont
Jim Beaumont

Reputation: 117

Visual Studio 2022 Install Failure - Microsoft.VisualCpp.Redist.14;PackageAction=Install;ReturnCode=1921

When attempting to install Visual Studio 2022 (same issue when attempting to install Visual Studio 2019), once the installation gets to a certain point it reports the following:

"Sorry, something went wrong" Couldn't install Microsoft.VisualCpp.Redist.14

Here is the log:

Something went wrong with the install.

You can troubleshoot the package failures by:

  1. Search for solutions using the search URL below for each package failure
  2. Modify your selections for the affected workloads or components and then retry the installation
  3. Remove the product from your machine and then install again

================================================================================ Package 'Microsoft.VisualCpp.Redist.14,version=14.34.31931,chip=x86' failed to install. Search URL https://aka.ms/VSSetupErrorReports?q=PackageId=Microsoft.VisualCpp.Redist.14;PackageAction=Install;ReturnCode=1921 Details Command executed: "c:\windows\syswow64\windowspowershell\v1.0\powershell.exe" -NoLogo -NoProfile -Noninteractive -ExecutionPolicy Unrestricted -InputFormat None -Command "& """C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualCpp.Redist.14,version=14.34.31931,chip=x86\VCRedistInstall.ps1""" -PayloadDirectory """C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualCpp.Redist.14,version=14.34.31931,chip=x86""" -Architecture x86 -Logfile """C:\Users\jbeaumont\AppData\Local\Temp\dd_setup_20221128140210_221_Microsoft.VisualCpp.Redist.14.log"""; exit $LastExitCode" Return code: 1921 Return code details: The name of the file cannot be resolved by the system. Log C:\Users\jbeaumont\AppData\Local\Temp\dd_setup_20221128140210_221_Microsoft.VisualCpp.Redist.14.log Impacted workloads .NET desktop development (Microsoft.VisualStudio.Workload.ManagedDesktop,version=17.4.33006.217,productarch=x64) ASP.NET and web development (Microsoft.VisualStudio.Workload.NetWeb,version=17.4.33006.217,productarch=x64) Impacted components .NET Debugging with WSL (Microsoft.VisualStudio.Component.WslDebugging,version=17.4.33006.217) .NET desktop development tools (Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites,version=17.4.33006.217) .NET profiling tools (Microsoft.VisualStudio.Component.DiagnosticTools,version=17.4.33006.217) ASP.NET and web development prerequisites (Microsoft.VisualStudio.Component.Web,version=17.4.33006.217) ASP.NET and web development prerequisites (Microsoft.VisualStudio.ComponentGroup.Web,version=17.4.33006.217) Azure WebJobs Tools (Component.Microsoft.VisualStudio.Web.AzureFunctions,version=17.4.33006.217) Azure WebJobs Tools (Microsoft.VisualStudio.ComponentGroup.AzureFunctions,version=17.4.33006.217) C# and Visual Basic (Microsoft.VisualStudio.Component.Roslyn.LanguageServices,version=17.4.33006.217) Cloud tools for web development (Microsoft.VisualStudio.ComponentGroup.Web.CloudTools,version=17.4.33006.217) Data sources for SQL Server support (Microsoft.VisualStudio.Component.SQL.DataSources,version=17.4.33006.217) Development tools for .NET (Microsoft.NetCore.Component.DevelopmentTools,version=17.4.33006.217) F# language support (Microsoft.VisualStudio.Component.FSharp,version=17.4.33006.217) F# language support for web projects (Microsoft.VisualStudio.Component.FSharp.WebTemplates,version=17.4.33006.217) Live Share (Component.Microsoft.VisualStudio.LiveShare.2022,version=1.0.5716) Managed Desktop Workload Core (Microsoft.VisualStudio.Component.ManagedDesktop.Core,version=17.4.33006.217) Razor Language Services (Component.Microsoft.VisualStudio.RazorExtension,version=17.4.33006.217) SQL Server Data Tools (Microsoft.VisualStudio.Component.SQL.SSDT,version=17.4.33006.217) Web development tools for .NET (Microsoft.NetCore.Component.Web,version=17.4.33006.217)

Upvotes: 6

Views: 19245

Answers (8)

Stan
Stan

Reputation: 7

I got a similar issue with "Microsoft.VisualCpp.Redist.14", also related to problems with Powershell. In my case, it was the issue that winget package manager somehow was detached from shell. To fix that I run "Add-AppxPackage -Path https://cdn.winget.microsoft.com/cache/source.msix". I found the solution here on github

Upvotes: 0

ChampR
ChampR

Reputation: 782

I had a similar problem, visual c++ 14 x86 had failed to install. Upon inspection of the log it read, Group policy was preventing the installation.

Upon further inquired, my system admin had a policy that prevents application from running windows PowerShell. Similarly, I was not in a position to launch PowerShell from its original path C:\Windows\System32\WindowsPowerShell\v1.0

When the policy was updated, a repair of VS from the installer fixed the issue.

Upvotes: 0

Seoyoon-Scalar
Seoyoon-Scalar

Reputation: 1

This might help.

I was installing Desktop development with C++ via Visual Studio Installer. On the error popup with message Couldn't install Microsoft.VisualCpp.Redist.14.Latest there is View Logs option.

Error log should state: Error opening installation log file. Verify that the specified log file location exists and that you can write to it. Installation log file location should be C:\Users[user]\AppData\Local\Temp. Give everyone rights to Temp folder: right click on the Temp folder -> Properties -> Security tab -> Edit -> Add -> type Everyone -> click on Check Names -> OK -> check Full control -> Apply -> OK -> OK. Error log contains name of the installation log and it should be something like this: dd_setup_xxxxxxxxxxxxxx_001_Microsoft.VisualCpp.Redist.14.Latest.log. xxxxxxxxxxxxxx part should represent date and time ,for example 20220812175204. In the Temp folder find the given installation log file and check if Everyone has full control over it, similarly as previously described. It should be so, but if not, set it yourself. I think each installation try has its own installation log, with specific date and time in installation log's name and Everyone doesn't have full control over that new log, as it is created after full control is given to everyone, but I am not sure. Therefore, failed installation's step should be continued.

Error log contains one more path. That is path to installation file. The path should be something like: C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.VisualCpp.Redist.14.Latest,version=xx.xx.xxxxx,chip=x86. Open that location. There should be an application named something like VC_redist.x86. Run it.

After this, I've run Desktop development with C++ via Visual Studio Installer and it completed successfully.

Reference : https://learn.microsoft.com/en-us/answers/questions/879993/vs-2022-couldnt-install-microsoft-visualcpp-redist

Upvotes: -1

Adishone
Adishone

Reputation: 55

My case: I'm using standard windows account without admin privileges, when I need to install something I just provided admin password. When clicking on show logs I was getting some random folder open and nothing else. Fix:

  1. Relog to admin account and try to repair (same error), but now Show Logs is showing some text files with logs
  2. In the logs it was pointing me to x86 package of Microsoft.VisualCpp.Redist.14. Went there and installed this manually
  3. Try to repair again, same error, but logs now pointed me to x64 package
  4. Installed x64 package manually same as in point 2
  5. Done some restarts when asked to and then went for repair one more time. This time it was successful

Upvotes: 0

Frederic Eid
Frederic Eid

Reputation: 661

I had the same error, and this is how I fixed it:

  1. Download and install both x64 and x86 version of the Microsoft Visual C++ Redistributable package from here.
  2. Restart your PC.
  3. Temporarily disable your antivirus.
  4. From the Visual Studio Installer, repair your Visual Studio Installation. (This will take some time)
  5. Enable your antivirus.

Upvotes: 15

Yotic
Yotic

Reputation: 153

I had error "Microsoft.VisualCpp.Redist.14;PackageAction=Install;ReturnCode=87"

What helped me was moving all files from "C:\Windows\SysWOW64\WindowsPowerShell\v1.0" to "C:\Windows\System32\WindowsPowerShell\v1.0"

Upvotes: 0

Jim Beaumont
Jim Beaumont

Reputation: 117

The offending issue was the following folder: C:\ProgramData\Package Cache

It appears that somehow, this folder was changed from a folder to some sort of symbolic shortcut that was not accessible. It was semi-greyed out with a small arrow icon on the folder icon indicating it was a shortcut. Clicking on it resulted in the error "System is unable to resolve the file". Again, this is a FOLDER, not a FILE.

Anyways, I deleted the "shortcut" and recreated C:\ProgramData\Package Cache as a normal folder and now everything is installing fine.

Upvotes: 1

Albert D. Kallal
Albert D. Kallal

Reputation: 49264

Not sure what unblock is as there is

If you download a file or just about anything?

You as a general rule want to un-block:

That is this option (right click, or now often with win 11, right click and more options). quite sure this un-block security feature been around for some time - at least win 10, and I think even previous editions of windows had this option.

enter image description here

Now, I don't think the above is your issue, but of course it is one of the first things one will do when having downloaded a file.

In fact, for zip files you REALLY have to pay attention to above. For example, if I share some code - and in that zip file some .dll's? they do NOT work unless you un-block before you un-zip. (or un-block each file after un-zipping).

So, the above is quite much a basic skill set you will have when dealing with any downloaded file(s). As I stated, this un-likely is your issue, but since the basic sill set in downloading a file and un-blocking seemed confusing to you, the above basic skill set is quite much part of a survival guide if you going to use the internet and download a file.

Upvotes: 0

Related Questions