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 $1 HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice" "Progid"
65 StrCpy $1 "IE.AssocFile.HTM"
69 StrCpy $2 "\shell\open\command"
73 ReadRegStr $0 HKCR $3 ""
80 StrCmp $1 $2 +2 # if path is not enclosed in " look for space as final char
106 Call openLinkNewWindow
109 !define OpenURL '!insertmacro "_OpenURL"'
113 DetailPrint "Desired Java version ${JAVA_VERSION}"
115 SearchPath $0 javaw.exe
118 DetailPrint "Detected java in $0"
120 ${GetFileVersion} "$0" $1
123 DetailPrint "Java version $1"
125 ${VersionCompare} $1 ${JAVA_VERSION} $2
126 IntCmp $2 1 yes yes old
153 ${OpenURL} "java.com"
154 MessageBox MB_OK "Click OK to continue after completing the Java Install."
161 IntCmp $0 1 ask_old ask_no yes
164 StrCpy $0 "Cannot find Java. Download and install?"
168 StrCpy $0 "Java version appears to be too old. Download and install?"
172 MessageBox MB_YESNOCANCEL $0 IDYES do_java IDNO skip_java