vscode icon indicating copy to clipboard operation
vscode copied to clipboard

VSCodeInsiders: The logo path in the right-click menu item in win11 does not exist

Open ahaoboy opened this issue 5 months ago • 14 comments

Type: Bug

VSCodeInsiders

Name: Microsoft.VSCodeInsiders
FullName: Microsoft.VSCodeInsiders_1.0.0.0_neutral__8wekyb3d8bbwe
InstalledLocation: C:\Program Files\WindowsApps\Microsoft.VSCodeInsiders_1.0.0.0_neutral__8wekyb3d8bbwe
Logo Path: C:\Program Files\Microsoft VS Code Insiders\appx\resources\app\resources\win32\code_150x150.png
Logo file NOT found.

WindowsTerminal

Name: Microsoft.WindowsTerminal
FullName: Microsoft.WindowsTerminal_1.22.11751.0_x64__8wekyb3d8bbwe
InstalledLocation: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.22.11751.0_x64__8wekyb3d8bbwe
Logo Path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.22.11751.0_x64__8wekyb3d8bbwe\Images\StoreLogo.scale-150.png
Logo file exists.

Execute the pwsh code to get the Logo path of the VSCodeInsiders

C:\Program Files\Microsoft VS Code Insiders\appx\resources\app\resources\win32\code_150x150.png

The correct path does not have an appx folder
C:\Program Files\Microsoft VS Code Insiders\resources\app\resources\win32\code_150x150.png
Add-Type -AssemblyName "System.Runtime.WindowsRuntime"
$null = [Windows.Management.Deployment.PackageManager, Windows.Management.Deployment, ContentType = WindowsRuntime]

$packageManager = New-Object Windows.Management.Deployment.PackageManager

$filter = "VSCodeInsiders"
# $filter = "WindowsTerminal"

$packages = $packageManager.FindPackagesForUser("")

foreach ($pkg in $packages) {
    if ($pkg.Id.Name -like "*$filter*") {
        Write-Host "========================="
        Write-Host "Name: $($pkg.Id.Name)"
        Write-Host "FullName: $($pkg.Id.FullName)"
        Write-Host "InstalledLocation: $($pkg.InstalledLocation.Path)"
        $logoPath =  $pkg.Logo.OriginalString
        Write-Host "Logo Path: $logoPath"
        if (Test-Path $logoPath) {
            Write-Host "Logo file exists."
        } else {
            Write-Host "Logo file NOT found."
        }
    }
}

VS Code version: Code - Insiders 1.103.0-insider (344abe8f7ce560f4883e1542669dd96e5118c767, 2025-07-17T05:03:44.028Z) OS version: Windows_NT x64 10.0.26200 Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i7-14700KF (28 x 3418)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.79GB (5.14GB free)
Process Argv --crash-reporter-id ad2f0e40-5702-4e7c-a3a9-f49766b80ff3
Screen Reader no
VM 0%
Extensions: none
A/B Experiments
vsliv368:30146709
pythonvspyt551:31249597
2e7ec940:31000449
nativeloc1:31118317
dwcopilot:31158714
c3hdf307:31184662
6074i472:31201624
dwoutputs:31242946
9064b325:31222308
copilot_t_ci:31333650
g012b348:31231168
pythoneinst12:31251391
c7cif404:31309980
pythonpulldiag:31287486
6gi0g917:31259950
996jf627:31264550
pythonrdcb7:31268811
usemplatestapi:31297334
e6194696:31317039
747dc170:31275146
pythonpcpt1:31345880
6518g693:31302842
generatesymbolt:31280541
convertfstringf:31280702
9d2cg352:31346308
b99bg931:31349649
usemarketplace:31343026
0g1h6703:31329154
nes-emitfast-1:31333560
replacestringexc:31348966
6abeh943:31336334
envsactivate1:31349248
0927b901:31340060
j8ce-both:31345957
aj9gi531:31345572
editstats-enabled:31346256

ahaoboy avatar Jul 17 '25 06:07 ahaoboy

https://github.com/ahaoboy/serde-appxmanifest/blob/main/assets/xml/Microsoft.VSCodeInsiders_1.0.0.0_neutral__8wekyb3d8bbwe.xml

