Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corretto msi installers leave behind windows registry keys on uninstall #301

Open
1spiderlily opened this issue Dec 12, 2022 · 9 comments
Open

Comments

@1spiderlily
Copy link

The Corretto msi installers (both Java 11 and 17, and probably more) leave behind their windows registry keys on uninstall. This confused our application, because our launcher was still checking that registry key, even though we are now using a custom Java runtime. We would have found our bug sooner if Corretto's uninstaller had removed the registry key, but unfortunately, our customer ran into it when they could not launch our application.

@rgithubli
Copy link
Contributor

rgithubli commented Dec 12, 2022

Hi,

Thanks for reporting the issue.

Could you specify:

  1. What registry keys were not removed?
  2. How did you remove the jdk? (Using MSI or other manual processes)

Currently I can't repro. My uninstallation was clean. The keys under HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK were all removed.

@rgithubli
Copy link
Contributor

Hi, we haven't heard response for 3 weeks. We're closing this issue for now. If you still encounter the issue, please reopen the issue and provide the information we asked above. Thanks.

@1spiderlily
Copy link
Author

Hello, I never got a notification that anyone replied, and I checked back a few times. The Amazon Corretto Java 11 MSI JDK 64-bit installer leaves the registry key behind after uninstall. I had screenshots, but I'm unable to attach them.

The key that is left behind:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK\11.0.17\MSI

How do I reopen this ticket?

@1spiderlily
Copy link
Author

@1spiderlily
Copy link
Author

I successfully attached my doc.

@1spiderlily
Copy link
Author

1spiderlily commented Jan 4, 2023

@rgithubli please reopen this ticket. I apparently don't have permissions to do so.

@rgithubli
Copy link
Contributor

Re-opening the ticket.

OK, I can repro now. The key to repro is to have both 11 and 17 installed at the same time first. When only a single version is installed, the removal is clean.

Repro steps:

  1. Install 11 and 17 via msi. 11 download. 17 download. Observe registry. You'll see both 11 and 17 have entries under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK
  2. Uninstall 11 using msi. Refresh registry. 11 entry is still there.
  3. Uninstall 17 using msi. Refresh registry. 17 entry will be gone.

When I went back to 11 msi hoping to re-uninstall, it already behaved as if there was no 11 installed and the only option is to install it again.

If I uninstall 17 first, 17 registry entry will be left. That is, the version that is uninstalled first will have its registry entry uncleaned.

We'll look into this issue. As a temporary work around, you can reinstall the uncleaned java and then uninstall it again.

@rgithubli rgithubli reopened this Jan 5, 2023
@rgithubli
Copy link
Contributor

Discussed with the team. The reason why registry key wouldn't be cleaned up is because the later installed version became the owner of JDK registry key. When uninstalling, only the last installed version would be able to clean its entry under JDK registry key.

As for the priority, this doesn't seem a high priority issue. Unfortunately the fix will not be part of Q1 release (01/17/2023). We plan to make the fix as part of Q2.

Meanwhile, as a workaround, are you able to not rely on the registry key to detect jdk instead?

@1spiderlily
Copy link
Author

Thank you, @rgithubli! A fix in Q2 would be fine. We have already fixed our application launcher to gracefully handle orphaned registry keys, so we are good. Your fix will make sure other developers do not encounter this issue. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants