Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to update visual studio installer

Wanted to add this question to the pool in case someone has the same problem

I was unable to update Visual Studio 2017 on Windows 7 and got the following error:

Unable to install the files to target location. Error: The folder 'c:\Program Files (x86)\Microsoft Visual Studio\Installer' or a file within it is locked by another program. Close any applications that might be using it and try again.

like image 830
Janspeed Avatar asked Aug 23 '17 12:08

Janspeed


People also ask

Why is Visual Studio installer not installing?

Please go to Windows Update, ensure that all recommended Windows Updates are installed and completed, then reboot your PC. (Open Windows Settings ( Windows + I ) -> Go to Update & Security > Troubleshoot.

How do I fix Visual Studio installer has stopped working?

Please remove the folder: C:\Program Files (x86)\Microsoft Visual Studio\Installer. Then, re-download the bootstrapper file from the following Microsoft Site and run it as administrator. If the answer is helpful, please click "Accept Answer" and upvote it.


2 Answers

The initial solution I found was to reinstall Visual Studio but felt that it might be unnecessary. The solution I found was to close down visual studio, go to "c:\Program Files (x86)\Microsoft Visual Studio\Installer", rename the folder "Installer" to something else then run vs_installer.exe from the renamed folder.

Hope that help someone.

like image 80
Janspeed Avatar answered Oct 15 '22 13:10

Janspeed


I just recently encountered the same error while trying to update the Visual Studio 2017 installer on Windows 10. In my case, the c:\Program Files (x86)\Microsoft Visual Studio\Installer directory was locked because of virus/malware scanning software running in the background. After stopping that, the installation of the VS 2017 installer had no more problems.

What initially misled me about the source of the problem was that the process which had a lock on the files in that directory was the special System process in Process Explorer, so I was initially going down the wrong rabbit hole.

like image 27
porcus Avatar answered Oct 15 '22 13:10

porcus