mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-14 23:18:36 +00:00
fix: remove appx when windows10 context menu is forced (#295187)
This commit is contained in:
@@ -1508,7 +1508,7 @@ var
|
|||||||
begin
|
begin
|
||||||
// Check if the user has forced Windows 10 style context menus on Windows 11
|
// Check if the user has forced Windows 10 style context menus on Windows 11
|
||||||
SubKey := 'Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32';
|
SubKey := 'Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32';
|
||||||
Result := RegKeyExists(HKEY_CURRENT_USER, SubKey) or RegKeyExists(HKEY_LOCAL_MACHINE, SubKey);
|
Result := RegKeyExists(HKEY_CURRENT_USER, SubKey);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ShouldUseWindows11ContextMenu(): Boolean;
|
function ShouldUseWindows11ContextMenu(): Boolean;
|
||||||
@@ -1675,6 +1675,12 @@ begin
|
|||||||
if CurStep = ssPostInstall then
|
if CurStep = ssPostInstall then
|
||||||
begin
|
begin
|
||||||
#ifdef AppxPackageName
|
#ifdef AppxPackageName
|
||||||
|
// Remove the appx package when user has forced Windows 10 context menus via
|
||||||
|
// registry. This handles the case where the user previously had the appx
|
||||||
|
// installed but now wants the classic context menu style.
|
||||||
|
if IsWindows10ContextMenuForced() then begin
|
||||||
|
RemoveAppxPackage();
|
||||||
|
end;
|
||||||
// Remove the old context menu registry keys
|
// Remove the old context menu registry keys
|
||||||
if ShouldUseWindows11ContextMenu() then begin
|
if ShouldUseWindows11ContextMenu() then begin
|
||||||
RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\*\shell\{#RegValueName}');
|
RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\*\shell\{#RegValueName}');
|
||||||
|
|||||||
Reference in New Issue
Block a user