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

Windows: Installer option for JavaSoft registry entries missing #300

Closed
jpstotz opened this issue Mar 18, 2021 · 8 comments
Closed

Windows: Installer option for JavaSoft registry entries missing #300

jpstotz opened this issue Mar 18, 2021 · 8 comments
Assignees
Labels

Comments

@jpstotz
Copy link

jpstotz commented Mar 18, 2021

The latest version AdoptOpenJDK 11 version OpenJDK11U-jdk_x64_windows_hotspot_11.0.10_9.msi misses the option to create the JavaSoft registry entries.

Those entries are required by a lot of programs to find an existing JRE/JDK installation (e.g. Lauch4j).

@douph1
Copy link
Contributor

douph1 commented Mar 22, 2021

Sorry I don't see it missing but for some language the translation item name and desc seems not to work anymore.

Translation KO :

de-de 1031 cp1252
ja-jp 1041 cp932
zh-cn 2052 cp936
zh-tw 1028 cp950

What language are you using ? Can you share a screenshot ?

@jpstotz
Copy link
Author

jpstotz commented Mar 23, 2021

@douph1 My Windows system is using German, hence it should be de-de.

The installer dialog shows the following options on my system:

installer

Edit: The strange part is that the same installer on a different German Windows 10 system shows the JavaSoft (Oracle) registry keys installer entry.

@jpstotz
Copy link
Author

jpstotz commented Mar 23, 2021

I found the reason for this defect:

I have also installed AdoptOpenJDK 15 JDK for experiments.
This version has set the registry value HKLM\SOFTWARE\JavaSoft\JDK\CurrentVersion to 15.

If the installer detects this value then the option JavaSoft (Oracle) registry keys is not shown. If I rename this key the JavaSoft option is visible again.

This behavior does not make any sense to me. The JavaSoft registry values exist so that it is possible to detect all installed Java versions and select the best matching JDK/JRE. Therefore the JavaSoft option should be selectable no matter what other JREs/JDKs are already installed.

@douph1
Copy link
Contributor

douph1 commented Mar 24, 2021

see https://github.com/AdoptOpenJDK/openjdk-installer/blob/master/wix/Main.hotspot.wxs.template

   <!-- See https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-microsoft-windows-platforms.htm#JSJIG-GUID-47C269A3-5220-412F-9E31-4B8C37A82BFB -->
   <!-- As Oracle, don't override if current value is already bigger ( newer java ): "a value that is the highest installed version on the system" 

Oracle :

This key contains the string CurrentVersion, with a value that is the highest installed version on the system.

If we allow you to override CurrentVersion from JDK 15 with value from JDK11 we will not respect this.

@jpstotz
Copy link
Author

jpstotz commented Mar 24, 2021

@douph1 The option JavaSoft (Oracle) registry keys does not only write this value. In my opinion the registry value I mentioned is totally useless (therefore it is not a good idea to use it to determine if the installer option is shown or not), the more important registry values for a JDK 11 are:

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\11]
"JavaHome"="C:\\Program Files\\AdoptOpenJDK\\jdk-11.0.10.9-hotspot"

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK\11]
"JavaHome"="C:\\Program Files\\AdoptOpenJDK\\jdk-11.0.10.9-hotspot\\"

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK\11.0.10.9]
"JavaHome"="C:\\Program Files\\AdoptOpenJDK\\jdk-11.0.10.9-hotspot\\"

These are the values that really matters because they can be used to find an installed JDK.
And these values do not exist if you install AdoptOpenJDK 15, thus nothing is overwritten.

If the CurrentVersion entry is found you can just skip it but please allow the installer to write the other entries.

@douph1
Copy link
Contributor

douph1 commented Mar 24, 2021

Are you suggesting to have two installer options ?

  • One for CurrentVersion as now which is not display to not allow overriding bigger CurrentVersion already installed
  • another installer option to allow to write the other JavaSoft key ?

How two handle backward compat ?

@jpstotz
Copy link
Author

jpstotz commented Mar 24, 2021

That is not necessary. But if you want to mimic the Oracle behavior you can always show the JavaSoft option and if it is selected but HKLM\SOFTWARE\JavaSoft\JDK\CurrentVersion is set to a higher value just skip writing this value.

That would the the obvious logical way to handle such a situation in my opinion.

But please do never hide the JavaSoft installer option.

@karianna karianna added the bug label Mar 28, 2021
douph1 added a commit to douph1/openjdk-installer that referenced this issue Apr 17, 2021
douph1 added a commit to douph1/openjdk-installer that referenced this issue Apr 17, 2021
douph1 added a commit to douph1/openjdk-installer that referenced this issue Apr 17, 2021
douph1 added a commit to douph1/openjdk-installer that referenced this issue Apr 17, 2021
douph1 added a commit to douph1/openjdk-installer that referenced this issue Apr 17, 2021
@douph1
Copy link
Contributor

douph1 commented Jul 28, 2021

Seems it was fix by #307. Feel free to reopen if needed

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

No branches or pull requests

3 participants