windows: Look for current Java version in \SOFTWARE\Wow6432Node
authorKeith Packard <keithp@keithp.com>
Fri, 6 Feb 2015 11:03:58 +0000 (03:03 -0800)
committerKeith Packard <keithp@keithp.com>
Fri, 6 Feb 2015 11:03:58 +0000 (03:03 -0800)
I have no idea what this is, but I found the Java version down in
there...

Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/Instdrv/NSIS/Includes/java.nsh

index cd47c1b..d989ddd 100644 (file)
@@ -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