Team Alpha Vantage
Team Alpha Vantage

Reputation: 61

Visual Studio Code updating woes

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.

Upvotes: 3

Views: 3531

Answers (4)

darren
darren

Reputation: 5694

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).

Upvotes: 0

bgausden
bgausden

Reputation: 71

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.

Upvotes: 0

QualitySurprise
QualitySurprise

Reputation: 21

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)

Upvotes: 1

Team Alpha Vantage
Team Alpha Vantage

Reputation: 61

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.

Upvotes: 2

Related Questions