none
Locked File or Folder with Visual Studio Installer RRS feed

  • Question

  • I'm having a problem in getting the VS 2017 bootstrap (installer)
    to install on Windows 10.

    HOW IRONIC!

    Actually, I am trying to re-install it after an update failure.

    After waiting until the progress bar almost reaches the end,
    I get the following message:

    ---------------------------------------------------------------------

    Visual Studio

    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.

    Close
    ---------------------------------------------------------------------


    I checked the folder with "IOBit Unlocker" and nothing is locking it.

    I tried rebooting, then immediately running the installer.

    I got the same error.

    I read somewhere that I should delete the Installer folder and try again.


    I opened PowerShell in Administrator mode, and tried the following:

    ---------------------------------------------------------------------

    remove-item   .\Installer -force -recurse

    Get-ChildItem -Path $Destination -Recurse | Remove-Item -force -recurse

    Get-ChildItem -Path $Destination -Recurse -Force | Remove-Item -force -recurse

    $fso = New-Object -ComObject scripting.filesystemobject
    $fso.DeleteFolder("C:\Program Files (x86)\Microsoft Visual Studio\Installer")
    ---------------------------------------------------------------------

    In every case I got "Access to the path is denied" (or something similar).

    How do I delete that F'ing folder, or get VS bootstrapper to install?


    OH BTW ...

    I tried to report a problem using Visual Studio 2017:

    Help > Send Feedback > Report a problem

    When I did that ... NOTHING HAPPENED!!!

    This is seriously FUBAR!

    THANK YOU!

     

    Wally

    Tuesday, June 20, 2017 4:28 AM

