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

Unable to Update VS Code #147408

Closed
andrewrice opened this issue Apr 13, 2022 · 57 comments · Fixed by #155852
Closed

Unable to Update VS Code #147408

andrewrice opened this issue Apr 13, 2022 · 57 comments · Fixed by #155852
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders install-update VS Code installation and upgrade system issues verified Verification succeeded windows VS Code on Windows issues
Milestone

Comments

@andrewrice
Copy link

Issue Type: Bug

When checking for updates, receive prompt saying the following:

"C:\Users\myusername\AppData\Local\Programs\Microsoft VS Code_\chrome_100_percent.pak
An error occurred while trying to create a file in the destination directory: Access is denied"

Available options are:

  • Try again
  • Skip this file
  • Cancel installation.

First two options immediately bring prompt the error again, cancel installation suppresses it until auto-update re-attempts the installation.

Error occurs when running as administrator as well.

VS Code version: Code 1.66.1 (8dfae7a, 2022-04-06T14:50:12.141Z)
OS version: Windows_NT x64 10.0.19043
Restricted Mode: No

System Info
Item Value
CPUs AMD Ryzen 9 3900X 12-Core Processor (24 x 3800)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.95GB (22.02GB free)
Process Argv --crash-reporter-id 117dd477-59c8-4487-9ba4-aff765032dc6
Screen Reader no
VM 0%
Extensions (1)
Extension Author (truncated) Version
prettier-vscode esb 9.5.0
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebugcf:30466690

@darkvertex
Copy link

The autoupdate kept failing and I figured "Oh, autoupdate is borked, let me just install the latest installer.."

but nope, that fails too:

image

🤔

@darkvertex
Copy link

darkvertex commented Apr 13, 2022

...aaaand now my install is corrupt, great:

image


Error text if it helps:

Uncaught Exception:
Error: Cannot find module 'C:\Users\alan\AppData\Local\Programs\Microsoft VS Code\resources\app\out\main'
    at Module._resolveFilename (node:internal/modules/cjs/loader:987:15)
    at Function.o._resolveFilename (node:electron/js2c/browser_init:253:840)
    at Object.<anonymous> (node:electron/js2c/browser_init:193:3263)
    at Object../lib/browser/init.ts (node:electron/js2c/browser_init:193:3507)
    at __webpack_require__ (node:electron/js2c/browser_init:1:128)
    at node:electron/js2c/browser_init:1:1200
    at node:electron/js2c/browser_init:1:1267
    at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:312:7)
    at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:252:10)
    at loadNativeModule (node:internal/modules/cjs/helpers:49:9)

@derkrasseleo
Copy link

I got the same error message after trying to upgrade via winget

@ruudhanegraaf
Copy link

Ditto here, but here the reported file is unins000.exe instead of chrome_100_percent.pak.

@Absolucy
Copy link

Here, the reported file is resources/app/out/bootstrap-amd.js.

@the-chain-gamer
Copy link

same issue here. started happening since yesterday.

@connor-yu4322
Copy link

Same issue, if i skip file it just keeps going through every single file.

@Erijoda
Copy link

Erijoda commented Apr 15, 2022

Seems the permissions were borked on my install.

I was able to fix it by changing the permissions.

If you have administrator access with your user then you should be able to fix it with these steps:

Step 1) Open CMD.EXE as administrator (with your user)

Step 2) Run: takeown /F "%LOCALAPPDATA%\Programs\Microsoft VS Code" /R /D Y

Step 3) Run: icacls "%LOCALAPPDATA%\Programs\Microsoft VS Code" /inheritance:r /remove "NT SERVICE\TrustedInstaller" /grant:r "%USERDOMAIN%\%USERNAME%":(F) /grant:r "CREATOR OWNER":(OI)(CI)(IO)(F) /grant:r "BUILTIN\Users":(OI)(CI)(RX) /grant:r "NT AUTHORITY\Authenticated Users":(OI)(CI)(RX) /grant:r "BUILTIN\Administrators":(OI)(CI)(F) /grant:r "NT AUTHORITY\SYSTEM":(OI)(CI)(F)

If you don't have administrator then the easiest way to fix would be to have someone with administrator change the owner of folder, subfolder and files in %LOCALAPPDATA%\Programs\Microsoft VS Code, using Windows Explorer's Properties > Security > Advanced.
Once you are the owner you can run the command in Step 3 without administrator.

@ruudhanegraaf
Copy link

ruudhanegraaf commented Apr 15, 2022

Thanks, Erijoda. This also fixed it for me. :-)

Step 3 for people with non-English Windows:

icacls "%LOCALAPPDATA%\Programs\Microsoft VS Code" /inheritance:r /remove "NT SERVICE\TrustedInstaller" /grant:r "%USERDOMAIN%%USERNAME%":(F) /grant:r "*S-1-3-0":(OI)(CI)(IO)(F) /grant:r "*S-1-5-32-545":(OI)(CI)(RX) /grant:r "*S-1-5-11":(OI)(CI)(RX) /grant:r "*S-1-5-32-544":(OI)(CI)(F) /grant:r "*S-1-5-18":(OI)(CI)(F)

@darkvertex
Copy link

Thank you @Erijoda it fixed it for me too. 🎉

I was able to run the installer after your steps and my VSCode boots up like normal again. 😅

@joaomoreno
Copy link
Member

joaomoreno commented Apr 21, 2022

@Erijoda What is the actual permissions difference between what VS Code set and what you set in that command?

This is what VS Code is using today:

vscode/build/win32/code.iss

Lines 1494 to 1501 in c20b68a

Permissions := '/grant:r "*S-1-5-18:(OI)(CI)F" /grant:r "*S-1-5-32-544:(OI)(CI)F" /grant:r "*S-1-5-11:(OI)(CI)RX" /grant:r "*S-1-5-32-545:(OI)(CI)RX"';
#if "user" == InstallTarget
Permissions := Permissions + ' /grant:r "*S-1-3-0:(OI)(CI)F"';
#endif
Exec(ExpandConstant('{sys}\icacls.exe'), ExpandConstant('"{app}" /inheritancelevel:r ') + Permissions, '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;

@joaomoreno joaomoreno added 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 labels Apr 21, 2022
@joaomoreno joaomoreno modified the milestones: Backlog, April 2022 Apr 21, 2022
@rainersigwald
Copy link
Member

rainersigwald commented May 6, 2022

I just ran into this myself.

---------------------------
Visual Studio Code
---------------------------
There was an error while Opening file handle: "C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\bootstrap-amd.js":

Failed to create file handle: Access is denied.



Please verify there are no Visual Studio Code processes still executing.
---------------------------
Retry   Cancel   
---------------------------
icacls "C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\bootstrap-amd.js"
C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\bootstrap-amd.js BUILTIN\Administrators:(I)(F)
                                                                                                      BUILTIN\Users:(I)(RX)
                                                                                                      NT AUTHORITY\Authenticated Users:(I)(RX)
                                                                                                      NT AUTHORITY\SYSTEM:(I)(F)

Successfully processed 1 files; Failed processing 0 filesicacls "C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code"
C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code NTDEV\raines:(F)
                                                               CREATOR OWNER:(OI)(CI)(IO)(F)
                                                               BUILTIN\Users:(OI)(CI)(RX)
                                                               NT AUTHORITY\Authenticated Users:(OI)(CI)(RX)
                                                               BUILTIN\Administrators:(OI)(CI)(F)
                                                               NT AUTHORITY\SYSTEM:(OI)(CI)(F)

Successfully processed 1 files; Failed processing 0 filesicacls "C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\resources"
C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\resources NTDEV\raines:(I)(F)
                                                                         CREATOR OWNER:(I)(OI)(CI)(IO)(F)
                                                                         BUILTIN\Users:(I)(OI)(CI)(RX)
                                                                         NT AUTHORITY\Authenticated Users:(I)(OI)(CI)(RX)
                                                                         BUILTIN\Administrators:(I)(OI)(CI)(F)
                                                                         NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)

Successfully processed 1 files; Failed processing 0 filesicacls "C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\resources\app"
C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\resources\app NTDEV\raines:(I)(F)
                                                                             CREATOR OWNER:(I)(OI)(CI)(IO)(F)
                                                                             BUILTIN\Users:(I)(OI)(CI)(RX)
                                                                             NT AUTHORITY\Authenticated Users:(I)(OI)(CI)(RX)
                                                                             BUILTIN\Administrators:(I)(OI)(CI)(F)
                                                                             NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)

Successfully processed 1 files; Failed processing 0 filesicacls "C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\resources\app\out"
C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\resources\app\out BUILTIN\Administrators:(I)(F)
                                                                                 CREATOR OWNER:(I)(OI)(CI)(IO)(F)
                                                                                 BUILTIN\Users:(I)(OI)(CI)(RX)
                                                                                 NT AUTHORITY\Authenticated Users:(I)(OI)(CI)(RX)
                                                                                 BUILTIN\Administrators:(I)(OI)(CI)(IO)(F)
                                                                                 NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)

Successfully processed 1 files; Failed processing 0 filesicacls "C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\*"
C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\bootstrap-amd.js BUILTIN\Administrators:(I)(F)
                                                                                                      BUILTIN\Users:(I)(RX)
                                                                                                      NT AUTHORITY\Authenticated Users:(I)(RX)
                                                                                                      NT AUTHORITY\SYSTEM:(I)(F)

C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\bootstrap-fork.js BUILTIN\Administrators:(I)(F)
                                                                                                       BUILTIN\Users:(I)(RX)
                                                                                                       NT AUTHORITY\Authenticated Users:(I)(RX)
                                                                                                       NT AUTHORITY\SYSTEM:(I)(F)

C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\bootstrap-node.js BUILTIN\Administrators:(I)(F)
                                                                                                       BUILTIN\Users:(I)(RX)
                                                                                                       NT AUTHORITY\Authenticated Users:(I)(RX)
                                                                                                       NT AUTHORITY\SYSTEM:(I)(F)

C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\bootstrap-window.js BUILTIN\Administrators:(I)(F)
                                                                                                         BUILTIN\Users:(I)(RX)
                                                                                                         NT AUTHORITY\Authenticated Users:(I)(RX)
                                                                                                         NT AUTHORITY\SYSTEM:(I)(F)

C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\bootstrap.js BUILTIN\Administrators:(I)(F)
                                                                                                  BUILTIN\Users:(I)(RX)
                                                                                                  NT AUTHORITY\Authenticated Users:(I)(RX)
                                                                                                  NT AUTHORITY\SYSTEM:(I)(F)

C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\cli.js BUILTIN\Administrators:(I)(F)
                                                                                            BUILTIN\Users:(I)(RX)
                                                                                            NT AUTHORITY\Authenticated Users:(I)(RX)
                                                                                            NT AUTHORITY\SYSTEM:(I)(F)

C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\main.js BUILTIN\Administrators:(I)(F)
                                                                                             BUILTIN\Users:(I)(RX)
                                                                                             NT AUTHORITY\Authenticated Users:(I)(RX)
                                                                                             NT AUTHORITY\SYSTEM:(I)(F)

C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\nls.metadata.json BUILTIN\Administrators:(I)(F)
                                                                                                       BUILTIN\Users:(I)(RX)
                                                                                                       NT AUTHORITY\Authenticated Users:(I)(RX)
                                                                                                       NT AUTHORITY\SYSTEM:(I)(F)

C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\vs BUILTIN\Administrators:(I)(F)
                                                                                        CREATOR OWNER:(I)(OI)(CI)(IO)(F)
                                                                                        BUILTIN\Users:(I)(OI)(CI)(RX)
                                                                                        NT AUTHORITY\Authenticated Users:(I)(OI)(CI)(RX)
                                                                                        BUILTIN\Administrators:(I)(OI)(CI)(IO)(F)
                                                                                        NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)

C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\vscode-dts BUILTIN\Administrators:(I)(F)
                                                                                                CREATOR OWNER:(I)(OI)(CI)(IO)(F)
                                                                                                BUILTIN\Users:(I)(OI)(CI)(RX)
                                                                                                NT AUTHORITY\Authenticated Users:(I)(OI)(CI)(RX)
                                                                                                BUILTIN\Administrators:(I)(OI)(CI)(IO)(F)
                                                                                                NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)

Successfully processed 10 files; Failed processing 0 files

I applied Full control to my user (NTDEV\raines) with

icacls "C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\*" /grant NTDEV\raines:F
processed file: C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\bootstrap-amd.js
processed file: C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\bootstrap-fork.js
processed file: C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\bootstrap-node.js
processed file: C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\bootstrap-window.js
processed file: C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\bootstrap.js
processed file: C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\cli.js
processed file: C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\main.js
processed file: C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\nls.metadata.json
processed file: C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\vs
processed file: C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\out\\vscode-dts
Successfully processed 10 files; Failed processing 0 files

and got to the new error

---------------------------
Visual Studio Code
---------------------------
There was an error while Opening file handle: "C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\extensions\\bat\\language-configuration.json":

Failed to create file handle: Access is denied.



Please verify there are no Visual Studio Code processes still executing.
---------------------------
Retry   Cancel   
---------------------------

A reset did not help

icacls "C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\extensions\\bat\\language-configuration.json" /reset
processed file: C:\\Users\\raines\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\extensions\\bat\\language-configuration.json
Successfully processed 1 files; Failed processing 0 files

So I did icacls "%LOCALAPPDATA%\Programs\Microsoft VS Code" /grant "%USERDOMAIN%\%USERNAME%":F /T to do the whole directory. That appears to have worked, and is hopefully a bit less invasive than the full replacement above.

