7

I run my Visual Studio Code using "Run as Administrator"

While Visual Studio Code is open I get this message:

Updates are disabled because you are running the user-scope installation of Visual Studio Code as Administrator.

The message has a link to "Learn more" here

The "Learn more" link gives a similar message, so my issue is clear...

Note: When running VS Code as Administrator in a user setup installation, updates will be disabled.

I found these links:

Just posting a Super User question to compile how to update visual studio code and/or avoid this error...

1 Answer 1

2

It's clear I have the "user-setup installation" of VS Code. The "Learn more" link explains:

The user setup does not require Administrator privileges to run as the location will be under your user Local AppData (LOCALAPPDATA) folder. Since it requires no elevation, the user setup is able to provide a smoother background update experience. This is the preferred way to install VS Code on Windows.

System-setup installation

One solution (as suggested both here and here) is to use the system-setup installation of VS Code instead.

The system setup requires elevation to Administrator privileges to run and will place the installation under the system's Program Files. The in-product update flow will also require elevation, making it less streamlined than the user setup. On the other hand, installing VS Code using the system setup means that it will be available to all users in the system.

  • The system-setup installation requires Admin, which works for me (I "Run as Administrator" anyway!).
  • Also the system-setup installation is available to all users (side-effect, this may be a good thing or bad thing depending on your circumstances...)

Close and re-open VS Code as non-administrator

Another solution is simply to close all open VS code instances, then re-open VS Code as a non-administrator.

In my case VS Code automatically started updating (check the Help menu; notice the disabled "Installing updates..." message, or if that process is finished, the option might read "Restart to Update")

VS Code help menu, showing a disabled option "Installing updates..."

Check for updates (requires one of the above two)

Finally you could try to update manually by checking the Help menu option > "Check for Updates" as suggested here.

However, this option is not available while you have a user-setup installation and you "Run as Administrator", so if you want to manually Check for Updates, you must use one of the above two approaches.

Of course you could manually re-install VS Code if the other options don't work. More on VS Code's auto-updating here, and disabling it here

EDIT I agree with @Waggers' comment,

I understand that I don't need to be an administrator to get updates on the user version. I don't understand why being an administrator means I can't get automatic updates, that's completely counter-intuitive.

When I check these spots in VS Code source code where I find the message "Updates are disabled..." and the enum DisablementReason.RunningAsAdmin, I don't see comments... maybe if I checked the Git history...

My best guess is this is to prevent anyone who mistakenly thinks that "Running as Administrator" changes the scope of the installation to be more "system-wide" (which it won't, as long as you have the "user-setup installation")

4
  • 1
    I understand that I don't need to be an administrator to get updates on the user version. I don't understand why being an administrator means I can't get automatic updates, that's completely counter-intuitive.
    – Waggers
    Commented Mar 26 at 10:59
  • 2
    I agree @Waggers. I know I haven't answered why running-as-admin precludes/prevents the user-setup installation from updating. Maybe someone else can explain. I did add some links to the VS Code source code and the DisablementReason.RunningAsAdmin enum in case I can do more research & find out, later.... Commented Mar 26 at 14:49
  • 1
    Thanks for your investigative work on this unintuitive issue, Nate! It's been a few months -- any progress? Commented Jul 2 at 20:22
  • Sorry no progress @EricHepperle-CodeSlayer2010 - I still agree with @ Waggers point about "... why being an administrator means I can't get automatic updates" Commented Jul 2 at 20:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .