Author: markt
Date: Fri Feb 24 12:19:46 2006
New Revision: 380807
URL: http://svn.apache.org/viewcvs?rev=380807&view=rev
Log:
Use procrun from commons-daemon rather than JavaService to enable Tomcat to run
as a service on Windows.
Modified:
tomcat/container/branches/tc4.1.x/BUILDING.txt
tomcat/container/branches/tc4.1.x/build.properties.default
tomcat/container/branches/tc4.1.x/build.xml
tomcat/container/branches/tc4.1.x/tomcat.nsi
Modified: tomcat/container/branches/tc4.1.x/BUILDING.txt
URL:
http://svn.apache.org/viewcvs/tomcat/container/branches/tc4.1.x/BUILDING.txt?rev=380807&r1=380806&r2=380807&view=diff
==============================================================================
--- tomcat/container/branches/tc4.1.x/BUILDING.txt (original)
+++ tomcat/container/branches/tc4.1.x/BUILDING.txt Fri Feb 24 12:19:46 2006
@@ -1,3 +1,4 @@
+
$Id$
@@ -506,17 +507,7 @@
own subdirectory.
-(31) JavaService
-
-* Download the JavaService package (version 1.2.0 or later) from:
-
- http://www.alexandriasc.com/software/JavaService/JavaService-bin-1.2.0.zip
-
-* Install the application into a convenient location so that it resides in its
- own subdirectory.
-
-
-(32) Run Ant
+(31) Run Ant
Open a command line shell, and issue the following commands:
@@ -525,10 +516,9 @@
-(33) Build the release distribution - OPTIONAL
+(32) Build the release distribution - OPTIONAL
Open a command line shell, and issue the following commands:
cd ${tomcat.source}/container
ant release
-
Modified: tomcat/container/branches/tc4.1.x/build.properties.default
URL:
http://svn.apache.org/viewcvs/tomcat/container/branches/tc4.1.x/build.properties.default?rev=380807&r1=380806&r2=380807&view=diff
==============================================================================
--- tomcat/container/branches/tc4.1.x/build.properties.default (original)
+++ tomcat/container/branches/tc4.1.x/build.properties.default Fri Feb 24
12:19:46 2006
@@ -170,11 +170,6 @@
commons-pool.loc=${base-jakarta.loc}/commons/pool/binaries/commons-pool-1.2.tar.gz
-# ----- JavaService, version 1.2.0 or later -----
-javaservice.home=${base.path}/javaservice
-javaservice.loc=http://www.alexandriasc.com/software/JavaService/JavaService-bin-1.2.0.zip
-
-
# ----- Java Database Connectivity (JDBC) Optional Package, version 2.0 -----
jdbc20ext.home=${base.path}/jdbc2_0-stdext
jdbc20ext.lib=${jdbc20ext.home}
Modified: tomcat/container/branches/tc4.1.x/build.xml
URL:
http://svn.apache.org/viewcvs/tomcat/container/branches/tc4.1.x/build.xml?rev=380807&r1=380806&r2=380807&view=diff
==============================================================================
--- tomcat/container/branches/tc4.1.x/build.xml (original)
+++ tomcat/container/branches/tc4.1.x/build.xml Fri Feb 24 12:19:46 2006
@@ -35,7 +35,6 @@
<!-- Build Defaults -->
<property name="catalina.build" value="${basedir}/catalina/build"/>
<property name="jasper.build" value="${jasper.home}/build"/>
- <property name="javaservice.home" value="../javaservice"/>
<property name="nsis.home" value="c:\program files\nsis"/>
<property name="servlet.home" value="${api.home}/dist"/>
<property name="tomcat.build" value="${basedir}/build"/>
@@ -285,8 +284,11 @@
</copy>
<copy file="${nsis.home}/Plugins/InstallOptions.dll"
todir="${tomcat.dist}" />
- <copy file="${javaservice.home}/bin/JavaService.exe"
- tofile="${tomcat.dist}/bin/tomcat.exe" />
+ <copy file="${jtc.home}/procrun/bin/tomcat5.exe"
+ tofile="${tomcat.dist}/bin/tomcat4.exe" />
+ <copy file="${jtc.home}/procrun/bin/tomcat5w.exe"
+ tofile="${tomcat.dist}/bin/tomcat4w.exe" />
+
<filter token="VERSION" value="${version}"/>
<copy file="tomcat.nsi" tofile="${tomcat.dist}/tomcat.nsi"
filtering="true"/>
@@ -339,7 +341,6 @@
<condition property="execute.installer">
<and>
<os family="windows" />
- <available file="${javaservice.home}/bin/JavaService.exe" />
<available file="${nsis.home}/makensis.exe" />
</and>
</condition>
@@ -505,11 +506,6 @@
<antcall target="downloadgz">
<param name="sourcefile" value="${commons-modeler.loc}"/>
<param name="destfile" value="${commons-modeler.jar}"/>
- </antcall>
- <antcall target="downloadzip">
- <param name="sourcefile" value="${javaservice.loc}"/>
- <param name="destfile" value="${javaservice.home}/bin/JavaService.exe"/>
- <param name="destdir" value="${javaservice.home}"/>
</antcall>
<antcall target="downloadgz">
<param name="sourcefile" value="${jmx.loc}"/>
Modified: tomcat/container/branches/tc4.1.x/tomcat.nsi
URL:
http://svn.apache.org/viewcvs/tomcat/container/branches/tc4.1.x/tomcat.nsi?rev=380807&r1=380806&r2=380807&view=diff
==============================================================================
--- tomcat/container/branches/tc4.1.x/tomcat.nsi (original)
+++ tomcat/container/branches/tc4.1.x/tomcat.nsi Fri Feb 24 12:19:46 2006
@@ -7,13 +7,15 @@
OutFile tomcat4.exe
CRCCheck on
SetCompress force
-SetCompressor lzma
+SetCompressor /SOLID lzma
SetDatablockOptimize on
!include "StrFunc.nsh"
${StrRep}
!define MUI_COMPONENTSPAGE_SMALLDESC
+!define MUI_ICON tomcat.ico
+!define MUI_UNICON tomcat.ico
!insertmacro MUI_PAGE_LICENSE "INSTALLLICENSE"
@@ -40,8 +42,8 @@
SetOverwrite on
SetDateSave on
-InstallDir "$PROGRAMFILES\Apache Group\Tomcat 4.1"
-InstallDirRegKey HKLM "SOFTWARE\Apache Group\Tomcat\4.1" ""
+InstallDir "$PROGRAMFILES\Apache Software Foundation\Tomcat 4.1"
+InstallDirRegKey HKLM "SOFTWARE\Apache Software Foundation\Tomcat\4.1" ""
ReserveFile "config.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
@@ -55,8 +57,7 @@
SetOutPath $INSTDIR
File tomcat.ico
File LICENSE
- File /r bin
- Delete "$INSTDIR\bin\tomcat.exe"
+ File /r /x *.exe bin
File /r common
File /nonfatal /r shared
File /nonfatal /r logs
@@ -84,10 +85,20 @@
Pop $2
SetOutPath $INSTDIR\bin
- File /oname=tomcat.exe bin\tomcat.exe
-
- ExecWait '"$INSTDIR\bin\tomcat.exe" -install "Apache Tomcat 4.1" "$2"
-Djava.class.path="$INSTDIR\bin\bootstrap.jar" -Dcatalina.home="$INSTDIR"
-Djava.endorsed.dirs="$INSTDIR\common\endorsed" -Dsun.io.useCanonCaches=false
-start org.apache.catalina.startup.BootstrapService -params start -stop
org.apache.catalina.startup.BootstrapService -params stop -out
"$INSTDIR\logs\stdout.log" -err "$INSTDIR\logs\stderr.log"'
-
+ File /oname=tomcat4.exe bin\tomcat4.exe
+ File /oname=tomcat4w.exe bin\tomcat4w.exe
+
+ ExecWait '"$INSTDIR\bin\tomcat4.exe" //IS//Tomcat4 --DisplayName "Apache
Tomcat" --Description "Apache Tomcat @VERSION@ Server -
http://tomcat.apache.org/" --LogPath "$INSTDIR\logs" --Install
"$INSTDIR\bin\tomcat4.exe" --Jvm "$2" --StartPath "$INSTDIR" --StopPath
"$INSTDIR"'
+
+ ExecWait '"$INSTDIR\bin\tomcat4.exe" //US//Tomcat4 --Startup auto'
+
+ ExecWait '"$INSTDIR\bin\tomcat4.exe" //US//Tomcat4 --Classpath
"$INSTDIR\bin\bootstrap.jar" --StartClass org.apache.catalina.startup.Bootstrap
--StopClass org.apache.catalina.startup.Bootstrap --StartParams start
--StopParams stop --StartMode jvm --StopMode jvm'
+ ExecWait '"$INSTDIR\bin\tomcat4.exe" //US//Tomcat4 --JvmOptions
"-Dcatalina.home=$INSTDIR#-Dcatalina.base=$INSTDIR#-Djava.endorsed.dirs=$INSTDIR\common\endorsed#-Djava.io.tmpdir=$INSTDIR\temp
--StdOutput auto --StdError auto'
+
+ ; Behave like Apache Httpd (put the icon in try on login)
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run"
"ApacheTomcatMonitor" '"$INSTDIR\bin\tomcat4w.exe" //MS//Tomcat4'
+ Exec '"$INSTDIR\bin\tomcat4w.exe" //MS//Tomcat4'
+
ClearErrors
SectionEnd
@@ -129,16 +140,10 @@
CreateShortCut "$SMPROGRAMS\Apache Tomcat 4.1\Tomcat 4.1 Program
Directory.lnk" \
"$INSTDIR"
- CreateShortCut "$SMPROGRAMS\Apache Tomcat 4.1\Start Tomcat.lnk" \
- "$2\bin\java.exe" \
- '-jar -Duser.dir="$INSTDIR"
-Djava.endorsed.dirs="$INSTDIR\common\endorsed" "$INSTDIR\bin\bootstrap.jar"
start' \
+ CreateShortCut "$SMPROGRAMS\Apache Tomcat 4.1\Configure Tomcat.lnk" \
+ "$INSTDIR\bin\tomcat4w.exe" "" \
"$INSTDIR\tomcat.ico" 0 SW_SHOWNORMAL
- CreateShortCut "$SMPROGRAMS\Apache Tomcat 4.1\Stop Tomcat.lnk" \
- "$2\bin\java.exe" \
- '-jar -Duser.dir="$INSTDIR" "$INSTDIR\bin\bootstrap.jar"
stop' \
- "$INSTDIR\tomcat.ico" 0 SW_SHOWMINIMIZED
-
SectionEnd
SubSectionEnd
@@ -396,7 +401,7 @@
Call startService
- WriteRegStr HKLM "SOFTWARE\Apache Group\Tomcat\4.1" "" $INSTDIR
+ WriteRegStr HKLM "SOFTWARE\Apache Software Foundation\Tomcat\4.1" "" $INSTDIR
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache
Tomcat 4.1" \
"DisplayName" "Apache Tomcat 4.1 (remove only)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache
Tomcat 4.1" \
@@ -457,7 +462,7 @@
;
Function startService
- IfFileExists "$INSTDIR\bin\tomcat.exe" 0 NoService
+ IfFileExists "$INSTDIR\bin\tomcat4.exe" 0 NoService
ExecWait 'net start "Apache Tomcat 4.1"'
Sleep 4000
@@ -473,10 +478,13 @@
; Stop Tomcat NT Service
;
Function un.stopService
-
- IfFileExists "$INSTDIR\bin\tomcat.exe" 0 NoService
- ExecWait 'net stop "Apache Tomcat 4.1"'
- Sleep 2000
+ IfFileExists "$INSTDIR\bin\tomcat4.exe" 0 NoService
+
+ ; Stop Tomcat service monitor if running
+ Execwait '"$INSTDIR\bin\tomcat4w.exe" //MQ//Tomcat4'
+ ; Delete Tomcat service
+ Execwait '"$INSTDIR\bin\tomcat4.exe" //DS//Tomcat4'
+ ClearErrors
NoService:
@@ -509,7 +517,8 @@
DeleteRegKey HKCR "JSPFile"
DeleteRegKey HKLM
"Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache Tomcat 4.1"
- DeleteRegKey HKLM "SOFTWARE\Apache Group\Tomcat\4.1"
+ DeleteRegKey HKLM "SOFTWARE\Apache Software Foundation\Tomcat\4.1"
+ DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run"
"ApacheTomcatMonitor"
RMDir /r "$SMPROGRAMS\Apache Tomcat 4.1"
Delete "$INSTDIR\tomcat.ico"
Delete "$INSTDIR\LICENSE"
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]