If updating with MSI installation package the CurrentVersion string value gets removed from the Registry
- Dominant language
- Jinja
- Stars
- 168
- Forks
- 77
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 11
Description
### Please provide a brief summary of the bug
Updating from `OpenJDK17U-jre_x64_windows_hotspot_17.0.14_7.msi` to `OpenJDK17U-jre_x64_windows_hotspot_17.0.15_6.msi` removes a registry value "CurrentVersion"
### Did you test with the latest update version?
- [x] Yes
### Please provide steps to reproduce where possible
- Start the nstallation of the MSI package OpenJDK17U-jre_x64_windows_hotspot_17.0.14_7.msi on a Windows computer e.g. Windows Server 2019
- Select Install for all users of this machine
- At "Custom Setup" select to install "JavaSoft (Oracle) registry keys
- Query the following Registry key:
```
C:\>reg query "HKLM\SOFTWARE\JavaSoft\JRE"
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE
CurrentVersion REG_SZ 17
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE\17
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE\17.0.14.7
```
- Update the JRE installation with the package OpenJDK17U-jre_x64_windows_hotspot_17.0.15_6.msi
- Leave the "JavaSoft (Oracle) registry keys" setting in the "will be installed" state
- Again query the same Registry key as before:
```
C:\>reg query "HKLM\SOFTWARE\JavaSoft\JRE"
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE\17
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE\17.0.15.6
```
As you can see the "CurrentVersion" string-value doesn't exist any more.
----------------
When the JRE gets uninstalled via control panel and package `OpenJDK17U-jre_x64_windows_hotspot_17.0.15_6.msi` gets freshly installed, the CurrentVersion String-value gets created:
```
C:\>java -version
openjdk version "17.0.15" 2025-04-15
OpenJDK Runtime Environment Temurin-17.0.15+6 (build 17.0.15+6)
OpenJDK 64-Bit Server VM Temurin-17.0.15+6 (build 17.0.15+6, mixed mode, sharing)
C:\>reg query "HKLM\SOFTWARE\JavaSoft\JRE"
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE
CurrentVersion REG_SZ 17
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE\17
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE\17.0.15.6
```
### Expected Results
The `CurrentVersion` string value should persist as some programs rely on it.
### Actual Results
The `CurrentVersion` string value is removed after the update.
### What Java Version are you using?
C:\>java --version openjdk 17.0.15 2025-04-15 OpenJDK Runtime Environment Temurin-17.0.15+6 (build 17.0.15+6) OpenJDK 64-Bit Server VM Temurin-17.0.15+6 (build 17.0.15+6, mixed mode, sharing)
### What is your operating system and platform?
OS Name: Microsoft Windows Server 2019 Standard
OS Version: 10.0.17763 N/A Build 17763
OS Manufacturer: Microsoft Corporation
System Type: x64-based PC
### How did you install Java?
Via the package OpenJDK17U-jre_x64_windows_hotspot_17.0.15_6.msi or OpenJDK17U-jdk_x64_windows_hotspot_17.0.15_6.msi
### Did it work before?
```Shell
In package OpenJDK17U-jre_x64_windows_hotspot_17.0.14_7.msi the "CurrentVersion" String value existed under "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE"
```
### Did you test with other Java versions?
```Shell
Same behaviour could be observed by updating from jdk-21.0.5.11-hotspot to OpenJDK21U-jdk_x64_windows_hotspot_21.0.7_6.msi
C:\WINDOWS\system32>reg query "HKLM\SOFTWARE\JavaSoft\JDK"
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK
CurrentVersion REG_SZ 21
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK\21
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK\21.0.5.11
after update:
C:\>reg query "HKLM\SOFTWARE\JavaSoft\JDK"
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK\21
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK\21.0.7.6
With Oracle Java the String Value in the Registry persists after update:
C:\>java -version
java version "21.0.7" 2025-04-15 LTS
Java(TM) SE Runtime Environment (build 21.0.7+8-LTS-245)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.7+8-LTS-245, mixed mode, sharing)
C:\>reg query "HKLM\SOFTWARE\JavaSoft\JDK"
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK
CurrentVersion REG_SZ 21.0.7
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK\21.0.7
```
### Relevant log output
```Shell
```
Contributor guide
Assessment
This issue has not been assessed yet.