Skip to content

#2251: add uninstall support for global tools windows - #2301

Open
cap-juan wants to merge 3 commits into
devonfw:mainfrom
cap-juan:feature/2251-uninstall-global-tools-windows
Open

#2251: add uninstall support for global tools windows#2301
cap-juan wants to merge 3 commits into
devonfw:mainfrom
cap-juan:feature/2251-uninstall-global-tools-windows

Conversation

@cap-juan

@cap-juan cap-juan commented Aug 10, 2026

Copy link
Copy Markdown

This PR fixes #2251

Implemented changes:

  • Use getWindowsRegistryAppName() instead of the generic tool name when uninstalling global tools on Windows.
  • This ensures that the same registry application name used for installation detection is also used to locate the correct uninstall entry.

Testing instructions

  1. Build IDEasy locally while executing ./build-local-dev.sh.
  2. Install a supported global tool on Windows e.g. ide install pgAdmin.
  3. Run ide -d uninstall pgadmin.
  4. Verify that IDEasy detects the installed pgAdmin application via the Windows registry and starts the uninstall process instead of reporting "Couldn't uninstall pgadmin because we could not find an installation"

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat and not feature/921 fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summaries what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labelled
    with internal
  • You have not changed any dependency in pom.xml files or otherwise if runtime dependencies changed, you have updated our LICENSE.asciidoc
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Aug 10, 2026
@cap-juan
cap-juan force-pushed the feature/2251-uninstall-global-tools-windows branch 2 times, most recently from 86cac90 to 15b6180 Compare August 10, 2026 12:52
@cap-juan cap-juan changed the title Feature/2251 uninstall global tools windows Feature/2251 add uninstall support for global tools windows Aug 10, 2026
@cap-juan cap-juan moved this from 🆕 New to Team Review in IDEasy board Aug 10, 2026
@cap-juan cap-juan self-assigned this Aug 10, 2026
@cap-juan cap-juan added enhancement New feature or request windows specific for Microsoft Windows OS uninstall uninstall tools or IDEasy itself labels Aug 10, 2026
@cap-juan
cap-juan force-pushed the feature/2251-uninstall-global-tools-windows branch from 15b6180 to cbae6d3 Compare August 10, 2026 12:58
@coveralls

coveralls commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 31963401188

Warning

No base build found for commit 31dabbf on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 72.887%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 17566
Covered Lines: 13351
Line Coverage: 76.0%
Relevant Branches: 7765
Covered Branches: 5112
Branch Coverage: 65.83%
Branches in Coverage %: Yes
Coverage Strength: 3.23 hits per line

💛 - Coveralls

@hohwille hohwille changed the title Feature/2251 add uninstall support for global tools windows #2251: add uninstall support for global tools windows Aug 11, 2026
@cap-juan
cap-juan force-pushed the feature/2251-uninstall-global-tools-windows branch from cbae6d3 to bab534c Compare August 11, 2026 07:41
@krystynaShatkovska
krystynaShatkovska self-requested a review August 13, 2026 10:11
@krystynaShatkovska

Copy link
Copy Markdown
Contributor

Good work. All unit tests are passed. Could not test with pgAdmin installation as it does not work in my enviroment

@krystynaShatkovska krystynaShatkovska moved this from Team Review to 👀 In review in IDEasy board Aug 14, 2026
@JoelAdbu JoelAdbu moved this from 👀 In review to Team Review in IDEasy board Aug 14, 2026
@JoelAdbu JoelAdbu self-assigned this Aug 14, 2026

@JoelAdbu JoelAdbu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also tested the installation and uninstallation of pgAdmin. Everything works perfectly. Well done!

@JoelAdbu JoelAdbu moved this from Team Review to 👀 In review in IDEasy board Aug 14, 2026

@hohwille hohwille left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cap-juan thanks for your PR. Your approach looks good and make fully sense 👍
I left some comments for improvement. Please address so we can merge.

private String findUninstallKey(String appName) {

for (String registryBasePath : REGISTRY_BASE_PATHS) {
LOG.warn("Searching registry for {} in {}", appName, registryBasePath);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a reasonable warning. Was that added for debugging and accidentally committed?
Otherwise this should be debug or trace.

Comment on lines +264 to +283
WindowsHelperImpl helper = new WindowsHelperImpl(context) {

@Override
public WindowsAppInstallation getAppInstallationFromRegistry(
String requestedAppName) {

assertThat(requestedAppName).isEqualTo(appName);

return new WindowsAppInstallation(
"1.0",
null,
uninstallString,
"C:\\Program Files\\Test");
}

@Override
protected void executeUninstallCommand(String command) {
capturedCommand[0] = command;
}
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of putting multiple redundant such anonymous classes into tests, you should simply extend WindowsHelperMock properly. I see two options:

  1. override uninsallApplication to simply remove the app from registry Map.
  2. override the executeUninstallCommand to capture the executed uninstall command without actually executing it and give a way to access it from tests e.g. via getter or even custom assertThat like we did for our logs.
  3. do not override anything and just register a test application with uninstall command echo test application has been uninstalled so you can assert that test application has been uninstalled was logged.

Comment thread CHANGELOG.adoc
* https://github.com/devonfw/IDEasy/issues/2131[#2131]: Improve `ide upgrade --mode=` auto-completion
* https://github.com/devonfw/IDEasy/issues/1870[#1870]: Add generic get-version implementation for global tools under windows
* https://github.com/devonfw/IDEasy/issues/1558[#1558]: Added installation log information to the "Select Project Folder" and exit dialogs and enhanced `windows-installer/README.adoc`.
* https://github.com/devonfw/IDEasy/issues/2251[#2251]: Provide generic uninstall support for globally installed tools (windows)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review. You need to move this up to the current release.

@hohwille hohwille added this to the release:2026.08.002 milestone Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request uninstall uninstall tools or IDEasy itself windows specific for Microsoft Windows OS

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

Provide generic uninstall support for globally installed tools (Windows)

6 participants