@yalaudah
Copy link

Thanks @Erijoda! This fixed it for me as well 😃

@sba923
Copy link

sba923 commented May 20, 2022

icacls "%LOCALAPPDATA%\Programs\Microsoft VS Code" /grant "%USERDOMAIN%%USERNAME%":F /T

will try this next time I face the issue

@PoulChapman
Copy link
Member

confirmed that running this from an admin cmd prompt fixed the issue
icacls "%LOCALAPPDATA%\Programs\Microsoft VS Code" /grant "%USERDOMAIN%\%USERNAME%":F /T

@larspassic
Copy link

If you have administrator access with your user then you should be able to fix it with these steps:

Step 1) Open CMD.EXE as administrator (with your user)

Step 2) Run: takeown /F "%LOCALAPPDATA%\Programs\Microsoft VS Code" /R /D Y

Step 3) Run: icacls "%LOCALAPPDATA%\Programs\Microsoft VS Code" /inheritance:r /remove "NT SERVICE\TrustedInstaller" /grant:r "%USERDOMAIN%\%USERNAME%":(F) /grant:r "CREATOR OWNER":(OI)(CI)(IO)(F) /grant:r "BUILTIN\Users":(OI)(CI)(RX) /grant:r "NT AUTHORITY\Authenticated Users":(OI)(CI)(RX) /grant:r "BUILTIN\Administrators":(OI)(CI)(F) /grant:r "NT AUTHORITY\SYSTEM":(OI)(CI)(F)

This worked for me! Thank you @Erijoda !

@joaomoreno joaomoreno modified the milestones: June 2022, July 2022 Jun 27, 2022
@sabbour
Copy link
Member

sabbour commented Jun 29, 2022

So is there a workaround? MSFTee here and blocked by the same issue.

@byehack
Copy link

byehack commented Jun 30, 2022

image
fixed for me.
actually it didn't show any progression update window after click "Restart to Update"

@naamunds
Copy link
Member

naamunds commented Jul 6, 2022

Running icacls "%LOCALAPPDATA%\Programs\Microsoft VS Code" /grant "%USERDOMAIN%\%USERNAME%":F /T from an admin command prompt fixed it for me.

@heaths
Copy link
Member

heaths commented Jul 6, 2022

Running icacls "%LOCALAPPDATA%\Programs\Microsoft VS Code" /grant "%USERDOMAIN%\%USERNAME%":F /T from an admin command prompt fixed it for me.

Something like that worked once for me, but with the next update the problem occurred again. It's a workaround. Something is changing the ACLs, and seems to be happening only for VSCode. Other user-installed programs haven't exhibited this problem.

@naamunds
Copy link
Member

naamunds commented Jul 7, 2022

Something like that worked once for me, but with the next update the problem occurred again. It's a workaround. Something is changing the ACLs, and seems to be happening only for VSCode. Other user-installed programs haven't exhibited this problem.

I just installed another successful update (1.69.0) without any workarounds (not even running it as admin). I think the issue may have been fixed in one of the most recent versions of VS Code.

@marblewraith
Copy link

Normally i manage everything through winget running as admin.

I hit similar perms issues today moving from 1.68.1 to 1.69.0 with the error coming up as Access denied failed to write file to ~\AppData\Local\Programs\Microsoft VS Code\bin, and then following that a similar JS Runtime message to the one above.

Eventually i ended up:

  1. uninstalling (via winget),
  2. manually removing the parent folder (Microsoft VS Code above) and ~\AppData\Roaming\Code
  3. reinstalling (1.68 via winget)
  4. Running VScode as admin and using the inbuilt updater to get to 1.69.0

Note: Something really weird. Even after i had uninstalled it and removed all the folders. For some reason VScode was still running active processes. I had to go into task manager and manually end them, before it would let me reinstall.

@sba923
Copy link

sba923 commented Jul 19, 2022

This fixed my issue as well. Thanks @Erijoda

Step 1) Open CMD.EXE as administrator (with your user)

Step 2) Run: takeown /F "%LOCALAPPDATA%\Programs\Microsoft VS Code" /R /D Y

Step 3) Run: icacls "%LOCALAPPDATA%\Programs\Microsoft VS Code" /inheritance:r /remove "NT SERVICE\TrustedInstaller" /grant:r "%USERDOMAIN%%USERNAME%":(F) /grant:r "CREATOR OWNER":(OI)(CI)(IO)(F) /grant:r "BUILTIN\Users":(OI)(CI)(RX) /grant:r "NT AUTHORITY\Authenticated Users":(OI)(CI)(RX) /grant:r "BUILTIN\Administrators":(OI)(CI)(F) /grant:r "NT AUTHORITY\SYSTEM":(OI)(CI)(F)

