Skip to content

make uninstall with --force also remove from software repo #809

@hohwille

Description

@hohwille

As a supporter of IDEasy, I want to have a simple way to repair broken installations of tools so that I do not need to explain users of IDEasy manual steps to delete folders in case of support requests for broken tool installations.

Currently ide uninstall «tool» will typically do nothing but deleting the link in $IDE_HOME/software/«tool» pointing to the software repo where the tool is physically installed.
Typically this is also what we want.
Besides other projects on the same machine might also have a link in their $IDE_HOME/software/«tool» pointing to the same software so we do not want to remove the physical installation. Also if the user later decides that he still needs the tool, it can be reinstalled in less than a second since we only need to re-create the link.

However, assuming the installation is broken: Maybe we had a bug in an older version of IDEasy and that got fixed but the bugfix is in the postExtract method that only gets called after the tool is installed into the software repository, then we need to physically remove and reinstall in order to get the bugfix working.

Therefore ide --force uninstall «tool» should not only remove the link but additionally remove the physical tool installation from the software repository: Therefore it should read the link target (see what ide get-edition «tool» is already doing in this regard).
From that resulting PATH we also need to consider our MacOS workaround and traverse up the folder hierarchy unless we have a PATH of the form $IDE_ROOT/_ide/software/default/«tool»/«edition»/«version».
By default this will already be the case but on MacOS this may also point to e.g. $IDE_ROOT/_ide/software/default/«tool»/«edition»/«version»/«tool».app/Contents/MacOS.

Once we have the proper path pointing to the «version» folder in the software repo, we will delete it from there.
We should log a warning message because this may break other IDE projects using the same tool installation.
But since the user provided --force he should be aware of that and the log message should explain this.
E.g.:

Phyically deleting ~/projects/_ide/software/default/intellij/intellij/2024.3 as requested by the user via force mode.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestuninstalluninstall tools or IDEasy itself

Projects

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions