3 ; Definitions for Java Detection
5 !define JAVA_VERSION "6.0"
7 Function GetFileVersion
8 !define GetFileVersion `!insertmacro GetFileVersionCall`
10 !macro GetFileVersionCall _FILE _RESULT
25 GetDllVersion '$0' $1 $2
28 IntOp $3 $3 & 0x0000FFFF
29 IntOp $4 $1 & 0x0000FFFF
31 IntOp $5 $5 & 0x0000FFFF
32 IntOp $6 $2 & 0x0000FFFF
33 StrCpy $0 '$3.$4.$5.$6'
50 Function openLinkNewWindow
60 ReadRegStr $0 HKCR "http\shell\open\command" ""
65 StrCmp $1 $2 +2 # if path is not enclosed in " look for space as final char
91 Call openLinkNewWindow
94 !define OpenURL '!insertmacro "_OpenURL"'
98 DetailPrint "Desired Java version ${JAVA_VERSION}"
100 SearchPath $0 javaw.exe
103 DetailPrint "Detected java in $0"
105 ${GetFileVersion} "$0" $1
108 DetailPrint "Java version $1"
110 ${VersionCompare} $1 ${JAVA_VERSION} $2
111 IntCmp $2 1 yes yes old
138 ${OpenURL} "java.com"
139 MessageBox MB_OK "Click OK to continue after completing the Java Install."
146 IntCmp $0 1 ask_old ask_no yes
149 StrCpy $0 "Cannot find Java. Download and install?"
153 StrCpy $0 "Java version appears to be too old. Download and install?"
157 MessageBox MB_YESNOCANCEL $0 IDYES do_java IDNO skip_java