These logo resources in xml do not exist

  <Properties>
    <Logo>resources\app\resources\win32\code_150x150.png</Logo>
  </Properties>
      <uap:VisualElements 
        AppListEntry="none"
        DisplayName="Visual Studio Code - Insiders"
        Description="code_insiders context menu handler"
        BackgroundColor="transparent"
        Square150x150Logo="resources\app\resources\win32\code_150x150.png"
        Square44x44Logo="resources\app\resources\win32\code_70x70.png">

ahaoboy avatar Jul 18 '25 03:07 ahaoboy

Hi, thanks for filing this issue. I am aware of the paths being incorrect, haven't adjust the -ExternalLocation when installing the appx due to https://github.com/microsoft/vscode/issues/254613#issuecomment-3128433871. This will be addressed as part of the other issue.

deepak1556 avatar Jul 29 '25 03:07 deepak1556

Hi, thanks for filing this issue. I am aware of the paths being incorrect, haven't adjust the -ExternalLocation when installing the appx due to #254613 (comment). This will be addressed as part of the other issue.

Is this issue related to the recent absence of the "Open With" right-click menu in VSCode Insiders and the program freezing when attempting to uninstall?

zheung avatar Aug 01 '25 09:08 zheung

Which version of insiders you are testing with ? Haven't heard of an issue with uninstallation, there was however this recent bug that got fixed in insiders https://github.com/microsoft/vscode/issues/258418

deepak1556 avatar Aug 01 '25 13:08 deepak1556

Which version of insiders you are testing with ? Haven't heard of an issue with uninstallation, there was however this recent bug that got fixed in insiders #258418

In today's latest version of Insiders(commit: 6977c2a503c0fefc0f9290111c4154482c63b856) on Win11.

This uninstallation issue did not occur in the sandbox in my test. However, it occurred on both my company and home computers (both are Insiders). Due to the modern context menu issue, I tried reinstalling Insiders.

I referred to your comment in #254613 (comment 3048206163). I think the biggest difference between the sandbox and my computers is the appx folder and the .appx files inside it on my computers.

In the sandbox, Insiders is a fresh installation. After installation, no appx files were found in the Insiders folder.
But on my computers, Insiders is always updated via automatic updates. The Insiders folder retains old appx files. I believe the uninstallation config also includes the uninstallation of appx files.

This causes the uninstallation process to remain stuck at the beginning. At this point, WER continues to generate logs from powershell.exe.

zheung avatar Aug 01 '25 14:08 zheung

Is this system setup or user setup you are facing issue with during uninstallation ? By uninstallation are you referring to the update scenario that is causing issues or just uninstall via uninst***.exe ?

If it is the first case, can you share logs from %LOCALAPPDATA%/Temp/Setup **.txt, we have added checks since that comment to ensure appx package is installed before attempting to remove or add it https://github.com/microsoft/vscode/blob/3aef8be5e46aa7e97e8b0ed115f6147cd0b24634/build/win32/code.iss#L1498-L1526

deepak1556 avatar Aug 02 '25 00:08 deepak1556

System setup, just uninstall via unins000.exe.

Due to issues with the right-click menu, I attempted to uninstall and reinstall VSCode. However, the uninstallation process became stuck.

UPDATE: VSCode has been successfully uninstalled from my home computer. However, it still generated 13 WER logs from powershell.exe. VSCode seems updated on my home computer on August 2. The installer name in setup log was CodeSetup-insider-994be4137aaf18f2703037311dd1c56a8446ef8b.exe

But, I am still unable to successfully uninstall VSCode on my work computer, and WER logs continue to be generated. The latest installation log on my work computer is from August 1. The installer name in setup log was CodeSetup-insider-8c0b3c16f47d628d0d767358d5a3fa1d95237f70.exe.

Setup Log 2025-08-01 #001.txt

Image

zheung avatar Aug 04 '25 01:08 zheung

I am unable to repro the issue on my end, couple of things to try

  1. What does Get-AppxPackage -Name Microsoft.VisualStudioCodeInsiders print on your work computer powershell
  2. Manual update flow for work computer a) Download latest system setup from https://code.visualstudio.com/insiders b) Open current insiders c) From command paletter, run Developer: Apply Update... d) Choose the setup file downloaded from step a) e) Wait for update to finish and relaunch f) Quit and run unins000.exe

However, it still generated 13 WER logs from powershell.exe.

There shouldn't be any powershell runs for system setup since we guard them behind #if "user" == InstallTarget in the setup executable. This feels like a broken installation from when appx was temporarily enabled for system setup with insiders https://github.com/microsoft/vscode/commit/c48e24145dafb32f6fba5139566cc99c0da634de

deepak1556 avatar Aug 04 '25 15:08 deepak1556

Name              : Microsoft.VisualStudioCodeInsiders
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : Neutral
ResourceId        :
Version           : 1.0.103.0
PackageFullName   : Microsoft.VisualStudioCodeInsiders_1.0.103.0_neutral__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.VisualStudioCodeInsiders_1.0.103.0_neutral__8wekyb3d8bbwe
IsFramework       : False
PackageFamilyName : Microsoft.VisualStudioCodeInsiders_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Developer
Status            : Ok

so weird the uninstaller is still stuck in work computer. I've updated Insiders according to the steps you mentioned.

If it is caused by the powershell command used to uninstall appx, perhaps I can run these commands manually to observe the results?

版本: 1.103.0-insider
提交: 34769c5d17df269aed44407eb1a1c0e6362e2d79
日期: 2025-08-04T21:43:35.566Z
浏览器: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code-Insiders/1.103.0-insider Chrome/138.0.7204.100 Electron/37.2.3 Safari/537.36"
Image

zheung avatar Aug 05 '25 01:08 zheung

I don't know if it has anything to do with the issue, but on my computer the name is VSCodeInsiders instead of VisualStudioCodeInsiders

Name              : Microsoft.VSCodeInsiders
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : Neutral
ResourceId        :
Version           : 1.0.0.0
PackageFullName   : Microsoft.VSCodeInsiders_1.0.0.0_neutral__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.VSCodeInsiders_1.0.0.0_neutral__8wekyb3d8bbwe
IsFramework       : False
PackageFamilyName : Microsoft.VSCodeInsiders_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Developer
Status            : Ok

ahaoboy avatar Aug 05 '25 02:08 ahaoboy

If it is caused by the powershell command used to uninstall appx, perhaps I can run these commands manually to observe the results?

Yes can you try that, the command would be Remove-AppxPackage -Package Microsoft.VisualStudioCodeInsiders_1.0.103.0_neutral__8wekyb3d8bbwe

For completeness this is the command we spawn from the setup file if the package is installed

powershell.exe -NoLogo -NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -Command "Remove-AppxPackage -Package Microsoft.VisualStudioCodeInsiders_1.0.103.0_neutral__8wekyb3d8bbwe"

Oh maybe the problem is uninstall database maintained has the broken logic to remove appx package for system setup, the database is more of an additive operation than replace the file when update happens and is managed by inno. Try the following,

  1. Remove appx package manually
  2. Check package no longer exists with Get-AppxPackage command
  3. Run uninstaller

If this doesn't work we have to replace the uninstaller database unins000.dat and unins000.exe as a next step

@ahaoboy that package is from an older insider, we have renamed it in https://github.com/microsoft/vscode/pull/258741.

deepak1556 avatar Aug 05 '25 05:08 deepak1556

meh, running the command to uninstall is successful. But uninstallation is still stuck.

I tried to restore and run the other 3 powershell related commands in the iss file. No errors there either.

Image

zheung avatar Aug 05 '25 09:08 zheung

Yeah the uninstaller exe is pretty much broken, can you manually remove all files from the application folder including unins*** and see if the issue repros with a fresh install ?

deepak1556 avatar Aug 05 '25 11:08 deepak1556

Good idea! By move away the application folder, finally uninstall Insiders.

I found that the newly installed unins000.dat is only 829KB. The old one is as large as 37.4MB. I have kept a copy of the old app folder. Do I need to provide unins000.dat for analysis?

zheung avatar Aug 06 '25 01:08 zheung