comparison makeinst-script.sh @ 3357:456b6e533054

makeinst-script.sh: Added checking for Java Runtime Environment
author Anirudha Bose <ani07nov@gmail.com>
date Thu, 25 Jul 2013 01:52:08 +0530
parents 2e44e8f86cd6
children 8708b7d07795
comparison
equal deleted inserted replaced
3356:2e44e8f86cd6 3357:456b6e533054
84 !insertmacro MUI_LANGUAGE "English" 84 !insertmacro MUI_LANGUAGE "English"
85 85
86 ###################################################################### 86 ######################################################################
87 87
88 RequestExecutionLevel admin 88 RequestExecutionLevel admin
89 89
90 Section ""
91 Call GetJRE
92 Pop \$R0
93
94 StrCpy \$0 '"\$R0" -classpath "\${CLASSPATH}" \${CLASS}'
95
96 SetOutPath \$EXEDIR
97 Exec \$0
98 SectionEnd
99
90 ; file section 100 ; file section
91 Section "MainFiles" 101 Section "MainFiles"
92 102
93 EOF 103 EOF
94 104
146 # last bit of the uninstaller 156 # last bit of the uninstaller
147 cat >> octave.nsi << EOF 157 cat >> octave.nsi << EOF
148 Delete "\$INSTDIR\*.*" 158 Delete "\$INSTDIR\*.*"
149 RmDir "\$INSTDIR" 159 RmDir "\$INSTDIR"
150 SectionEnd 160 SectionEnd
161
162 ; Function to check Java Runtime Environment
163 Function GetJRE
164 ; looks in:
165 ; 1 - .\jre directory (JRE Installed with application)
166 ; 2 - JAVA_HOME environment variable
167 ; 3 - the registry
168
169 Push \$R0
170 Push \$R1
171
172 ; use javaw.exe to avoid dosbox.
173 ; use java.exe to keep stdout/stderr
174 !define JAVAEXE "javaw.exe"
175
176 ClearErrors
177 StrCpy \$R0 "\$EXEDIR\jre\bin\\\${JAVAEXE}"
178 IfFileExists \$R0 JreFound ;; 1) found it locally
179 StrCpy \$R0 ""
180
181 ClearErrors
182 ReadEnvStr \$R0 "JAVA_HOME"
183 StrCpy \$R0 "\$R0\bin\\\${JAVAEXE}"
184 IfErrors 0 JreFound ;; 2) found it in JAVA_HOME
185
186 ClearErrors
187 ReadRegStr \$R1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
188 ReadRegStr \$R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\\\$R1" "JavaHome"
189 StrCpy \$R0 "\$R0\bin\\\${JAVAEXE}"
190
191 IfErrors 0 JreFound ;; 3) found it in the registry
192 IfErrors JRE_Error
193
194 JRE_Error:
195 MessageBox MB_ICONEXCLAMATION|MB_YESNO "Octave includes a Java integration component, but it seems Java is not available on this system. This component requires the Java Runtime Environment from Oracle (http://www.java.com) installed on your system. Octave can work without Java available, but the Java integration component will not be functional. Installing those components without Java available might prevent Octave from working correctly. Proceed with installation anyway?" IDYES continue
196 Abort
197 JreFound:
198 Pop \$R1
199 Exch \$R0
200 MessageBox MB_OK "Java Runtime Environment was found on your system. Octave will be able to call Java methods."
201 continue:
202 FunctionEnd
151 EOF 203 EOF
152 204
153 echo "Generation Completed" 205 echo "Generation Completed"