Corretto msi installers leave behind windows registry keys on uninstall
1spiderlily opened this issue · 9 comments
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.
Hi,
Thanks for reporting the issue.
Could you specify:
- What registry keys were not removed?
- 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.
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.
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?
I successfully attached my doc.
@rgithubli please reopen this ticket. I apparently don't have permissions to do so.
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:
- 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
- Uninstall 11 using msi. Refresh registry. 11 entry is still there.
- 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.
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?
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!