remm 01/11/17 14:32:30 Modified: . tomcat.nsi Log: - Justin Frankel (the author of WinAMP as well of NSIS) recently added environment variable support to NSIS, so it's now possible to use the value of JAVA_HOME. - If JAVA_HOME isn't found, the installer will check the registry. - Note: There's still a hack to make the service installation work, as JavaService needs the full path to the JVM DLL to be specified. The hack works with JDK 1.3 and 1.4 (and possibly other versions). - With JDK 1.4, the server VM is used (it starts up slower, but should be faster overall). Since the system service would be mostly used in a pure server deployment, I think it's reasonable. - This patch will be ported to the 4.0 branch, as the lack of support for JAVA_HOME has caused a lot of bugs reports and questions in tomcat-user (unfortunately, I couldn't fix it until now). Revision Changes Path 1.20 +42 -4 jakarta-tomcat-4.0/tomcat.nsi Index: tomcat.nsi =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- tomcat.nsi 2001/11/06 08:44:34 1.19 +++ tomcat.nsi 2001/11/17 22:32:30 1.20 @@ -1,6 +1,6 @@ ; Tomcat 4 script for Nullsoft Installer -; $Id: tomcat.nsi,v 1.19 2001/11/06 08:44:34 remm Exp $ +; $Id: tomcat.nsi,v 1.20 2001/11/17 22:32:30 remm Exp $ Name "apache-tomcat-4.1" Caption "Apache Tomcat 4.1" @@ -49,9 +49,17 @@ File webapps\*.xml File /r webapps\ROOT + ReadEnvStr $2 JAVA_HOME + + IfErrors 0 FoundJDK + + ClearErrors + ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion" ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$1" "JavaHome" + FoundJDK: + CopyFiles "$2\lib\tools.jar" "$INSTDIR\common\lib" 4500 SectionEnd @@ -60,9 +68,23 @@ SectionIn 3 + ReadEnvStr $1 JAVA_HOME + IfFileExists $1\jre\bin\hotspot\jvm.dll 0 TryJDK14 + StrCpy $2 $1\jre\bin\hotspot\jvm.dll + Goto EndIfFileExists + TryJDK14: + StrCpy $2 $1\jre\bin\server\jvm.dll + EndIfFileExists: + + IfErrors 0 FoundJDK + + ClearErrors + ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion" ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$1" "RuntimeLib" + FoundJDK: + SetOutPath $INSTDIR\bin File /oname=tomcat.exe bin\tomcat.exe @@ -95,9 +117,17 @@ SectionIn 1 2 3 + ReadEnvStr $2 JAVA_HOME + + IfErrors 0 FoundJDK + + ClearErrors + ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion" ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$1" "JavaHome" + FoundJDK: + SetOutPath "$SMPROGRAMS\Apache Tomcat 4.1" CreateShortCut "$SMPROGRAMS\Apache Tomcat 4.1\Tomcat Home Page.lnk" \ @@ -207,18 +237,26 @@ Call doUpdate - ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion" - ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$1" "JavaHome" + ReadEnvStr $1 JAVA_HOME + + IfErrors 0 FoundJDK + + ClearErrors + + ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion" + ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$2" "JavaHome" ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion" ReadRegStr $4 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$3" "RuntimeLib" + FoundJDK: + IfErrors 0 NoAbort MessageBox MB_OK "Couldn't find a Java Development Kit installed on this \ computer. Please download one from http://java.sun.com." Abort NoAbort: - MessageBox MB_OK "Using Java Development Kit version $1 found in $2$\r$\nUsing Java Runtime Environment version $3 found in $4" + MessageBox MB_OK "Using Java Development Kit found in $1" FunctionEnd
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>