3

I've been having trouble when updating Visual Studio Code. Whenever I try to update there are files in the resource directory that are locked and block the installation. The installation is not rolled back but is corrupted. This happens whether I use either the system or user installer. I can't delete the files even with Administrator permissions and I have to do a lot of manual work including rebooting the computer to remove the corrupted installation.

If there are files that continue to be used by some process the process has no recognizable name. On the latest upgrade attempt the following files are locked :

\resources\app\out\vs\platform\files\node\watcher\win32\CodeHelper.exe \resources\app\node_modules.asar.unpacked\vscode-ripgrep\bin\rg.exe 

This is in my personal AppData directory, not a system directory. I need to log off and back in again before I can delete these files and do a clean install.

I have Windows Defender and Malwarebytes running on this computer.

This is driving me nuts since it is ruining the experience of using an otherwise great product. There are too many updates for this to be endured. Any advice or ideas would be greatly appreciated.

3
  • 1
    I personally use a portable (installation is not needed) version and I never had any problems with it. Sometimes, this is because of privileges on some of your folders that could have been changed. Try changing permissions on the folders you have problems with. Commented Apr 8, 2020 at 21:07
  • When I try to alter permissions (believe me I tried) I get a message that I don't have permission to do so despite the fact that the owner of the directory is me and I have full administrative permissions. This is for the user installation. For the last upgrade I was forced to reboot in safe mode to remove the files. Commented Apr 9, 2020 at 13:39
  • There is some problem with your machine and I had similar issue with old laptop due to some virus. But not sure what is the reason in your case. Commented Apr 22, 2020 at 10:54

4 Answers 4

3

I heard back from the Visual Studio Code issues board on GitHub. I was able to solve my problem by turning off a setting called "Update: Enable Windows Background Updates" (update.enableWindowsBackgroundUpdates)

After unchecking this setting I was able to update normally. I don't know if this will work for everyone but so far it's working for me.

Sign up to request clarification or add additional context in comments.

Comments

1

For me, the issue was that I had a Windows update installed but waiting for a reboot, and I believe that held up the Visual Studio code update. Try just restarting your system.

In summary:

  • Reboot your system

(3 months later, I got the same issue, and had to use the same solution)

Comments

0

In my case, my anti-virus software was blocking the removal of an executable deep in the VS Code installation directory (rg.exe).

Temporarily disabling the anti-virus allows the updater to complete.

The issue looks superficially as if permissions are incorrect on one or more files/folders in the VS Code installation directory but this is not the underlying issue and trying to change permissions or take ownership will not solve the issue.

Comments

0

I have had this issue several times (it occurs every few months when there is a VS code update), logged here: vscode fails to install because of rg.exe

I have made a number of attempts, all of which fail. As per the OP, i am the Admin and have full rights but am unable to delete the file (have tried several ways: killing task in Task manager, delete file via CMD prompt etc).

The only way, so far, is to reboot the PC and then install a new version...

It is rather annoying to say the least. The other option is to migrate to another editor that does not have this issue (pycharm).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.