Open HeinvR opened 11 months ago
@HeinvR, I'm seeing the same output as you when trying your repro steps to install a vscode extension. Looks like the vscodeextension looks in on AMD64: "HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*"
and "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*"
on x86 (source. Both of those locations aren't correct if you've installed vscode as a none Administrator (https://code.visualstudio.com/docs/setup/windows#_installation).
vscode uses the Inno setup and the uninstall key is in: "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*"
Probably the best way to fix this is to check multiple ways:
HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*
for "Microsoft Visual Studio Code*"HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*
for "Microsoft Visual Studio Code*"'code --version'
Thank you for pointing me in the right direction, @philnach! I did some checks and you are right. It seems that running winget as administrator also installs the users install. Meanwhile I found a solution to installing the extiensions via winget configure. I just used a custom powershell script in my config:
- resource: PSDscResources/Script
id: Install VScode Extensions
directives:
description: Script to install Powershell extensions
allowPrerelease: true
settings:
GetScript: |
# Not using this at the moment.
TestScript: |
return $false
SetScript: |
# Ignore deprecation warnings & reload path
$env:NODE_OPTIONS="--no-deprecation"
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
# Extensions to install
code --install-extension ms-vscode.azure-account
code --install-extension ms-vscode.PowerShell
code --install-extension ms-azuretools.vscode-bicep
code --install-extension ms-python.python
I'm trying to get winget configure set up with the vscode/vscodeextension module.
YAML config:
winget reports that it will install the extension:
and it also reports the extension as installed after running:
However when i open vscode my extensions are not there.
I looked at the module directly:
Seems ok:
I think the problem is in the vscodeextension module, it seems to return true when vscode is not found. Despite vscode being installed on my local machine.
It seems the regkey which is used to check the vscode version is no longer working:
Can anyone confirm this is the issue or am i missing something?