The workaround solution is to add the user to have Full Control on the %LOCALAPPDATA%\Programs\Microsoft VS Code
folder.
The following PowerShell script (run as Admin) can replace the user permissions temporarily and resolve the immediate issue:
$folder = "$env:LOCALAPPDATA\Programs\Microsoft VS Code\"
$username = "$env:USERDOMAIN\$env:USERNAME"
$newAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($username, "FullControl", 3, "None", "Allow")
$acl = Get-ACL $folder
$acl.AddAccessRule($newAccessRule)
Set-ACL $folder -AclObject $acl
This allows the installer/updater to continue by clicking Try Again
.
Installation method
This question pertains to the per-user installation of VS Code. This is a valid installation method, and the default method.
The alternative is the Program Files-based (system-wide) installation.
Root cause?
I'm unsure why the user's permissions were lost on the folder. By default the user should have access to their own AppData directory. Something had set the permissions to Admin only (i.e. requiring elevation).
Perhaps the root cause is due to an elevated VS Code doing an update?
More discussion on https://github.com/microsoft/vscode/issues/148953