Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Install local user update due to \\bin folder being used by another process #60697

Open
BryanWilhite opened this issue Oct 11, 2018 · 97 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug install-update VS Code installation and upgrade system issues windows VS Code on Windows issues
Milestone

Comments

@BryanWilhite
Copy link

image

There was an error while deleting a directory: %LOCALAPPDATA%\Programs\Microsoft VS Code\bin: the process cannot access the file because it is being used by another process…

  • VSCode Version: 1.2.7.2 (user setup)
  • OS Version: Windows 10

Steps to Reproduce:

  1. when an update is available, click Install Update

Does this issue occur when all extensions are disabled?: cannot try this because installation is disabled/destroyed due to incomplete setup

Workaround: will go back to system installs instead of local user installs.

@vscodebot vscodebot bot added the install-update VS Code installation and upgrade system issues label Oct 11, 2018
@joaomoreno joaomoreno changed the title VS Code local-user install cannot update: error while deleting a directory %LocalAppData% Can't update due to \\bin folder Oct 15, 2018
@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug windows VS Code on Windows issues labels Oct 15, 2018
@joaomoreno joaomoreno added this to the October 2018 milestone Oct 15, 2018
@joaomoreno
Copy link
Member

@sergiusignacius Can reliably reproduce this. Will check with him asap.

@BryanWilhite BryanWilhite changed the title Can't update due to \\bin folder Can't Install local user update due to \\bin folder being used by another process Oct 15, 2018
@bookiu
Copy link

bookiu commented Oct 18, 2018

image

I had the same question, every time I update vscode(Windows 10 with user setup), I got this error.

@snebjorn
Copy link

snebjorn commented Oct 18, 2018

Same issue here.

I'm not even able to delete %LOCALAPPDATA%\Programs\Microsoft VS Code\bin manually :/

@snebjorn
Copy link

I tried disabling all Anti Virus/Protection software running on the system and the self-updater still fails.

@joaomoreno
Copy link
Member

OK. I was able to repro this in @sergiusignacius's machine. Weirdly enough, it repros 100% of the time when Skype for Business is running. It doesn't repro when Skype for Business isn't running.

Any of you guys have Skype for Business?

Investigating...

@snebjorn
Copy link

Any of you guys have Skype for Business?

I do

@joaomoreno
Copy link
Member

If you shutdown Skype for Business, does update work?

@snebjorn
Copy link

If you shutdown Skype for Business, does update work?

It works!

Though I had to kill Skype for Business from the task manager as quitting wasn't enough.

@joaomoreno
Copy link
Member

OK, great to know. Investigating...

@joaomoreno joaomoreno modified the milestones: October 2018, November 2018 Nov 1, 2018
@shingoxray
Copy link

I have the same problem. Quit or kill Skype for Business not working.

@carlocardella
Copy link
Member

I don't have skype installed on this particular laptop (but I do have Teams) and I started to experience this problem a couple of days ago. Looking at processes with handle open on that file/folder structure I only see the Insiders update processes:

image

@joaomoreno
Copy link
Member

@carlocardella Your issue is another one: #47841

@joaomoreno joaomoreno modified the milestones: November 2018, Backlog Dec 6, 2018
This was referenced Dec 14, 2018
@timheuer
Copy link
Member

So what’s the ultimate resolution here? Seems like perhaps Skype may be the issue? Is there a working discussion with resolving this for that class of users for user install? Or just don’t do it? And should there be a published warning pre-user install to avoid it?

@ScottHT
Copy link

ScottHT commented Dec 18, 2019

Closing Citrix Receiver and Connection Manager fixed it for me.

@Juslotting
Copy link

Shutting down f.lux solved this issue for me.

@Ahmdrza
Copy link

Ahmdrza commented Mar 11, 2020

Getting same issue now. Closing adobe creative cloud and slack fixed it for me.

@thorpep138
Copy link

thorpep138 commented Mar 18, 2020

