remm        01/12/19 10:00:35

  Modified:    .        Tag: tomcat_40_branch build.xml tomcat.nsi
  Log:
  - Port enhancements to the installer script, including:
    - installer file size reduction, without any change to what is actually in the
      archive (from 6.4M to 3.9M)
    - use of JAVA_HOME, if present, to find the JDK path
    - update to NSIS 1.91
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.38.2.10 +2 -2      jakarta-tomcat-4.0/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/build.xml,v
  retrieving revision 1.38.2.9
  retrieving revision 1.38.2.10
  diff -u -r1.38.2.9 -r1.38.2.10
  --- build.xml 2001/10/27 01:13:00     1.38.2.9
  +++ build.xml 2001/12/19 18:00:35     1.38.2.10
  @@ -221,7 +221,7 @@
       <copy file="${javaservice.home}/bin/JavaService.exe" 
        tofile="${tomcat.dist}/bin/tomcat.exe" />
       <copy file="tomcat.nsi" tofile="${tomcat.dist}/tomcat.nsi" />
  -    <exec dir="${tomcat.dist}" executable="${nsis.home}\makensis.exe">
  +    <exec dir="${tomcat.dist}" executable="${nsis.home}\makensis-bz2.exe">
         <arg value="tomcat.nsi" />
       </exec>
       <move file="${tomcat.dist}/tomcat4.exe" 
  @@ -269,9 +269,9 @@
     <target name="prepare-release">
       <condition property="execute.installer">
         <and>
  -        <equals arg1="${full.dist}" arg2="on" />
           <os family="windows" />
           <available file="${javaservice.home}/bin/JavaService.exe" />
  +        <available file="${nsis.home}\makensis-bz2.exe" />
         </and>
       </condition>
     </target>
  
  
  
  1.16.2.3  +76 -50    jakarta-tomcat-4.0/tomcat.nsi
  
  Index: tomcat.nsi
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/tomcat.nsi,v
  retrieving revision 1.16.2.2
  retrieving revision 1.16.2.3
  diff -u -r1.16.2.2 -r1.16.2.3
  --- tomcat.nsi        2001/10/05 00:26:01     1.16.2.2
  +++ tomcat.nsi        2001/12/19 18:00:35     1.16.2.3
  @@ -1,6 +1,6 @@
   
   ; Tomcat 4 script for Nullsoft Installer
  -; $Id: tomcat.nsi,v 1.16.2.2 2001/10/05 00:26:01 remm Exp $
  +; $Id: tomcat.nsi,v 1.16.2.3 2001/12/19 18:00:35 remm Exp $
   
   Name "apache-tomcat-4.0"
   Caption "Apache Tomcat 4.0"
  @@ -50,19 +50,21 @@
     File /r webapps\manager
     File /r webapps\ROOT
   
  -  ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion"
  -  ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$1" "JavaHome"
  +  Call findJavaPath
  +  Pop $2
   
     CopyFiles "$2\lib\tools.jar" "$INSTDIR\common\lib" 4500
   
  +  WriteUninstaller "$INSTDIR\uninst-tomcat4.exe"
  +
   SectionEnd
   
   Section "NT Service (NT/2k/XP only)"
   
     SectionIn 3
   
  -  ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
  -  ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$1" "RuntimeLib"
  +  Call findJVMPath
  +  Pop $2
     
     SetOutPath $INSTDIR\bin
     File /oname=tomcat.exe bin\tomcat.exe
  @@ -96,8 +98,8 @@
   
     SectionIn 1 2 3
   
  -  ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
  -  ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$1" "JavaHome"
  +  Call findJavaPath
  +  Pop $2
   
     SetOutPath "$SMPROGRAMS\Apache Tomcat 4.0"
   
  @@ -186,10 +188,6 @@
   
     SetOverwrite on
   
  -  ; since the installer is now created last (in 1.2+), this makes sure 
  -  ; that any old installer that is readonly is overwritten.
  -  Delete $INSTDIR\uninst-tomcat4.exe 
  -
     WriteRegStr HKLM "SOFTWARE\Apache\Apache Tomcat 4.0" "" $INSTDIR
     WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache 
Tomcat 4.0" \
                      "DisplayName" "Apache Tomcat 4.0 (remove only)"
  @@ -205,71 +203,99 @@
   Function .onInit
   
     ClearErrors
  +
  +  Call findJavaPath
  +  Pop $1
  +  MessageBox MB_OK "Using Java Development Kit found in $1"
  +
  +FunctionEnd
  +
  +
  +Function .onInstSuccess
   
  -  Call doUpdate
  +  ExecShell open '$SMPROGRAMS\Apache Tomcat 4.0'
  +
  +FunctionEnd
   
  -  ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion"
  -  ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$1" "JavaHome"
  +
  +; =====================
  +; FindJavaPath Function
  +; =====================
  +;
  +; Find the JAVA_HOME used on the system, and put the result on the top of the
  +; stack
  +; Will exit if the path cannot be determined
  +;
  +Function findJavaPath
  +
  +  ClearErrors
  +
  +  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"
  -
  -FunctionEnd
  -
  -
  -Function .onInstSuccess
   
  -  ExecShell open '$SMPROGRAMS\Apache Tomcat 4.0'
  +  ; Put the result in the stack
  +  Push $1
   
   FunctionEnd
   
  -
  -Function doUpdate
  -
  -  ; This function will be called if a previous Tomcat 4.0 installation has been
  -  ; found
   
  -  ReadRegStr $1 HKLM "SOFTWARE\Apache\Apache Tomcat 4.0" ""
  -  IfErrors NoUpdate
  +; ====================
  +; FindJVMPath Function
  +; ====================
  +;
  +; Find the full JVM path, and put the result on top of the stack
  +; Will exit if the path cannot be determined
  +;
  +Function findJVMPath
  +
  +  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:
   
  -  MessageBox MB_YESNO|MB_ICONQUESTION \
  -      "A previous installation of Jakarata Tomcat 4.0 has been found in $1.\
  - Do you want to upgrade it to the latest version ?" IDNO NoUpdate
  +  IfErrors 0 FoundJVMPath
   
  -  SetOverwrite ifnewer
  -  SetOutPath $INSTDIR
  -  File tomcat.ico
  -  File LICENSE
  -  File /r bin
  -  File /r common
  -  File /r lib
  -  File /r classes
  -  File /r logs
  -  File /r server
  -  File /r work
  -  SetOutPath $INSTDIR\webapps
  -  File /r webapps\manager
  -  File /r webapps\ROOT
  +  ClearErrors
   
  -  MessageBox MB_OK "Update was successful."
  +  ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
  +  ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$1" "RuntimeLib"
  +  
  +  FoundJVMPath:
  +  
  +  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
   
  -  ; Installation over
  -  Abort
  +  NoAbort:
   
  -NoUpdate:
  +  ; Put the result in the stack
  +  Push $2
   
   FunctionEnd
   
   
   UninstallText "This will uninstall Apache Tomcat 4.0 from your system:"
  -UninstallExeName uninst-tomcat4.exe
   
   
   Section Uninstall
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to