mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
chore: cleanup inno setup for context menu install (#164411)
This commit is contained in:
@@ -34,7 +34,6 @@ ShowLanguageDialog=auto
|
||||
ArchitecturesAllowed={#ArchitecturesAllowed}
|
||||
ArchitecturesInstallIn64BitMode={#ArchitecturesInstallIn64BitMode}
|
||||
WizardStyle=modern
|
||||
SetupLogging=yes
|
||||
|
||||
#ifdef Sign
|
||||
SignTool=esrp
|
||||
@@ -89,7 +88,7 @@ Name: "{app}"; AfterInstall: DisableAppDirInheritance
|
||||
[Files]
|
||||
Source: "*"; Excludes: "\CodeSignSummary*.md,\tools,\tools\*,\appx,\appx\*,\resources\app\product.json"; DestDir: "{code:GetDestDir}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
Source: "tools\*"; DestDir: "{app}\tools"; Flags: ignoreversion
|
||||
Source: "appx\*"; DestDir: "{app}\appx"; BeforeInstall: RemoveAppxPackage; AfterInstall: AddAppxPackage; Flags: ignoreversion
|
||||
Source: "appx\*"; DestDir: "{app}\appx"; BeforeInstall: RemoveAppxPackage; AfterInstall: AddAppxPackage; Flags: ignoreversion; Check: IsWindows11OrLater and QualityIsInsiders
|
||||
Source: "{#ProductJsonPath}"; DestDir: "{code:GetDestDir}\resources\app"; Flags: ignoreversion
|
||||
|
||||
[Icons]
|
||||
@@ -1423,14 +1422,12 @@ procedure AddAppxPackage();
|
||||
var
|
||||
AddAppxPackageResultCode: Integer;
|
||||
begin
|
||||
if IsWindows11OrLater() and QualityIsInsiders() then begin
|
||||
if WizardIsTaskSelected('addcontextmenufiles') then begin
|
||||
ShellExec('', 'powershell.exe', '-Command ' + AddQuotes('Add-AppxPackage -Path ''' + ExpandConstant('{app}\appx\{#AppxPackage}') + ''' -ExternalLocation ''' + ExpandConstant('{app}\appx') + ''''), '', SW_HIDE, ewWaitUntilTerminated, AddAppxPackageResultCode);
|
||||
RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\*\shell\{#RegValueName}');
|
||||
RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\directory\shell\{#RegValueName}');
|
||||
RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\directory\background\shell\{#RegValueName}');
|
||||
RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\Drive\shell\{#RegValueName}');
|
||||
end;
|
||||
if WizardIsTaskSelected('addcontextmenufiles') then begin
|
||||
ShellExec('', 'powershell.exe', '-Command ' + AddQuotes('Add-AppxPackage -Path ''' + ExpandConstant('{app}\appx\{#AppxPackage}') + ''' -ExternalLocation ''' + ExpandConstant('{app}\appx') + ''''), '', SW_HIDE, ewWaitUntilTerminated, AddAppxPackageResultCode);
|
||||
RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\*\shell\{#RegValueName}');
|
||||
RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\directory\shell\{#RegValueName}');
|
||||
RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\directory\background\shell\{#RegValueName}');
|
||||
RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\Drive\shell\{#RegValueName}');
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -1438,11 +1435,9 @@ procedure RemoveAppxPackage();
|
||||
var
|
||||
RemoveAppxPackageResultCode: Integer;
|
||||
begin
|
||||
if IsWindows11OrLater() and QualityIsInsiders() then begin
|
||||
ShellExec('', 'powershell.exe', '-Command ' + AddQuotes('Remove-AppxPackage -Package ''{#AppxPackageFullname}'''), '', SW_HIDE, ewWaitUntilTerminated, RemoveAppxPackageResultCode);
|
||||
if not WizardIsTaskSelected('addcontextmenufiles') then begin
|
||||
RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\{#RegValueName}ContextMenu');
|
||||
end;
|
||||
ShellExec('', 'powershell.exe', '-Command ' + AddQuotes('Remove-AppxPackage -Package ''{#AppxPackageFullname}'''), '', SW_HIDE, ewWaitUntilTerminated, RemoveAppxPackageResultCode);
|
||||
if not WizardIsTaskSelected('addcontextmenufiles') then begin
|
||||
RegDeleteKeyIncludingSubkeys({#EnvironmentRootKey}, 'Software\Classes\{#RegValueName}ContextMenu');
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user