Getting the same issue, none of the above solutions are working for me.

@AndyCross
Copy link

Closed down a variety of apps until it eventually works.

  • Office 365 inc Outlook
  • printer helper (PaperCut)
  • "My Phone" phone helper

@echuber2
Copy link

echuber2 commented Mar 20, 2020

Someone try using Process Explorer as administrator to see what's locking the directory: https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer

@Sean-93
Copy link

Sean-93 commented Mar 20, 2020

This happens to me every time I close VS Code- it starts to update, fails, and then uninstalls VS Code. I have none of the previous programs mentioned that may interfere, and am on a Windows 10

@lkusam
Copy link

lkusam commented Mar 25, 2020

I am having the same issue. Need to re-install VS code 3 times. At least it keeps the settings and the extensions. @echuber2 I am not expert in using the process explorer. Below is the screenshot of what is see when I searched for code.

process_screenshots

@LuamMaul
Copy link

[SOLVED] I had same issue, but with '\resources' folder. What I did to solve was install IObit Unlocker Software and when the error happen, I use the IObit to unlock & delete the folder and than I "Retry" the update process. After this, another issue appears, but now says "can't rename 'code.exe' file", so I used IObit again to rename the 'code.exe' to 'code.exe' (same name, I don't know why) and "Retry" again. Finally it's works! Updated succesfully.

@81mark
Copy link

81mark commented Apr 10, 2020

I found what was causing it by more research, Have a look at antivirus protection software you may have and look for ransomware protection or exploit protection and temporarily disable them. As in my case, it was locking the folders to make sure viruses could not change or delete folders! All good now, hope it helps others!

@ntdkhiem
Copy link

wow @81mark, thanks for your advice. It actually worked for my machine !!. I tried different methods above but could not solve the issue. I turned off malware byte ransomware protection and exploit protection and it worked!

@81mark
Copy link

81mark commented Apr 10, 2020

wow @81mark, thanks for your advice. It actually worked for my machine !!. I tried different methods above but could not solve the issue. I turned off malware byte ransomware protection and exploit protection and it worked!

No problem, glad it helped you out!

@AakarshitAgarwal
Copy link

There was an error while Deleting a directory
"C*\******\AppData\Local\Programs\Microsoft VS Code\bin":
The process cannot access the file because it is being used by another process, (os error 32)
Please verify there are no Visual Studio Code processes still executing,

This happens to me every time I close VS Code- it starts to update, fails, and then uninstalls VS Code. I have none of the previous programs mentioned that may interfere, and am on a Windows 10 ,moreover after using Setup for vs code again for installation it is happening again.

@lkusam
Copy link

lkusam commented May 3, 2020

I don't know what happened. But when I was re-installing after the code failed to install I choose install a system instead of user and that fixed the issue

@Pangeranmw
Copy link

[SOLVED] I had same issue, but with '\resources' folder. What I did to solve was install IObit Unlocker Software and when the error happen, I use the IObit to unlock & delete the folder and than I "Retry" the update process. After this, another issue appears, but now says "can't rename 'code.exe' file", so I used IObit again to rename the 'code.exe' to 'code.exe' (same name, I don't know why) and "Retry" again. Finally it's works! Updated succesfully.

@LuamMaul thanks bro it worked.. i just unlock \bin folder using IObit unlocker.. then delete the \bin folder, the last, i click the retry button on the error notifications..

@Daca212
Copy link

Daca212 commented May 15, 2020

First Uninstall Visual Studio, then go to https://code.visualstudio.com/docs/setup/windows and download Visual Studio via Zip archive link.

zip
image

Move it and extract it in a new folder located wherever you prefer. Run VS. Since is another folder it shouldn't cause any trouble.

@hugo-chan
Copy link

Ending Zoom and Microsoft Word worked for me

@kclaka
Copy link

kclaka commented May 16, 2020

Turning off Malware Bytes seems to solve this error as recommended by @81mark

@FaisalAslam097
Copy link

Had the same issue, Here is the solution.

  1. go the directory where VS code is installed i.e User/ Program/VS Code
  2. run the uninstall.exe
  3. install vscode again

@guardrex
Copy link

guardrex commented Dec 17, 2021

It might be the virus scanner in my case as well, but this is an EVERY install/update PITA for me, too. For me ... at least for this morning's update ... it's the resources folder ...

Capture

Capture1

... and the log file indicates ...

Dec 17 07:43:41.512 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\bin" (attempt 1)
Dec 17 07:43:41.514 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\locales" (attempt 1)
Dec 17 07:43:41.515 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 1)
Dec 17 07:43:41.693 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 2)
Dec 17 07:43:41.901 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 3)
Dec 17 07:43:42.361 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 4)
Dec 17 07:43:43.162 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 5)
Dec 17 07:43:44.425 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 6)
Dec 17 07:43:46.242 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 7)
Dec 17 07:43:48.699 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 8)
Dec 17 07:43:51.906 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 9)
Dec 17 07:43:55.961 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 10)
Dec 17 07:44:00.964 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 11)
Dec 17 07:44:05.600 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 1)
Dec 17 07:44:05.666 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 2)
Dec 17 07:44:05.871 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 3)
Dec 17 07:44:06.335 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 4)
Dec 17 07:44:07.146 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 5)
Dec 17 07:44:08.404 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 6)
Dec 17 07:44:10.219 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 7)
Dec 17 07:44:12.679 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 8)
Dec 17 07:44:15.895 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 9)
Dec 17 07:44:19.948 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 10)
Dec 17 07:44:24.956 INFO Delete directory recursively: "C:\\Program Files\\Microsoft VS Code\\resources" (attempt 11)
Dec 17 07:44:48.448 ERRO Access is denied. (os error 5)