All replies

  • Hi Wally,

    Thank you for posting in MSDN forum.

    >>I tried to report a problem using Visual Studio 2017:When I did that ... NOTHING HAPPENED!!!

    After reporting a problem via the Report a Problem , you can track your feedback in the Developer Community portal.

    Back to this issue, if you need the re-installation, pleas remove the existing VS 2017 that install failed before as below:

    1. Go to Control Panel—Programs and Features, if there has ‘Microsoft Visual Studio 2017’, right click it and choose ‘Uninstall’

    2. Try to delete the following installed folders: (you can back up those folders before any modification, in case we need to roll back)

    3. Go to the folder: %ProgramData%\Microsoft\VisualStudio and delete the ‘Packages’ folder and ‘Setup’ folder if there has.

    4. Go to the Visual Studio installation folder (normally under %ProgramFiles(x86)%\Microsoft Visual Studio) and delete the folder ‘2017’

    5. After that, make sure windows update is up-to-date, clean up the %temp% folder and temporarily disable any antivirus software.

    6. Reboot the computer and download the newest VS 2017 RTM installer from download page

    run the installer as administrator again.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 20, 2017 9:30 AM
    Moderator
  • Hi Lana,

    >>>>I tried to report a problem using Visual Studio 2017:When I did that ... NOTHING HAPPENED!!!

    >>After reporting a problem via the Report a Problem , you can track your feedback in the Developer Community portal.

    You don't understand.

    When I said that "NOTHING HAPPENED", I meant that there was no window into which I could type any kind of report.

    I didn't even get a window into which to submit a report.


    >>Back to this issue, if you need the re-installation, pleas remove the existing VS 2017 that install failed before as below:
    >>
    >>1. Go to Control Panel—Programs and Features, if there has ‘Microsoft Visual Studio 2017’, right click it and choose ‘Uninstall’
    >>
    >>2. Try to delete the following installed folders: (you can back up those folders before any modification, in case we need to roll back)
    >>
    >>3. Go to the folder: %ProgramData%\Microsoft\VisualStudio and delete the ‘Packages’ folder and ‘Setup’ folder if there has.
    >>
    >>4. Go to the Visual Studio installation folder (normally under %ProgramFiles(x86)%\Microsoft Visual Studio) and delete the folder ‘2017’
    >>
    >>5. After that, make sure windows update is up-to-date, clean up the %temp% folder and temporarily disable any antivirus software.
    >>
    >>6. Reboot the computer and download the newest VS 2017 RTM installer from download page
    >>
    >>run the installer as administrator again.
    >>

    Is it really necessary to uninstall Visual Studio?

    Let's make sure that you fully understand the situation.

    I have Visual Studio 2017 installed, and it is working fine, and has been for several
    weeks now.

    I was trying to install a template in Visual Studio, via the Visual Studio Installer,
    and the installer wanted to perform an update. I allowed it to do that, and the update
    on the INSTALLER failed (not Visual Studio itself). What I am trying to do is to
    reinstall the INSTALLER (VS bootstrapper), and my trouble is that it will not install
    due to the issues mentioned in my OP.

    Is it really necessary to uninstall Visual Studio itself in order to do that?

    (That would be very time-consuming.)

    Thank you for your response.

    Regards,


    Wally

    Tuesday, June 20, 2017 4:02 PM
  • Hi Wally,

    Thank you for your update and sorry for misunderstanding about the "Reporting a problem".

    If clicking Help | Send Feedback | Report a Problem doesn't pop up any window, seems that VS is not installed well.

    >>Is it really necessary to uninstall Visual Studio itself in order to do that?

    Recently, I meet some community members failed to update via the older VS 2017 installer, lastly they solved it by re-download the newest installer to continue the update.

    If you think the re-installation takes up much time, please directly download the web installer from download page, install the template via the newest installer, after that, re-run the VS 2017  installer as administrator, then click the icon besides 'Launch' and choose 'Repair' to perform a repair.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, June 21, 2017 6:39 AM
    Moderator
  • Hi Lana,

    EDIT: I've solved this problem. It finally came to me that I should try booting in SAFE MODE,
    THEN try to delete the folder that I've mentioned below (and above). I booted in safe mode,
    managed to delete the folder, then I was successful in installing the the Visual Studio setup
    bootstapper.

    Everything is good now.

    Thanks for the responses!

    ==================================

    >>>> Is it really necessary to uninstall Visual Studio itself in order to do that?

    >> Recently, I meet some community members failed to update via the older VS 2017 installer,
    >> lastly they solved it by re-download the newest installer to continue the update.

    That is my problem: I am unable to install the installer.

    Please re-read my original post.


    >> If you think the re-installation takes up much time, please directly download the web installer
    >> from download page, install the template via the newest installer, after that, re-run the VS 2017
    >> installer as administrator, then click the icon besides 'Launch' and choose 'Repair' to perform a repair.

    I've downloaded the Visual Studio setup bootstapper from the link you've provided.

    I right-click on the downloaded file: 'vs_community__1466631082.1496612715 (1).exe'

    Clicked on 'run as adminstrator'.

    Clicked on 'Continue' from the first popup.

    A window pops up with a progress bar, with the message 'Give us a minute. We'll be done soon...'
    above the progress bar.

    The progress bar almost reaches the end, when it stops, and I get the message.

    ---------------------------------------------------------------------

    Visual Studio

    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.

    Close
    ---------------------------------------------------------------------


    Using IOBit Unlocker, I can determine that the folder is not locked by anything else.


    On researching this issue, I read somewhere that I should delete the
    folder that is mentioned within the message:

    'c:\Program Files (x86)\Microsoft Visual Studio\Installer'

    That seems like a good idea: Get rid of the folder that is causing the conflict
    and perhaps the installer will create a new one.


    Another part of the problem is that I am unable to delete that folder.

    Also, I am unable to delete the file 'vs_installer.windows.exe'
    within the sub-folder 'main' within the 'installer' folder:
    "C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\main\vs_installer.windows.exe"


    As I mentioned in my original post:

    I opened PowerShell in Administrator mode, and tried the following
    commands:

    ---------------------------------------------------------------------

    remove-item   .\Installer -force -recurse

    Get-ChildItem -Path $Destination -Recurse | Remove-Item -force -recurse

    Get-ChildItem -Path $Destination -Recurse -Force | Remove-Item -force -recurse

    $fso = New-Object -ComObject scripting.filesystemobject
    $fso.DeleteFolder("C:\Program Files (x86)\Microsoft Visual Studio\Installer")
    ---------------------------------------------------------------------

    In every case I got "Access to the path is denied" (or something similar).

    It would appear that I do not have sufficient permission to delete a folder
    from my own system, even running with an administrator account.


    I right-click on the file 'vs_installer.windows.exe', select 'properties',
    then 'security', then 'Advanced', and I get the message 
    'You do not have permission to view or edit this object's permission settings.'


    This is INSANE!


    Please tell me how to delete that folder,
    with all of the files and folders within it,
    and perhaps the installer will install.


    Alternatively, could you send me an 'installer cleaning tool' of some kind?


    Best Regards,


    Wally


    • Edited by Wally9633 Wednesday, June 21, 2017 11:32 PM Solved the problem
    • Proposed as answer by 宝宝徐Moderator Thursday, June 22, 2017 1:41 AM
    Wednesday, June 21, 2017 5:20 PM
  • Hi Wally,

    Glad to hear that you solved this issue successfully and thank you for sharing your solution here.

    Please mark your reply as answer, it will benefit other community members who face similar question.

    Have a good day:)

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 22, 2017 1:43 AM
    Moderator
  • Hi All,

    I had the same problem at least twice (running VS 2017 on Windows7 64bit), and the following solution worked for me:

    https://stackoverflow.com/questions/45839250/unable-to-update-visual-studio-installer

    Quote: "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."

    It's a bit ironic that the Visual Studio Installer update doesn't work properly.
    "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" is locked - the program which tries to update itself... 

    Best Regards

    Wolfgang

    • Proposed as answer by Krugerrand88 Friday, February 2, 2018 8:08 PM
    Wednesday, December 13, 2017 9:11 AM
  • Thank you! Wolfgang's answer worked for me..
    Monday, May 21, 2018 6:34 AM
  • I just had this problem with update 15.7.2. Wolfgang's answer fixed it for me as well. 
    Wednesday, May 23, 2018 6:51 PM
  • SOLUTION: _  Go to https://www.visualstudio.com/downloads/ and choose the appropriate download installer to update the program. 


    • Proposed as answer by Praful Busa Friday, May 25, 2018 9:29 AM
    • Edited by Praful Busa Friday, May 25, 2018 9:31 AM Keep it short answer
    Friday, May 25, 2018 9:29 AM
  • My VS was/is working fine but I always choose to keep my stuff up to date, so when I tried to update (only 67MB) but I ended up with this error first time, updated before but never had such issue. 

    Problem:- Basically, I had the same problem while I was trying to update my Visual studio (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." )

    SOLUTION: _  Go to https://www.visualstudio.com/downloads/ and choose the appropriate download installer to update the program. 

    PS_ The new latest update was about 67MB but this installer downloaded while installing 2.6GB installation package files. Seems it download entire VS in order to update this. 


    • Proposed as answer by Praful Busa Friday, May 25, 2018 9:31 AM
    Friday, May 25, 2018 9:29 AM
  • Hi All,

    I had the same problem at least twice (running VS 2017 on Windows7 64bit), and the following solution worked for me:

    https://stackoverflow.com/questions/45839250/unable-to-update-visual-studio-installer

    Quote: "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."

    It's a bit ironic that the Visual Studio Installer update doesn't work properly.
    "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" is locked - the program which tries to update itself... 

    Best Regards

    Wolfgang


    THIS IS THE REAL ANSWER
    Saturday, May 26, 2018 1:17 AM
  • Hi All,

    I had the same problem at least twice (running VS 2017 on Windows7 64bit), and the following solution worked for me:

    https://stackoverflow.com/questions/45839250/unable-to-update-visual-studio-installer

    Quote: "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."

    It's a bit ironic that the Visual Studio Installer update doesn't work properly.
    "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" is locked - the program which tries to update itself... 

    Best Regards

    Wolfgang


    THIS IS THE REAL ANSWER
    Thanks! Seems to have done the trick!
    Friday, June 1, 2018 3:26 PM
  • This worked for me. Thanks for sharing this link.
    Monday, June 4, 2018 1:38 PM
  • FYI - hopefully, someone can be helped with my solution.  I simply turned off my Malwarebytes software's protection of my documents and other folders that are protected from malware.  Those folders are locked.  Once I turned that off, then the install went perfectly.  I did not have to uninstall <g class="gr_ gr_312 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" data-gr-id="312" id="312">VS2017,</g> or delete any folders and files.  Thus, my solution is to temporarily turn off the very tight protection provided by Malwarebytes.

    Cheers,

    Tomas Hood

    • Proposed as answer by IgorDRTZ Wednesday, June 13, 2018 9:16 AM
    Wednesday, June 13, 2018 2:44 AM
  • FYI - hopefully, someone can be helped with my solution.  I simply turned off my Malwarebytes software's protection of my documents and other folders that are protected from malware.  Those folders are locked.  Once I turned that off, then the install went perfectly.  I did not have to uninstall <g class="gr_ gr_312 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" data-gr-id="312" id="312">VS2017,</g> or delete any folders and files.  Thus, my solution is to temporarily turn off the very tight protection provided by Malwarebytes.

    Cheers,

    Tomas Hood

    Thanks, that solved the problem to me too
    Wednesday, June 13, 2018 9:17 AM
  • Ty this was really the problem

    In my <g class="gr_ gr_78 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" data-gr-id="78" id="78">case</g> it was MBAM (Malwarebytes)

    Saturday, June 16, 2018 6:03 AM
  • Perfect!
    Thursday, July 5, 2018 4:53 PM
  • FYI - hopefully, someone can be helped with my solution.  I simply turned off my Malwarebytes software's protection of my documents and other folders that are protected from malware.  Those folders are locked.  Once I turned that off, then the install went perfectly.  I did not have to uninstall <g class="gr_ gr_312 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep" data-gr-id="312" id="312">VS2017,</g> or delete any folders and files.  Thus, my solution is to temporarily turn off the very tight protection provided by Malwarebytes.

    Cheers,

    Tomas Hood

    THANK YOU !!!

    Malwarebytes is the bad guy in this scenario (at least for me).

    Disabled Malwarebytes and Installer did its self-update without any problems.

    Tuesday, July 10, 2018 8:31 PM
  • I ran into this same issue when trying to update from the 15.7.4 release to the 15.7.5 release of VS2017. I was able to get around the problem by using the solution mentioned above of renaming the installer folder. I also happen to be running Malwarebytes. That seems to be a common theme in several of the previous replies. I did not disable Malwarebytes before running the update of the VS installer. Just renaming the original folder did the trick.

    I also ended up having to shut down the installer after it finished updating itself before I was able to delete the renamed installer folder. It took a few attempts, but I was finally able to clean things up. After that, I started the VS installer again and now it is about halfway done updating VS2017.

    Hope this helps others.

    Wednesday, July 11, 2018 1:29 AM
  • That did the trick. Thanks :)
    Wednesday, July 11, 2018 11:20 AM
  • Hi All,

    I had the same problem at least twice (running VS 2017 on Windows7 64bit), and the following solution worked for me:

    https://stackoverflow.com/questions/45839250/unable-to-update-visual-studio-installer

    Quote: "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."

    It's a bit ironic that the Visual Studio Installer update doesn't work properly.
    "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" is locked - the program which tries to update itself... 

    Best Regards

    Wolfgang

    This solution worked for me as well
    Monday, July 16, 2018 3:12 AM
  • I solved this problem in the following way:

    1. When I tried to update from VS 2017 15.6 to VS 2017 15.7 I got the message:
    Unable to install the files to target location. Error: The folder'c:\Program Files (x86)\Microsoft Visual Studio\Installer' or a filewithin it is locked by another program. Close any applications thatmight be using it and try again

       2. What I did was rename the "C:\Program Files (x86)\Microsoft Visual Studio\Installer" folder to another name, for instance, "Installer_BAK".

       3. Then I search for "Visual Studio Installer" app and execute it.  All went well after this.

       4. Done.


    Orney

    Thursday, July 19, 2018 6:53 PM
  • I solved this problem in the following way:

    1. When I tried to update from VS 2017 15.6 to VS 2017 15.7 I got the message:
    Unable to install the files to target location. Error: The folder'c:\Program Files (x86)\Microsoft Visual Studio\Installer' or a filewithin it is locked by another program. Close any applications thatmight be using it and try again

       2. What I did was rename the "C:\Program Files (x86)\Microsoft Visual Studio\Installer" folder to another name, for instance, "Installer_BAK".

       3. Then I search for "Visual Studio Installer" app and execute it.  All went well after this.

       4. Done.


    Orney

    Same with one of my systems.  When if checked the Installer folder I found, and recalled I had to do this before and again this time to update the installer.
    Sunday, August 19, 2018 7:01 PM
  • Same solution worked for me.

    I have deleted  "C:\Program Files\Microsoft Visual Studio\Installer" Folder, and installation went fine.

    • Proposed as answer by mkarpinski Friday, January 4, 2019 4:15 PM
    • Unproposed as answer by mkarpinski Friday, January 4, 2019 4:15 PM
    Saturday, November 17, 2018 7:25 AM
  • Hi, non of the above suggestion worked for me. I even tried unpacking the installer, checking logs from Collext.exe, but there is no error.
    I even tried running procmon.exe to see what is happening with the file itsef but I couldn't find anything unusual.

    The installer program just doesn't run

    MK

    Friday, January 4, 2019 4:25 PM