From 1fc5c8625f649b43d93f23a5fa1ba16773f2d0db Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 6 Feb 2015 03:03:58 -0800 Subject: [PATCH] windows: Look for current Java version in \SOFTWARE\Wow6432Node I have no idea what this is, but I found the Java version down in there... Signed-off-by: Keith Packard --- altosui/Instdrv/NSIS/Includes/java.nsh | 36 ++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/altosui/Instdrv/NSIS/Includes/java.nsh b/altosui/Instdrv/NSIS/Includes/java.nsh index cd47c1b5..d989ddd6 100644 --- a/altosui/Instdrv/NSIS/Includes/java.nsh +++ b/altosui/Instdrv/NSIS/Includes/java.nsh @@ -42,7 +42,7 @@ Function DoDetectJRE ReadRegStr $2 HKCU "SOFTWARE\JavaSoft\Java Runtime Environment" \ "CurrentVersion" - IfErrors hklm_version + IfErrors hkcuwow_version DetailPrint "HKEY_CURRENT_USER Java version $2" @@ -50,6 +50,22 @@ Function DoDetectJRE IntCmp $3 1 yes yes no +hkcuwow_version: + + ; Check in HKCU Wow6432Node for CurrentVersion + + ClearErrors + ReadRegStr $2 HKCU "SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment" \ + "CurrentVersion" + + Iferrors hklm_version + + DetailPrint "HKEY_CURRENT_USER Wow6432Node Java version $2" + + ${VersionCompare} $2 ${JRE_VERSION} $3 + + IntCmp $3 1 yes yes no + hklm_version: ; Check in HKLM for CurrentVersion @@ -58,7 +74,7 @@ hklm_version: ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \ "CurrentVersion" - IfErrors hkcu_any + IfErrors hklmwow_version DetailPrint "HKEY_LOCAL_MACHINE Java version $2" @@ -66,6 +82,22 @@ hklm_version: IntCmp $3 1 yes yes no +hklmwow_version: + + ; Check in HKLM Wow6432Node for CurrentVersion + + ClearErrors + ReadRegStr $2 HKLM "SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment" \ + "CurrentVersion" + + Iferrors hkcu_any + + DetailPrint "HKEY_LOCAL_MACHINE Wow6432Node Java version $2" + + ${VersionCompare} $2 ${JRE_VERSION} $3 + + IntCmp $3 1 yes yes no + hkcu_any: ; Check in HKCU for any Java install -- 2.30.2