This worked for me, but:

  1. %USERDOMAIN%%USERNAME% should be %USERDOMAIN%\%USERNAME% if your account is member of a domain
  2. %USERDOMAIN%%USERNAME% should be %USERNAME% if your account is not member of a domain (the case for my home systems)

@lilgrassin
Copy link

Another msft-ie here seeing the code.admx failure on both of my work machines:

  • Do you usually OR have you recently ran VS Code as Administrator, using the User Setup?

On my dev machine I may have tried running it as admin once, but not on my laptop (as far as I remember). Both are installed using the regular user installer (no winget, no admin).

  • When you right click the VS Code installation folder (%localappdata%\Programs\Microsoft VS Code), select Properties, Security, does CREATOR OWNER show up in the list? If you click Advanced, who is listed as the Owner?

Yes, here are the permissions for the VS Code folder on my laptop:
image

Also adding the permissions for the problem file ("code.admx"):
image

  • Is your machine domain joined?

Yes for both affected machines.

@makemefeelgr8
Copy link

Step 3) Run: icacls "%LOCALAPPDATA%\

It doesn't work. BUILTIN\Users: No mapping between account names and security IDs was done.

Step 3 for people with non-English Windows:

That one doesn't work as well. It should be "%USERDOMAIN%\%USERNAME%", not "%USERDOMAIN%%USERNAME%".

Are there ANY palns to make VS Code updates work again? Is this the intended workflow? Download default installer, choose Program Files, it installs the app, it fails to update, go to github, copy some commands, repeat every time you need to update. Is VS Code still in alpha, by any chance?

@joaomoreno
Copy link
Member

Hi all, sorry for the delay here. I got something for you.

The problem, as some people pointed out, is related to the permissions left behind once the Setup finishes installing VS Code. Namely, the CREATOR OWNER identity isn't working as we expected.

Broken:

image


By setting the correct permissions for the current user, we should be able to create a good model upfront. I've created a build with that fix and ran extensive testing including with usernames with spaces and/or non-ASCII characters.

Fixed:

image


If you currently hit this issue, I'd appreciate it if you could download the following Insiders build, install it and show me your Advanced Security Settings dialog, so I can confirm things work fine in your setup?

💾 Download Windows x64 Insiders User Setup

@joaomoreno
Copy link
Member

Verification:

  1. Install the user setup of VS Code
  2. Verify on the Advanced Security Settings of the %localappdata%\Programs\Microsoft VS Code Insiders directory that your user has Full control access to This folder, subfolders and files and not just This folder only. Example:

image

@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Jul 22, 2022
@sba923
Copy link

sba923 commented Jul 24, 2022

@joaomoreno I presume the fix modifies existing installations on the next update, and doesn't only apply to fresh / new installations?

@joaomoreno
Copy link
Member

@sba923 Correct, though it's possible that it might not be able to fix permissions on existing broken installations, given that's a chicken/egg problem. If you're hitting this issue, I'd suggest simply reinstalling on top of your installation (no need to uninstall first).

@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jul 25, 2022
@gameprogrammingsteven
Copy link

gameprogrammingsteven commented Jul 27, 2022

For you Microsofties that wanna debug this, or idk, have a soccer match between VS and Windows teams in the studios or something... Here's a list of the files that say "nope!" to permission updates if you're not in command line.

inno_updater.exe Failed to enumerate objects in container. Access is denied.
vcruntime140.dll
unins000.exe
One invisible file b/c pathname is too long for dialog box. Has an underscore after the VS Code directory. Might literally be an underscore.

EDIT: While I am unable to change permissions and am in correct directory, I had to modify the path variable used for another drive to successfully process the right directory. for the command(s) above due to installing on D: drive

All of them say "access is denied" and error applying permissions. These are just quick notes I jotted during the four errors. Surprised they weren't mentioned above. They were skipped by the admin cmd line (I'm admin but not the super/sys admin you have to unlock on every device). I'm guessing if I login with the windows admin account itself, it will work... but.... who wants to have to go through that process every time. Not many normal users are aware that user admins aren't real admins.

I'm not connected to any domains

@rzhao271 rzhao271 added the verified Verification succeeded label Jul 27, 2022
@TheJazzDev
Copy link

Well, after all said and done... I ended up deleting the folder \AppData\Local\Programs\Microsoft VS Code\ and then i downloaded the latest version on vs code and install it... Everything works fine and i still get to keep my previous settings and extensions...

@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders install-update VS Code installation and upgrade system issues verified Verification succeeded windows VS Code on Windows issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.