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

MSI: RegKey "CurrentVersion" is not set on latest Adoptium JDK8 build #329

Open
AdamBrousseau opened this issue Aug 5, 2021 · 5 comments · Fixed by #341
Open

MSI: RegKey "CurrentVersion" is not set on latest Adoptium JDK8 build #329

AdamBrousseau opened this issue Aug 5, 2021 · 5 comments · Fixed by #341

Comments

@AdamBrousseau
Copy link
Contributor

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 Kit CurrentVersion=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

image

image

Suspected change

e178aef
#307
#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.

@AdamBrousseau
Copy link
Contributor Author

@douph1 Do you have a comment on this issue? We likely need to respin the MSI's again.

douph1 added a commit to douph1/openjdk-installer that referenced this issue Aug 17, 2021
@douph1
Copy link
Contributor

douph1 commented Aug 17, 2021

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 26d01e8 but not fixed the jdk8 specific case

@douph1
Copy link
Contributor

douph1 commented Aug 17, 2021

See linked PR #341 for the fix, you can test the artefact build via github action.

@douph1 douph1 linked a pull request Aug 17, 2021 that will close this issue
@douph1 douph1 changed the title MSI: CurrentVersion is removed on latest Adoptium build MSI: RegKey "CurrentVersion" is not set on latest Adoptium JDK8 build Aug 17, 2021
AdamBrousseau pushed a commit to AdamBrousseau/openjdk-installer that referenced this issue Aug 18, 2021
@AdamBrousseau
Copy link
Contributor Author

@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.

@AdamBrousseau
Copy link
Contributor Author

@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.

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

Successfully merging a pull request may close this issue.

3 participants