I really, really wish a permanent fix could be made to the installer process to resolve this once and for all. 😩

@erod550
Copy link

erod550 commented Mar 5, 2022

Having same issue every time VS Code gets an update. It tries to auto-update, fails, and corrupts itself and forces me to do a full manual uninstall/reinstall every time. Extremely frustrating.

@MrMichaelJKelly
Copy link

I stopped a bunch of stuff running on my machine (Slack, Chrome) and crap I didn't even know I had (who the hell gave HP permission to install a service for "HPScanAndPrintDoctor" that is set to start automatically because I once had to troubleshoot a printer on this machine - have these guys ever heard about security surface area?) - and don't get me started on Adobe, they are the worst...

Anyway, stopped a bunch of crap but still got the error.

Only workaround seems to be uninstall / reinstall which is a bummer.

image

1 similar comment
@MrMichaelJKelly
Copy link

I stopped a bunch of stuff running on my machine (Slack, Chrome) and crap I didn't even know I had (who the hell gave HP permission to install a service for "HPScanAndPrintDoctor" that is set to start automatically because I once had to troubleshoot a printer on this machine - have these guys ever heard about security surface area?) - and don't get me started on Adobe, they are the worst...

Anyway, stopped a bunch of crap but still got the error.

Only workaround seems to be uninstall / reinstall which is a bummer.

image

@ryan-feeley
Copy link

I just experienced this issue. I think what happened is I have vscode installed in my user account. I launched it from an elevated powershell instance. It did various updating while in that status, and somehow mucked with the file permissions. Then subsequent attempts to update with regular user-permissions all failed and/or hung. There's a bug in there somewhere, and perhaps uninstall/reinstall is the only solution.

@rsuriano
Copy link

I fixed this by running VS Code with admin privileges, then closing it and it auto updated almost instantly.

@mikecann
Copy link

Ye it seems like it needs to run as administrator.

Pro tip if you right click a VSCode shortcut (could be the pinned version in taskbar for example) you can tell it to always run in administrator mode.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug install-update VS Code installation and upgrade system issues windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests