MSI: RegKey "CurrentVersion" is not set on latest Adoptium JDK8 build
To reproduce
- Install 8u292 with install option
JavaSoft (Oracle) Registry Keys - Install 8u302 with same install option
Observed behaviour
- After 292 install, entry for
HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development KitCurrentVersion=1.8 - After 302 install, this entry is not there. The child entries are there (i.e 1.8 folder and 8.0.302.8 folder)
Expected behaviour
- CurrentVersion should still be set to 1.8
Screenshots


Suspected change
https://github.com/adoptium/installer/commit/e178aefa05d159b0f031ebfff3d543ee8f6103a7 https://github.com/adoptium/installer/pull/307 https://github.com/adoptium/installer/issues/300
I don't quite understand this condition
<Condition><![CDATA[JAVASOFT_CURRENTVERSION <> "1.8" AND JAVASOFT_CURRENTVERSION < $(var.ProductMajorVersion)]]></Condition>
Says if current version (installed) is 1.8 and current version is less than major version we're building (8), then set CurrentVersion. So it should work? Not sure why it doesn't or why that condition is there. But, this is a bit beyond me.
If I change it to the following, it works
<Condition><![CDATA[$(var.ProductMajorVersion) <> "8"]]></Condition>
But If I install one with the patch, with no previous install, I don't get the reg values. So I'm not sure what's going on.
@douph1 Do you have a comment on this issue? We likely need to respin the MSI's again.
This condition is here to overide the reg key only if the new major version from the running installer is greater than the previous one installed.
JAVASOFT_CURRENTVERSION
is read from the regritry. If the new var.ProductMajorVersion is greater ( installing java17 over java16) then we overiding the reg key. If we install java11 after java16 .. the key is unchanged. JAVASOFT_CURRENTVERSION must pointing to the highest version.
https://www.oracle.com/java/technologies/javase/runtime-windows.html Note that CurrentVersion is set only if the version being installed is the highest version number on the machine. For example, if JRE 1.5.0 already exists on a machine on which 1.6.0 is being installed (also called 6), then CurrentVersion will be set to 1.6. If 1.6.0 is installed first, and then 1.5.0 is installed, CurrentVersion will remain set to 1.6.
But, we can't compare numericaly 1.8 and 11, we test first if JAVASOFT_CURRENTVERSION <> "1.8" then compare 11 vs 16 for exemple. I have fixed the wrong comparaison order "<" in 26d01e8e818d0b956e86e9746268015d11904319 but not fixed the jdk8 specific case
See linked PR #341 for the fix, you can test the artefact build via github action.
@douph1 I'm not convinced this is fixed. It still seems that with my latest msi installer the CerrentVersion entry is being removed from the previous working version.
@douph1 @karianna
Same case with Temurin 8u312, if I upgrade from 292 to 312, JavaSoft->Java Development Kit->CurrentVersion=1.8 is removed.
If I do a fresh install of Temurin 312 or Semeru 312 it is set properly to 1.8. It makes me believe that the next release will be the same way. That is, If 312 is upgraded, the value will be removed but if I uninstall first, then it is fine.