Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions build/win32/code.iss
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ Source: "bin\{#ApplicationName}.cmd"; DestDir: "{code:GetDestDir}\bin"; DestName
Source: "bin\{#ApplicationName}"; DestDir: "{code:GetDestDir}\bin"; DestName: "{code:GetBinDirApplicationFilename}"; Flags: ignoreversion
Source: "{#ProductJsonPath}"; DestDir: "{code:GetDestDir}\{#VersionedResourcesFolder}\resources\app"; Flags: ignoreversion
#ifdef AppxPackageName
Source: "appx\{#AppxPackage}"; DestDir: "{code:GetDestDir}\{#VersionedResourcesFolder}\appx"; BeforeInstall: RemoveAppxPackage; Flags: ignoreversion; Check: ShouldUseWindows11ContextMenu
Source: "appx\{#AppxPackageDll}"; DestDir: "{code:GetDestDir}\{#VersionedResourcesFolder}\appx"; AfterInstall: AddAppxPackage; Flags: ignoreversion; Check: ShouldUseWindows11ContextMenu
Source: "appx\{#AppxPackage}"; DestDir: "{code:GetDestDir}\{#VersionedResourcesFolder}\appx"; BeforeInstall: RemoveAppxPackage; Flags: ignoreversion; Check: ShouldUseWindows11ContextMenu and ShouldInstallAppxPackage
Comment thread
YexuanXiao marked this conversation as resolved.
Source: "appx\{#AppxPackageDll}"; DestDir: "{code:GetDestDir}\{#VersionedResourcesFolder}\appx"; AfterInstall: AddAppxPackage; Flags: ignoreversion; Check: ShouldUseWindows11ContextMenu and ShouldInstallAppxPackage
#endif

[Icons]
Expand Down Expand Up @@ -1799,6 +1799,11 @@ begin
end;
#endif

function ShouldInstallAppxPackage(): Boolean;
begin
Result := WizardIsTaskSelected('addcontextmenufiles') or WizardIsTaskSelected('addcontextmenufolders');
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
UpdateResultCode: Integer;
Expand All @@ -1811,8 +1816,8 @@ begin
#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
// installed but now wants the classic context menu style or it is disabled.
if IsWindows10ContextMenuForced() or not ShouldInstallAppxPackage() then begin
RemoveAppxPackage();
end;
// Remove the old context menu registry keys
Expand Down
Loading