Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update the Windows installer to search the new (as of Java 9) registry locations when looking for a JRE.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1811861 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Oct 11, 2017
1 parent 287683a commit 3a947eb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
32 changes: 26 additions & 6 deletions res/tomcat.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -854,26 +854,46 @@ Function findJavaHome
ExpandEnvStrings $0 "%PROGRAMW6432%"
${If} $0 != "%PROGRAMW6432%"
SetRegView 64
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2" "JavaHome"
ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2" "RuntimeLib"
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\JRE" "CurrentVersion"
ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\JRE\$2" "JavaHome"
ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\JRE\$2" "RuntimeLib"

IfErrors 0 +2
StrCpy $1 ""
ClearErrors

${If} $1 == ""
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2" "JavaHome"
ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2" "RuntimeLib"

IfErrors 0 +2
StrCpy $1 ""
ClearErrors
${EndIf}
${EndIf}

; If no 64-bit Java was found, look for 32-bit Java
${If} $1 == ""
SetRegView 32
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2" "JavaHome"
ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2" "RuntimeLib"
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\JRE" "CurrentVersion"
ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\JRE\$2" "JavaHome"
ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\JRE\$2" "RuntimeLib"

IfErrors 0 +2
StrCpy $1 ""
ClearErrors

${If} $1 == ""
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2" "JavaHome"
ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2" "RuntimeLib"

IfErrors 0 +2
StrCpy $1 ""
ClearErrors
${EndIf}

; If using 64-bit, go back to using 64-bit registry
${If} $0 != "%PROGRAMW6432%"
SetRegView 64
Expand Down
4 changes: 4 additions & 0 deletions webapps/docs/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@
<bug>61590</bug>: Enable <code>service.bat</code> to recognise when
<code>JAVA_HOME</code> is configured for a Java 9 JDK. (markt)
</fix>
<fix>
<bug>61598</bug>: Update the Windows installer to search the new (as of
Java 9) registry locations when looking for a JRE. (markt)
</fix>
</changelog>
</subsection>
</section>
Expand Down

0 comments on commit 3a947eb

Please sign in to comment.