Packager/InstallPkgSetDialog: Skip uninstalling base packages. Merge request !532.

This commit is contained in:
n7800 2025-07-16 03:11:33 +05:00 committed by Juha
parent df04887b85
commit 77c2bdcb4f
2 changed files with 8 additions and 8 deletions

View File

@ -3666,6 +3666,8 @@ resourcestring
lisUninstallImpossible = 'Uninstall impossible';
lisThePackageCanNotBeUninstalledBecauseItIsNeededByTh = 'The package %s can '
+'not be uninstalled because it is needed by the IDE itself.';
lisUninstBasePackagesSkipped =
'Some packages were not uninstalled because they are needed by the IDE itself.';
lisCodeToolsDefsNodeIsReadonly = 'Node is readonly';
lisCodeToolsDefsAutoGeneratedNodesCanNotBeEdited = 'Auto generated nodes '
+'cannot be edited.';

View File

@ -1315,6 +1315,7 @@ var
TVNode: TTreeNode;
PkgName: String;
FilteredBranch: TTreeFilterBranch;
lSomePackagesSkipped: boolean = false;
begin
NewSelectedIndex:=-1;
LastNonSelectedIndex:=-1;
@ -1337,14 +1338,11 @@ begin
continue;
end;
if IsBasePkg(DelPackageID) then begin
MessageDlg(
lisUninstallImpossible,
Format(lisThePackageCanNotBeUninstalledBecauseItIsNeededByTh, [PkgName]),
mtError,
[mbCancel],
0
);
exit;
if not lSomePackagesSkipped then begin
lSomePackagesSkipped := true;
MessageDlg(lisUninstallImpossible, lisUninstBasePackagesSkipped, mtInformation, [mbOK], 0);
end;
continue;
end;
// ok => add to deletions
Deletions.Add(DelPackageID);