Correct props.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 24 Oct 2006 03:11:12 +0000 (03:11 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 24 Oct 2006 03:11:12 +0000 (03:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@467213 13f79535-47bb-0310-9956-ffa450edef68

res/bootstrap.jar.manifest
res/config.ini
res/jvm.ini
res/tomcat.nsi

index 4ccb702..1102b99 100644 (file)
@@ -1,5 +1,5 @@
-Manifest-Version: 1.0\r
-Main-Class: org.apache.catalina.startup.Bootstrap\r
-Class-Path: commons-daemon.jar commons-logging-api.jar tomcat-juli.jar tomcat-coyote.jar\r
-Specification-Title: Catalina\r
+Manifest-Version: 1.0
+Main-Class: org.apache.catalina.startup.Bootstrap
+Class-Path: commons-daemon.jar commons-logging-api.jar tomcat-juli.jar tomcat-coyote.jar
+Specification-Title: Catalina
 Specification-Version: 6.0
\ No newline at end of file
index dce25bc..1abdad2 100644 (file)
@@ -1,59 +1,59 @@
-[Settings]\r
-NumFields=7\r
-\r
-[Field 1]\r
-Type=Label\r
-Text=HTTP/1.1 Connector Port\r
-left=0\r
-right=150\r
-top=5\r
-bottom=20\r
-\r
-[Field 2]\r
-Type=Text\r
-State=8080\r
-MaxLen=5\r
-left=150\r
-right=200\r
-top=5\r
-bottom=18\r
-\r
-[Field 3]\r
-Type=Label\r
-text=Administrator Login\r
-left=0\r
-right=300\r
-top=30\r
-bottom=45\r
-\r
-[Field 4]\r
-Type=Label\r
-Text=User Name\r
-left=0\r
-right=150\r
-top=50\r
-bottom=65\r
-\r
-[Field 5]\r
-Type=Text\r
-State=admin\r
-left=150\r
-right=250\r
-top=50\r
-bottom=63\r
-\r
-[Field 6]\r
-Type=Label\r
-Text=Password\r
-left=0\r
-right=150\r
-top=70\r
-bottom=85\r
-\r
-[Field 7]\r
-Type=Password\r
-left=150\r
-right=250\r
-top=70\r
-bottom=83\r
-\r
+[Settings]
+NumFields=7
+
+[Field 1]
+Type=Label
+Text=HTTP/1.1 Connector Port
+left=0
+right=150
+top=5
+bottom=20
+
+[Field 2]
+Type=Text
+State=8080
+MaxLen=5
+left=150
+right=200
+top=5
+bottom=18
+
+[Field 3]
+Type=Label
+text=Administrator Login
+left=0
+right=300
+top=30
+bottom=45
+
+[Field 4]
+Type=Label
+Text=User Name
+left=0
+right=150
+top=50
+bottom=65
+
+[Field 5]
+Type=Text
+State=admin
+left=150
+right=250
+top=50
+bottom=63
+
+[Field 6]
+Type=Label
+Text=Password
+left=0
+right=150
+top=70
+bottom=85
+
+[Field 7]
+Type=Password
+left=150
+right=250
+top=70
+bottom=83
+
index e78613a..f3e57e5 100644 (file)
@@ -1,18 +1,18 @@
-[Settings]\r
-NumFields=2\r
-\r
-[Field 1]\r
-Type=Label\r
-Text=Please select the path of a J2SE 5.0 JRE installed on your system:\r
-left=0\r
-right=300\r
-top=5\r
-bottom=20\r
-\r
-[Field 2]\r
-Type=DirRequest\r
-Left=0\r
-Right=-1\r
-Top=65\r
-Bottom=78\r
-\r
+[Settings]
+NumFields=2
+
+[Field 1]
+Type=Label
+Text=Please select the path of a J2SE 5.0 JRE installed on your system:
+left=0
+right=300
+top=5
+bottom=20
+
+[Field 2]
+Type=DirRequest
+Left=0
+Right=-1
+Top=65
+Bottom=78
+
index 55acc14..ba931a1 100644 (file)
-\r
-; Tomcat script for Nullsoft Installer\r
-; $Id: tomcat.nsi 393199 2006-04-11 12:17:55Z remm $\r
-\r
-  ;Compression options\r
-  CRCCheck on\r
-  SetCompressor /SOLID lzma\r
-\r
-  Name "Apache Tomcat"\r
-\r
-  ;Product information\r
-  VIAddVersionKey ProductName "Apache Tomcat"\r
-  VIAddVersionKey CompanyName "Apache Software Foundation"\r
-  VIAddVersionKey LegalCopyright "Copyright (c) 1999-2006 The Apache Software Foundation"\r
-  VIAddVersionKey FileDescription "Apache Tomcat Installer"\r
-  VIAddVersionKey FileVersion "2.0"\r
-  VIAddVersionKey ProductVersion "@VERSION@"\r
-  VIAddVersionKey Comments "tomcat.apache.org"\r
-  VIAddVersionKey InternalName "apache-tomcat-@VERSION@.exe"\r
-  VIProductVersion @VERSION_NUMBER@\r
-\r
-!include "MUI.nsh"\r
-!include "StrFunc.nsh"\r
-${StrRep}\r
-  Var "JavaHome"\r
-\r
-\r
-\r
-;--------------------------------\r
-;Configuration\r
-\r
-  !define MUI_HEADERIMAGE\r
-  !define MUI_HEADERIMAGE_RIGHT\r
-  !define MUI_HEADERIMAGE_BITMAP header.bmp\r
-  !define MUI_WELCOMEFINISHPAGE_BITMAP side_left.bmp \r
-  !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\webapps\ROOT\RELEASE-NOTES.txt"\r
-  !define MUI_FINISHPAGE_RUN $INSTDIR\bin\tomcat6w.exe\r
-  !define MUI_FINISHPAGE_RUN_PARAMETERS //MR//Tomcat6\r
-  !define MUI_FINISHPAGE_NOREBOOTSUPPORT\r
-\r
-  !define MUI_ABORTWARNING\r
-\r
-  !define TEMP1 $R0\r
-  !define TEMP2 $R1\r
-\r
-  !define MUI_ICON tomcat.ico\r
-  !define MUI_UNICON tomcat.ico\r
-\r
-  ;General\r
-  OutFile tomcat-installer.exe\r
-\r
-  ;Install Options pages\r
-  LangString TEXT_JVM_TITLE ${LANG_ENGLISH} "Java Virtual Machine"\r
-  LangString TEXT_JVM_SUBTITLE ${LANG_ENGLISH} "Java Virtual Machine path selection."\r
-  LangString TEXT_JVM_PAGETITLE ${LANG_ENGLISH} ": Java Virtual Machine path selection"\r
-\r
-  LangString TEXT_CONF_TITLE ${LANG_ENGLISH} "Configuration"\r
-  LangString TEXT_CONF_SUBTITLE ${LANG_ENGLISH} "Tomcat basic configuration."\r
-  LangString TEXT_CONF_PAGETITLE ${LANG_ENGLISH} ": Configuration Options"\r
-\r
-  ;Install Page order\r
-  !insertmacro MUI_PAGE_WELCOME\r
-  !insertmacro MUI_PAGE_LICENSE INSTALLLICENSE\r
-  !insertmacro MUI_PAGE_COMPONENTS\r
-  !insertmacro MUI_PAGE_DIRECTORY\r
-  Page custom SetConfiguration Void "$(TEXT_CONF_PAGETITLE)"\r
-  Page custom SetChooseJVM Void "$(TEXT_JVM_PAGETITLE)"\r
-  !insertmacro MUI_PAGE_INSTFILES\r
-  Page custom CheckUserType\r
-  !insertmacro MUI_PAGE_FINISH\r
-\r
-  ;Uninstall Page order\r
-  !insertmacro MUI_UNPAGE_CONFIRM\r
-  !insertmacro MUI_UNPAGE_INSTFILES\r
-\r
-  ;License dialog\r
-  LicenseData License.rtf\r
-\r
-  ;Component-selection page\r
-    ;Descriptions\r
-    LangString DESC_SecTomcat ${LANG_ENGLISH} "Install the Tomcat Servlet container."\r
-    LangString DESC_SecTomcatCore ${LANG_ENGLISH} "Install the Tomcat Servlet container core."\r
-    LangString DESC_SecTomcatService ${LANG_ENGLISH} "Automatically start Tomcat when the computer is started. This requires Windows NT 4.0, Windows 2000 or Windows XP."\r
-    LangString DESC_SecTomcatNative ${LANG_ENGLISH} "Downloads and installs Tomcat native .dll for better performance and scalability in production environments."\r
-;    LangString DESC_SecTomcatSource ${LANG_ENGLISH} "Install the Tomcat source code."\r
-    LangString DESC_SecMenu ${LANG_ENGLISH} "Create a Start Menu program group for Tomcat."\r
-    LangString DESC_SecDocs ${LANG_ENGLISH} "Install the Tomcat documentation bundle. This include documentation on the servlet container and its configuration options, on the Jasper JSP page compiler, as well as on the native webserver connectors."\r
-    LangString DESC_SecExamples ${LANG_ENGLISH} "Installs some examples web applications."\r
-    LangString DESC_SecAdmin ${LANG_ENGLISH} "Installs the administration web application.";\r
-;    LangString DESC_SecWebapps ${LANG_ENGLISH} "Installs other utility web applications (WebDAV, balancer, etc)."\r
-\r
-  ;Language\r
-  !insertmacro MUI_LANGUAGE English\r
-\r
-  ;Folder-select dialog\r
-  InstallDir "$PROGRAMFILES\Apache Software Foundation\Tomcat 6.0"\r
-\r
-  ;Install types\r
-  InstType Normal\r
-  InstType Minimum\r
-  InstType Full\r
-\r
-  ; Main registry key\r
-  InstallDirRegKey HKLM "SOFTWARE\Apache Software Foundation\Tomcat\6.0" ""\r
-\r
-  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS\r
-  ReserveFile "jvm.ini"\r
-  ReserveFile "config.ini"\r
-\r
-;--------------------------------\r
-;Installer Sections\r
-\r
-SubSection "Tomcat" SecTomcat\r
-\r
-Section "Core" SecTomcatCore\r
-\r
-  SectionIn 1 2 3 RO\r
-\r
-  IfSilent +2 0\r
-  Call checkJvm\r
-\r
-  SetOutPath $INSTDIR\r
-  File tomcat.ico\r
-  File LICENSE\r
-  File /r lib\r
-  File /nonfatal /r logs\r
-  File /nonfatal /r work\r
-  File /nonfatal /r temp\r
-  SetOutPath $INSTDIR\bin\r
-  File bin\bootstrap.jar\r
-  File bin\tomcat-juli.jar\r
-  File bin\*.exe\r
-  SetOutPath $INSTDIR\conf\r
-  File conf\*.*\r
-  SetOutPath $INSTDIR\webapps\r
-  File /r webapps\ROOT\r
-  File /r webapps\host-manager\r
-  File /r webapps\manager\r
-\r
-  Call configure\r
-  Call findJavaPath\r
-  Pop $2\r
-\r
-  IfSilent +2 0\r
-  !insertmacro MUI_INSTALLOPTIONS_READ $2 "jvm.ini" "Field 2" "State"\r
-\r
-  StrCpy "$JavaHome" $2\r
-  Call findJVMPath\r
-  Pop $2\r
-\r
-  DetailPrint "Using Jvm: $2"\r
-\r
-  InstallRetry:\r
-  ClearErrors\r
-  nsExec::ExecToLog '"$INSTDIR\bin\tomcat6.exe" //IS//Tomcat6 --DisplayName "Apache Tomcat" --Description "Apache Tomcat @VERSION@ Server - http://tomcat.apache.org/" --LogPath "$INSTDIR\logs" --Install "$INSTDIR\bin\tomcat6.exe" --Jvm "$2" --StartPath "$INSTDIR" --StopPath "$INSTDIR"'\r
-  Pop $0\r
-  StrCmp $0 "0" InstallOk\r
-    MessageBox MB_ABORTRETRYIGNORE|MB_ICONSTOP \\r
-      "Failed to install Tomcat6 service.$\r$\nCheck your settings and permissions$\r$\nIgnore and continue anyway (not recommended)?" \\r
-       /SD IDIGNORE IDIGNORE InstallOk IDRETRY InstallRetry\r
-  Quit\r
-  InstallOk:\r
-  ClearErrors\r
-\r
-SectionEnd\r
-\r
-Section "Service" SecTomcatService\r
-\r
-  SectionIn 3\r
-\r
-  IfSilent 0 +3\r
-  Call findJavaPath\r
-  Pop $2\r
-\r
-  IfSilent +2 0\r
-  !insertmacro MUI_INSTALLOPTIONS_READ $2 "jvm.ini" "Field 2" "State"\r
-\r
-  StrCpy "$JavaHome" $2\r
-  Call findJVMPath\r
-  Pop $2\r
-\r
-  nsExec::ExecToLog '"$INSTDIR\bin\tomcat6.exe" //US//Tomcat6 --Startup auto'\r
-  ; Bahave like Apache Httpd (put the icon in try on login)\r
-  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "ApacheTomcatMonitor" '"$INSTDIR\bin\tomcat6w.exe" //MS//Tomcat6'\r
-\r
-  ClearErrors\r
-\r
-SectionEnd\r
-\r
-Section "Native" SecTomcatNative\r
-\r
-  SectionIn 3\r
-\r
-  NSISdl::download /TIMEOUT=30000 http://tomcat.heanet.ie/native/1.1.6/binaries/win32/tcnative-1.dll $INSTDIR\bin\tcnative-1.dll\r
-  Pop $0\r
-  StrCmp $0 success success\r
-    SetDetailsView show\r
-    DetailPrint "download failed from http://tomcat.heanet.ie/native/1.1.6/binaries/win32/tcnative-1.dll: $0"\r
-  success:\r
-\r
-  ClearErrors\r
-\r
-SectionEnd\r
-\r
-;Section "Source Code" SecTomcatSource\r
-;\r
-;  SectionIn 3\r
-;  SetOutPath $INSTDIR\r
-;  File /r src\r
-;\r
-;SectionEnd\r
-\r
-SubSectionEnd\r
-\r
-Section "Start Menu Items" SecMenu\r
-\r
-  SectionIn 1 2 3\r
-\r
-  !insertmacro MUI_INSTALLOPTIONS_READ $2 "jvm.ini" "Field 2" "State"\r
-\r
-  SetOutPath "$SMPROGRAMS\Apache Tomcat 6.0"\r
-\r
-  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Tomcat Home Page.lnk" \\r
-                 "http://tomcat.apache.org/"\r
-\r
-  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Welcome.lnk" \\r
-                 "http://127.0.0.1:$R0/"\r
-\r
-;  IfFileExists "$INSTDIR\webapps\admin" 0 NoAdminApp\r
-;\r
-;  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Tomcat Administration.lnk" \\r
-;                 "http://127.0.0.1:$R0/admin/"\r
-;NoAdminApp:\r
-\r
-  IfFileExists "$INSTDIR\webapps\manager" 0 NoManagerApp\r
-\r
-  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Tomcat Manager.lnk" \\r
-                 "http://127.0.0.1:$R0/manager/html"\r
-\r
-NoManagerApp:\r
-\r
-  IfFileExists "$INSTDIR\webapps\webapps\tomcat-docs" 0 NoDocumentaion\r
-\r
-  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Tomcat Documentation.lnk" \\r
-                 "$INSTDIR\webapps\tomcat-docs\index.html"\r
-\r
-NoDocumentaion:\r
-\r
-  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Uninstall Tomcat 6.0.lnk" \\r
-                 "$INSTDIR\Uninstall.exe"\r
-\r
-  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Tomcat 6.0 Program Directory.lnk" \\r
-                 "$INSTDIR"\r
-\r
-  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Monitor Tomcat.lnk" \\r
-                 "$INSTDIR\bin\tomcat6w.exe" \\r
-                 '//MS//Tomcat6' \\r
-                 "$INSTDIR\tomcat.ico" 0 SW_SHOWNORMAL\r
-\r
-  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Configure Tomcat.lnk" \\r
-                 "$INSTDIR\bin\tomcat6w.exe" \\r
-                 '//ES//Tomcat6' \\r
-                 "$INSTDIR\tomcat.ico" 0 SW_SHOWNORMAL\r
-\r
-SectionEnd\r
-\r
-Section "Documentation" SecDocs\r
-\r
-  SectionIn 1 3\r
-  SetOutPath $INSTDIR\webapps\r
-  File /r webapps\docs\r
-\r
-SectionEnd\r
-\r
-Section "Examples" SecExamples\r
-\r
-  SectionIn 3\r
-\r
-  SetOverwrite on\r
-  SetOutPath $INSTDIR\webapps\r
-  File /r webapps\examples\r
-\r
-SectionEnd\r
-\r
-;Section "Administration" SecAdmin\r
-;\r
-;  SectionIn 3\r
-;\r
-;  SetOutPath $INSTDIR\webapps\r
-;  File /r webapps\admin\r
-;  SetOutPath $INSTDIR\conf\Catalina\localhost\r
-;  File conf\Catalina\localhost\admin.xml\r
-;\r
-;SectionEnd\r
-\r
-;Section "Webapps" SecWebapps\r
-;\r
-;  SectionIn 3\r
-;\r
-;  SetOutPath $INSTDIR\webapps\r
-;  File /nonfatal /r webapps\balancer\r
-;  File /nonfatal /r webapps\webdav\r
-;\r
-;SectionEnd\r
-\r
-;Section "Compatibility" SecCompat\r
-;\r
-;  SetOutPath $INSTDIR\r
-;  File /oname=bin\jmx.jar ..\compat\bin\jmx.jar\r
-;  File /oname=common\endorsed\xercesImpl.jar ..\compat\common\endorsed\xercesImpl.jar\r
-;  File /oname=common\endorsed\xml-apis.jar  ..\compat\common\endorsed\xml-apis.jar\r
-;\r
-;SectionEnd\r
-\r
-Section -post\r
-  nsExec::ExecToLog '"$INSTDIR\bin\tomcat6.exe" //US//Tomcat6 --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'\r
-  nsExec::ExecToLog '"$INSTDIR\bin\tomcat6.exe" //US//Tomcat6 --JvmOptions "-Dcatalina.home=$INSTDIR#-Dcatalina.base=$INSTDIR#-Djava.endorsed.dirs=$INSTDIR\common\endorsed#-Djava.io.tmpdir=$INSTDIR\temp#-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager#-Djava.util.logging.config.file=$INSTDIR\conf\logging.properties" --StdOutput auto --StdError auto'\r
-\r
-  WriteUninstaller "$INSTDIR\Uninstall.exe"\r
-\r
-  WriteRegStr HKLM "SOFTWARE\Apache Software Foundation\Tomcat\6.0" "InstallPath" $INSTDIR\r
-  WriteRegStr HKLM "SOFTWARE\Apache Software Foundation\Tomcat\6.0" "Version" @VERSION@\r
-  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache Tomcat 6.0" \\r
-                   "DisplayName" "Apache Tomcat 6.0 (remove only)"\r
-  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache Tomcat 6.0" \\r
-                   "UninstallString" '"$INSTDIR\Uninstall.exe"'\r
-\r
-SectionEnd\r
-\r
-Function .onInit\r
-\r
-  ;Extract Install Options INI Files\r
-  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "config.ini"\r
-  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "jvm.ini"\r
-\r
-FunctionEnd\r
-\r
-Function SetChooseJVM\r
-  !insertmacro MUI_HEADER_TEXT "$(TEXT_JVM_TITLE)" "$(TEXT_JVM_SUBTITLE)"\r
-  Call findJavaPath\r
-  Pop $3\r
-  !insertmacro MUI_INSTALLOPTIONS_WRITE "jvm.ini" "Field 2" "State" $3\r
-  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "jvm.ini"\r
-FunctionEnd\r
-\r
-Function SetConfiguration\r
-  !insertmacro MUI_HEADER_TEXT "$(TEXT_CONF_TITLE)" "$(TEXT_CONF_SUBTITLE)"\r
-  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "config.ini"\r
-FunctionEnd\r
-\r
-Function Void\r
-FunctionEnd\r
-\r
-;--------------------------------\r
-;Descriptions\r
-\r
-!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecTomcat} $(DESC_SecTomcat)\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecTomcatCore} $(DESC_SecTomcatCore)\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecTomcatService} $(DESC_SecTomcatService)\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecTomcatNative} $(DESC_SecTomcatNative)\r
-;  !insertmacro MUI_DESCRIPTION_TEXT ${SecTomcatSource} $(DESC_SecTomcatSource)\r
-;  !insertmacro MUI_DESCRIPTION_TEXT ${SecCompat} $(DESC_SecCompat)\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecMenu} $(DESC_SecMenu)\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecDocs} $(DESC_SecDocs)\r
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} $(DESC_SecExamples)\r
-;  !insertmacro MUI_DESCRIPTION_TEXT ${SecAdmin} $(DESC_SecAdmin)\r
-;  !insertmacro MUI_DESCRIPTION_TEXT ${SecWebapps} $(DESC_SecWebapps)\r
-!insertmacro MUI_FUNCTION_DESCRIPTION_END\r
-\r
-\r
-; =====================\r
-; CheckUserType Function\r
-; =====================\r
-;\r
-; Check the user type, and warn if it's not an administrator.\r
-; Taken from Examples/UserInfo that ships with NSIS.\r
-Function CheckUserType\r
-  ClearErrors\r
-  UserInfo::GetName\r
-  IfErrors Win9x\r
-  Pop $0\r
-  UserInfo::GetAccountType\r
-  Pop $1\r
-  StrCmp $1 "Admin" 0 +3\r
-    ; This is OK, do nothing\r
-    Goto done\r
-\r
-    MessageBox MB_OK|MB_ICONEXCLAMATION 'Note: the current user is not an administrator. \\r
-               To run Tomcat as a Windows service, you must be an administrator. \\r
-               You can still run Tomcat from the command-line as this type of user.'\r
-    Goto done\r
-\r
-  Win9x:\r
-    # This one means you don't need to care about admin or\r
-    # not admin because Windows 9x doesn't either\r
-    MessageBox MB_OK "Error! This DLL can't run under Windows 9x!"\r
-\r
-  done:\r
-FunctionEnd\r
-\r
-\r
-; =====================\r
-; FindJavaPath Function\r
-; =====================\r
-;\r
-; Find the JAVA_HOME used on the system, and put the result on the top of the\r
-; stack\r
-; Will return an empty string if the path cannot be determined\r
-;\r
-Function findJavaPath\r
-\r
-  ;ClearErrors\r
-\r
-  ;ReadEnvStr $1 JAVA_HOME\r
-\r
-  ;IfErrors 0 FoundJDK\r
-\r
-  ClearErrors\r
-\r
-  ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"\r
-  ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2" "JavaHome"\r
-  ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2" "RuntimeLib"\r
-\r
-  ;FoundJDK:\r
-\r
-  IfErrors 0 NoErrors\r
-  StrCpy $1 ""\r
-\r
-NoErrors:\r
-\r
-  ClearErrors\r
-\r
-  ; Put the result in the stack\r
-  Push $1\r
-\r
-FunctionEnd\r
-\r
-\r
-; ====================\r
-; FindJVMPath Function\r
-; ====================\r
-;\r
-; Find the full JVM path, and put the result on top of the stack\r
-; Argument: JVM base path (result of findJavaPath)\r
-; Will return an empty string if the path cannot be determined\r
-;\r
-Function findJVMPath\r
-\r
-  ClearErrors\r
-  \r
-  ;Step one: Is this a JRE path (Program Files\Java\XXX)\r
-  StrCpy $1 "$JavaHome"\r
-  \r
-  StrCpy $2 "$1\bin\hotspot\jvm.dll"\r
-  IfFileExists "$2" FoundJvmDll\r
-  StrCpy $2 "$1\bin\server\jvm.dll"\r
-  IfFileExists "$2" FoundJvmDll\r
-  StrCpy $2 "$1\bin\client\jvm.dll"  \r
-  IfFileExists "$2" FoundJvmDll\r
-  StrCpy $2 "$1\bin\classic\jvm.dll"\r
-  IfFileExists "$2" FoundJvmDll\r
-\r
-  ;Step two: Is this a JDK path (Program Files\XXX\jre)\r
-  StrCpy $1 "$JavaHome\jre"\r
-  \r
-  StrCpy $2 "$1\bin\hotspot\jvm.dll"\r
-  IfFileExists "$2" FoundJvmDll\r
-  StrCpy $2 "$1\bin\server\jvm.dll"\r
-  IfFileExists "$2" FoundJvmDll\r
-  StrCpy $2 "$1\bin\client\jvm.dll"  \r
-  IfFileExists "$2" FoundJvmDll\r
-  StrCpy $2 "$1\bin\classic\jvm.dll"\r
-  IfFileExists "$2" FoundJvmDll\r
-\r
-  ClearErrors\r
-  ;Step tree: Read defaults from registry\r
-  \r
-  ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"\r
-  ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$1" "RuntimeLib"\r
-  \r
-  IfErrors 0 FoundJvmDll\r
-  StrCpy $2 ""\r
-\r
-  FoundJvmDll:\r
-  ClearErrors\r
-\r
-  ; Put the result in the stack\r
-  Push $2\r
-\r
-FunctionEnd\r
-\r
-\r
-; ====================\r
-; CheckJvm Function\r
-; ====================\r
-;\r
-Function checkJvm\r
-\r
-  !insertmacro MUI_INSTALLOPTIONS_READ $3 "jvm.ini" "Field 2" "State"\r
-  IfFileExists "$3\bin\java.exe" NoErrors1\r
-  MessageBox MB_OK|MB_ICONSTOP "No Java Virtual Machine found in folder:$\r$\n$3"\r
-  Quit\r
-NoErrors1:\r
-  StrCpy "$JavaHome" $3\r
-  Call findJVMPath\r
-  Pop $4\r
-  StrCmp $4 "" 0 NoErrors2\r
-  MessageBox MB_OK|MB_ICONSTOP "No Java Virtual Machine found in folder:$\r$\n$3"\r
-  Quit\r
-NoErrors2:\r
-\r
-FunctionEnd\r
-\r
-; ==================\r
-; Configure Function\r
-; ==================\r
-;\r
-; Display the configuration dialog boxes, read the values entered by the user,\r
-; and build the configuration files\r
-;\r
-Function configure\r
-\r
-  !insertmacro MUI_INSTALLOPTIONS_READ $R0 "config.ini" "Field 2" "State"\r
-  !insertmacro MUI_INSTALLOPTIONS_READ $R1 "config.ini" "Field 5" "State"\r
-  !insertmacro MUI_INSTALLOPTIONS_READ $R2 "config.ini" "Field 7" "State"\r
-\r
-  IfSilent 0 +2\r
-  StrCpy $R4 'port="8080"'\r
-\r
-  IfSilent +2 0\r
-  StrCpy $R4 'port="$R0"'\r
-\r
-  IfSilent 0 +2\r
-  StrCpy $R5 ''\r
-\r
-  IfSilent Silent 0\r
-\r
-  ; Escape XML\r
-  Push $R1\r
-  Call xmlEscape\r
-  Pop $R1\r
-  Push $R2\r
-  Call xmlEscape\r
-  Pop $R2\r
-  \r
-  StrCpy $R5 '<user name="$R1" password="$R2" roles="admin,manager" />'\r
-\r
-Silent:\r
-  DetailPrint 'HTTP/1.1 Connector configured on port "$R0"'\r
-  DetailPrint 'Admin user added: "$R1"'\r
-\r
-  SetOutPath $TEMP\r
-  File /r confinstall\r
-\r
-  ; Build final server.xml\r
-  Delete "$INSTDIR\conf\server.xml"\r
-  FileOpen $R9 "$INSTDIR\conf\server.xml" w\r
-\r
-  Push "$TEMP\confinstall\server_1.xml"\r
-  Call copyFile\r
-  FileWrite $R9 $R4\r
-  Push "$TEMP\confinstall\server_2.xml"\r
-  Call copyFile\r
-\r
-  FileClose $R9\r
-\r
-  DetailPrint "server.xml written"\r
-\r
-  ; Build final tomcat-users.xml\r
-  \r
-  Delete "$INSTDIR\conf\tomcat-users.xml"\r
-  FileOpen $R9 "$INSTDIR\conf\tomcat-users.xml" w\r
-\r
-  Push "$TEMP\confinstall\tomcat-users_1.xml"\r
-  Call copyFile\r
-  FileWrite $R9 $R5\r
-  Push "$TEMP\confinstall\tomcat-users_2.xml"\r
-  Call copyFile\r
-\r
-  FileClose $R9\r
-\r
-  DetailPrint "tomcat-users.xml written"\r
-\r
-  RMDir /r "$TEMP\confinstall"\r
-\r
-FunctionEnd\r
-\r
-\r
-Function xmlEscape\r
-  Pop $0\r
-  ${StrRep} $0 $0 "&" "&amp;"\r
-  ${StrRep} $0 $0 "$\"" "&quot;"\r
-  ${StrRep} $0 $0 "<" "&lt;"\r
-  ${StrRep} $0 $0 ">" "&gt;"\r
-  Push $0\r
-FunctionEnd\r
-\r
-\r
-; =================\r
-; CopyFile Function\r
-; =================\r
-;\r
-; Copy specified file contents to $R9\r
-;\r
-Function copyFile\r
-\r
-  ClearErrors\r
-\r
-  Pop $0\r
-\r
-  FileOpen $1 $0 r\r
-\r
- NoError:\r
-\r
-  FileRead $1 $2\r
-  IfErrors EOF 0\r
-  FileWrite $R9 $2\r
-\r
-  IfErrors 0 NoError\r
-\r
- EOF:\r
-\r
-  FileClose $1\r
-\r
-  ClearErrors\r
-\r
-FunctionEnd\r
-\r
-\r
-;--------------------------------\r
-;Uninstaller Section\r
-\r
-Section Uninstall\r
-\r
-  Delete "$INSTDIR\modern.exe"\r
-  Delete "$INSTDIR\Uninstall.exe"\r
-\r
-  ; Stop Tomcat service monitor if running\r
-  nsExec::ExecToLog '"$INSTDIR\bin\tomcat6w.exe" //MQ//Tomcat6'\r
-  ; Delete Tomcat service\r
-  nsExec::ExecToLog '"$INSTDIR\bin\tomcat6.exe" //DS//Tomcat6'\r
-  ClearErrors\r
-\r
-  DeleteRegKey HKCR "JSPFile"\r
-  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache Tomcat 6.0"\r
-  DeleteRegKey HKLM "SOFTWARE\Apache Software Foundation\Tomcat\6.0"\r
-  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "ApacheTomcatMonitor"\r
-  RMDir /r "$SMPROGRAMS\Apache Tomcat 6.0"\r
-  Delete "$INSTDIR\tomcat.ico"\r
-  Delete "$INSTDIR\LICENSE"\r
-  RMDir /r "$INSTDIR\bin"\r
-  RMDir /r "$INSTDIR\lib"\r
-  Delete "$INSTDIR\conf\*.dtd"\r
-  RMDir "$INSTDIR\logs"\r
-;  RMDir /r "$INSTDIR\webapps\balancer"\r
-  RMDir /r "$INSTDIR\webapps\docs"\r
-  RMDir /r "$INSTDIR\webapps\examples"\r
-;  RMDir /r "$INSTDIR\webapps\webdav"\r
-  RMDir /r "$INSTDIR\work"\r
-  RMDir /r "$INSTDIR\temp"\r
-  RMDir "$INSTDIR"\r
-\r
-  IfSilent Removed 0\r
-\r
-  ; if $INSTDIR was removed, skip these next ones\r
-  IfFileExists "$INSTDIR" 0 Removed \r
-    MessageBox MB_YESNO|MB_ICONQUESTION \\r
-      "Remove all files in your Tomcat 6.0 directory? (If you have anything  \\r
- you created that you want to keep, click No)" IDNO Removed\r
-    RMDir /r "$INSTDIR\webapps\ROOT" ; this would be skipped if the user hits no\r
-    RMDir "$INSTDIR\webapps"\r
-    Delete "$INSTDIR\*.*" \r
-    RMDir /r "$INSTDIR"\r
-    Sleep 500\r
-    IfFileExists "$INSTDIR" 0 Removed \r
-      MessageBox MB_OK|MB_ICONEXCLAMATION \\r
-                 "Note: $INSTDIR could not be removed."\r
-  Removed:\r
-\r
-SectionEnd\r
-\r
-;eof\r
+
+; Tomcat script for Nullsoft Installer
+; $Id$
+
+  ;Compression options
+  CRCCheck on
+  SetCompressor /SOLID lzma
+
+  Name "Apache Tomcat"
+
+  ;Product information
+  VIAddVersionKey ProductName "Apache Tomcat"
+  VIAddVersionKey CompanyName "Apache Software Foundation"
+  VIAddVersionKey LegalCopyright "Copyright (c) 1999-2006 The Apache Software Foundation"
+  VIAddVersionKey FileDescription "Apache Tomcat Installer"
+  VIAddVersionKey FileVersion "2.0"
+  VIAddVersionKey ProductVersion "@VERSION@"
+  VIAddVersionKey Comments "tomcat.apache.org"
+  VIAddVersionKey InternalName "apache-tomcat-@VERSION@.exe"
+  VIProductVersion @VERSION_NUMBER@
+
+!include "MUI.nsh"
+!include "StrFunc.nsh"
+${StrRep}
+  Var "JavaHome"
+
+
+
+;--------------------------------
+;Configuration
+
+  !define MUI_HEADERIMAGE
+  !define MUI_HEADERIMAGE_RIGHT
+  !define MUI_HEADERIMAGE_BITMAP header.bmp
+  !define MUI_WELCOMEFINISHPAGE_BITMAP side_left.bmp 
+  !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\webapps\ROOT\RELEASE-NOTES.txt"
+  !define MUI_FINISHPAGE_RUN $INSTDIR\bin\tomcat6w.exe
+  !define MUI_FINISHPAGE_RUN_PARAMETERS //MR//Tomcat6
+  !define MUI_FINISHPAGE_NOREBOOTSUPPORT
+
+  !define MUI_ABORTWARNING
+
+  !define TEMP1 $R0
+  !define TEMP2 $R1
+
+  !define MUI_ICON tomcat.ico
+  !define MUI_UNICON tomcat.ico
+
+  ;General
+  OutFile tomcat-installer.exe
+
+  ;Install Options pages
+  LangString TEXT_JVM_TITLE ${LANG_ENGLISH} "Java Virtual Machine"
+  LangString TEXT_JVM_SUBTITLE ${LANG_ENGLISH} "Java Virtual Machine path selection."
+  LangString TEXT_JVM_PAGETITLE ${LANG_ENGLISH} ": Java Virtual Machine path selection"
+
+  LangString TEXT_CONF_TITLE ${LANG_ENGLISH} "Configuration"
+  LangString TEXT_CONF_SUBTITLE ${LANG_ENGLISH} "Tomcat basic configuration."
+  LangString TEXT_CONF_PAGETITLE ${LANG_ENGLISH} ": Configuration Options"
+
+  ;Install Page order
+  !insertmacro MUI_PAGE_WELCOME
+  !insertmacro MUI_PAGE_LICENSE INSTALLLICENSE
+  !insertmacro MUI_PAGE_COMPONENTS
+  !insertmacro MUI_PAGE_DIRECTORY
+  Page custom SetConfiguration Void "$(TEXT_CONF_PAGETITLE)"
+  Page custom SetChooseJVM Void "$(TEXT_JVM_PAGETITLE)"
+  !insertmacro MUI_PAGE_INSTFILES
+  Page custom CheckUserType
+  !insertmacro MUI_PAGE_FINISH
+
+  ;Uninstall Page order
+  !insertmacro MUI_UNPAGE_CONFIRM
+  !insertmacro MUI_UNPAGE_INSTFILES
+
+  ;License dialog
+  LicenseData License.rtf
+
+  ;Component-selection page
+    ;Descriptions
+    LangString DESC_SecTomcat ${LANG_ENGLISH} "Install the Tomcat Servlet container."
+    LangString DESC_SecTomcatCore ${LANG_ENGLISH} "Install the Tomcat Servlet container core."
+    LangString DESC_SecTomcatService ${LANG_ENGLISH} "Automatically start Tomcat when the computer is started. This requires Windows NT 4.0, Windows 2000 or Windows XP."
+    LangString DESC_SecTomcatNative ${LANG_ENGLISH} "Downloads and installs Tomcat native .dll for better performance and scalability in production environments."
+;    LangString DESC_SecTomcatSource ${LANG_ENGLISH} "Install the Tomcat source code."
+    LangString DESC_SecMenu ${LANG_ENGLISH} "Create a Start Menu program group for Tomcat."
+    LangString DESC_SecDocs ${LANG_ENGLISH} "Install the Tomcat documentation bundle. This include documentation on the servlet container and its configuration options, on the Jasper JSP page compiler, as well as on the native webserver connectors."
+    LangString DESC_SecExamples ${LANG_ENGLISH} "Installs some examples web applications."
+    LangString DESC_SecAdmin ${LANG_ENGLISH} "Installs the administration web application.";
+;    LangString DESC_SecWebapps ${LANG_ENGLISH} "Installs other utility web applications (WebDAV, balancer, etc)."
+
+  ;Language
+  !insertmacro MUI_LANGUAGE English
+
+  ;Folder-select dialog
+  InstallDir "$PROGRAMFILES\Apache Software Foundation\Tomcat 6.0"
+
+  ;Install types
+  InstType Normal
+  InstType Minimum
+  InstType Full
+
+  ; Main registry key
+  InstallDirRegKey HKLM "SOFTWARE\Apache Software Foundation\Tomcat\6.0" ""
+
+  !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
+  ReserveFile "jvm.ini"
+  ReserveFile "config.ini"
+
+;--------------------------------
+;Installer Sections
+
+SubSection "Tomcat" SecTomcat
+
+Section "Core" SecTomcatCore
+
+  SectionIn 1 2 3 RO
+
+  IfSilent +2 0
+  Call checkJvm
+
+  SetOutPath $INSTDIR
+  File tomcat.ico
+  File LICENSE
+  File /r lib
+  File /nonfatal /r logs
+  File /nonfatal /r work
+  File /nonfatal /r temp
+  SetOutPath $INSTDIR\bin
+  File bin\bootstrap.jar
+  File bin\tomcat-juli.jar
+  File bin\*.exe
+  SetOutPath $INSTDIR\conf
+  File conf\*.*
+  SetOutPath $INSTDIR\webapps
+  File /r webapps\ROOT
+  File /r webapps\host-manager
+  File /r webapps\manager
+
+  Call configure
+  Call findJavaPath
+  Pop $2
+
+  IfSilent +2 0
+  !insertmacro MUI_INSTALLOPTIONS_READ $2 "jvm.ini" "Field 2" "State"
+
+  StrCpy "$JavaHome" $2
+  Call findJVMPath
+  Pop $2
+
+  DetailPrint "Using Jvm: $2"
+
+  InstallRetry:
+  ClearErrors
+  nsExec::ExecToLog '"$INSTDIR\bin\tomcat6.exe" //IS//Tomcat6 --DisplayName "Apache Tomcat" --Description "Apache Tomcat @VERSION@ Server - http://tomcat.apache.org/" --LogPath "$INSTDIR\logs" --Install "$INSTDIR\bin\tomcat6.exe" --Jvm "$2" --StartPath "$INSTDIR" --StopPath "$INSTDIR"'
+  Pop $0
+  StrCmp $0 "0" InstallOk
+    MessageBox MB_ABORTRETRYIGNORE|MB_ICONSTOP \
+      "Failed to install Tomcat6 service.$\r$\nCheck your settings and permissions$\r$\nIgnore and continue anyway (not recommended)?" \
+       /SD IDIGNORE IDIGNORE InstallOk IDRETRY InstallRetry
+  Quit
+  InstallOk:
+  ClearErrors
+
+SectionEnd
+
+Section "Service" SecTomcatService
+
+  SectionIn 3
+
+  IfSilent 0 +3
+  Call findJavaPath
+  Pop $2
+
+  IfSilent +2 0
+  !insertmacro MUI_INSTALLOPTIONS_READ $2 "jvm.ini" "Field 2" "State"
+
+  StrCpy "$JavaHome" $2
+  Call findJVMPath
+  Pop $2
+
+  nsExec::ExecToLog '"$INSTDIR\bin\tomcat6.exe" //US//Tomcat6 --Startup auto'
+  ; Bahave like Apache Httpd (put the icon in try on login)
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "ApacheTomcatMonitor" '"$INSTDIR\bin\tomcat6w.exe" //MS//Tomcat6'
+
+  ClearErrors
+
+SectionEnd
+
+Section "Native" SecTomcatNative
+
+  SectionIn 3
+
+  NSISdl::download /TIMEOUT=30000 http://tomcat.heanet.ie/native/1.1.6/binaries/win32/tcnative-1.dll $INSTDIR\bin\tcnative-1.dll
+  Pop $0
+  StrCmp $0 success success
+    SetDetailsView show
+    DetailPrint "download failed from http://tomcat.heanet.ie/native/1.1.6/binaries/win32/tcnative-1.dll: $0"
+  success:
+
+  ClearErrors
+
+SectionEnd
+
+;Section "Source Code" SecTomcatSource
+;
+;  SectionIn 3
+;  SetOutPath $INSTDIR
+;  File /r src
+;
+;SectionEnd
+
+SubSectionEnd
+
+Section "Start Menu Items" SecMenu
+
+  SectionIn 1 2 3
+
+  !insertmacro MUI_INSTALLOPTIONS_READ $2 "jvm.ini" "Field 2" "State"
+
+  SetOutPath "$SMPROGRAMS\Apache Tomcat 6.0"
+
+  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Tomcat Home Page.lnk" \
+                 "http://tomcat.apache.org/"
+
+  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Welcome.lnk" \
+                 "http://127.0.0.1:$R0/"
+
+;  IfFileExists "$INSTDIR\webapps\admin" 0 NoAdminApp
+;
+;  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Tomcat Administration.lnk" \
+;                 "http://127.0.0.1:$R0/admin/"
+;NoAdminApp:
+
+  IfFileExists "$INSTDIR\webapps\manager" 0 NoManagerApp
+
+  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Tomcat Manager.lnk" \
+                 "http://127.0.0.1:$R0/manager/html"
+
+NoManagerApp:
+
+  IfFileExists "$INSTDIR\webapps\webapps\tomcat-docs" 0 NoDocumentaion
+
+  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Tomcat Documentation.lnk" \
+                 "$INSTDIR\webapps\tomcat-docs\index.html"
+
+NoDocumentaion:
+
+  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Uninstall Tomcat 6.0.lnk" \
+                 "$INSTDIR\Uninstall.exe"
+
+  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Tomcat 6.0 Program Directory.lnk" \
+                 "$INSTDIR"
+
+  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Monitor Tomcat.lnk" \
+                 "$INSTDIR\bin\tomcat6w.exe" \
+                 '//MS//Tomcat6' \
+                 "$INSTDIR\tomcat.ico" 0 SW_SHOWNORMAL
+
+  CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Configure Tomcat.lnk" \
+                 "$INSTDIR\bin\tomcat6w.exe" \
+                 '//ES//Tomcat6' \
+                 "$INSTDIR\tomcat.ico" 0 SW_SHOWNORMAL
+
+SectionEnd
+
+Section "Documentation" SecDocs
+
+  SectionIn 1 3
+  SetOutPath $INSTDIR\webapps
+  File /r webapps\docs
+
+SectionEnd
+
+Section "Examples" SecExamples
+
+  SectionIn 3
+
+  SetOverwrite on
+  SetOutPath $INSTDIR\webapps
+  File /r webapps\examples
+
+SectionEnd
+
+;Section "Administration" SecAdmin
+;
+;  SectionIn 3
+;
+;  SetOutPath $INSTDIR\webapps
+;  File /r webapps\admin
+;  SetOutPath $INSTDIR\conf\Catalina\localhost
+;  File conf\Catalina\localhost\admin.xml
+;
+;SectionEnd
+
+;Section "Webapps" SecWebapps
+;
+;  SectionIn 3
+;
+;  SetOutPath $INSTDIR\webapps
+;  File /nonfatal /r webapps\balancer
+;  File /nonfatal /r webapps\webdav
+;
+;SectionEnd
+
+;Section "Compatibility" SecCompat
+;
+;  SetOutPath $INSTDIR
+;  File /oname=bin\jmx.jar ..\compat\bin\jmx.jar
+;  File /oname=common\endorsed\xercesImpl.jar ..\compat\common\endorsed\xercesImpl.jar
+;  File /oname=common\endorsed\xml-apis.jar  ..\compat\common\endorsed\xml-apis.jar
+;
+;SectionEnd
+
+Section -post
+  nsExec::ExecToLog '"$INSTDIR\bin\tomcat6.exe" //US//Tomcat6 --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'
+  nsExec::ExecToLog '"$INSTDIR\bin\tomcat6.exe" //US//Tomcat6 --JvmOptions "-Dcatalina.home=$INSTDIR#-Dcatalina.base=$INSTDIR#-Djava.endorsed.dirs=$INSTDIR\common\endorsed#-Djava.io.tmpdir=$INSTDIR\temp#-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager#-Djava.util.logging.config.file=$INSTDIR\conf\logging.properties" --StdOutput auto --StdError auto'
+
+  WriteUninstaller "$INSTDIR\Uninstall.exe"
+
+  WriteRegStr HKLM "SOFTWARE\Apache Software Foundation\Tomcat\6.0" "InstallPath" $INSTDIR
+  WriteRegStr HKLM "SOFTWARE\Apache Software Foundation\Tomcat\6.0" "Version" @VERSION@
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache Tomcat 6.0" \
+                   "DisplayName" "Apache Tomcat 6.0 (remove only)"
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache Tomcat 6.0" \
+                   "UninstallString" '"$INSTDIR\Uninstall.exe"'
+
+SectionEnd
+
+Function .onInit
+
+  ;Extract Install Options INI Files
+  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "config.ini"
+  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "jvm.ini"
+
+FunctionEnd
+
+Function SetChooseJVM
+  !insertmacro MUI_HEADER_TEXT "$(TEXT_JVM_TITLE)" "$(TEXT_JVM_SUBTITLE)"
+  Call findJavaPath
+  Pop $3
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "jvm.ini" "Field 2" "State" $3
+  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "jvm.ini"
+FunctionEnd
+
+Function SetConfiguration
+  !insertmacro MUI_HEADER_TEXT "$(TEXT_CONF_TITLE)" "$(TEXT_CONF_SUBTITLE)"
+  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "config.ini"
+FunctionEnd
+
+Function Void
+FunctionEnd
+
+;--------------------------------
+;Descriptions
+
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecTomcat} $(DESC_SecTomcat)
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecTomcatCore} $(DESC_SecTomcatCore)
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecTomcatService} $(DESC_SecTomcatService)
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecTomcatNative} $(DESC_SecTomcatNative)
+;  !insertmacro MUI_DESCRIPTION_TEXT ${SecTomcatSource} $(DESC_SecTomcatSource)
+;  !insertmacro MUI_DESCRIPTION_TEXT ${SecCompat} $(DESC_SecCompat)
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecMenu} $(DESC_SecMenu)
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecDocs} $(DESC_SecDocs)
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} $(DESC_SecExamples)
+;  !insertmacro MUI_DESCRIPTION_TEXT ${SecAdmin} $(DESC_SecAdmin)
+;  !insertmacro MUI_DESCRIPTION_TEXT ${SecWebapps} $(DESC_SecWebapps)
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+
+; =====================
+; CheckUserType Function
+; =====================
+;
+; Check the user type, and warn if it's not an administrator.
+; Taken from Examples/UserInfo that ships with NSIS.
+Function CheckUserType
+  ClearErrors
+  UserInfo::GetName
+  IfErrors Win9x
+  Pop $0
+  UserInfo::GetAccountType
+  Pop $1
+  StrCmp $1 "Admin" 0 +3
+    ; This is OK, do nothing
+    Goto done
+
+    MessageBox MB_OK|MB_ICONEXCLAMATION 'Note: the current user is not an administrator. \
+               To run Tomcat as a Windows service, you must be an administrator. \
+               You can still run Tomcat from the command-line as this type of user.'
+    Goto done
+
+  Win9x:
+    # This one means you don't need to care about admin or
+    # not admin because Windows 9x doesn't either
+    MessageBox MB_OK "Error! This DLL can't run under Windows 9x!"
+
+  done:
+FunctionEnd
+
+
+; =====================
+; FindJavaPath Function
+; =====================
+;
+; Find the JAVA_HOME used on the system, and put the result on the top of the
+; stack
+; Will return an empty string if the path cannot be determined
+;
+Function findJavaPath
+
+  ;ClearErrors
+
+  ;ReadEnvStr $1 JAVA_HOME
+
+  ;IfErrors 0 FoundJDK
+
+  ClearErrors
+
+  ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
+  ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2" "JavaHome"
+  ReadRegStr $3 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$2" "RuntimeLib"
+
+  ;FoundJDK:
+
+  IfErrors 0 NoErrors
+  StrCpy $1 ""
+
+NoErrors:
+
+  ClearErrors
+
+  ; Put the result in the stack
+  Push $1
+
+FunctionEnd
+
+
+; ====================
+; FindJVMPath Function
+; ====================
+;
+; Find the full JVM path, and put the result on top of the stack
+; Argument: JVM base path (result of findJavaPath)
+; Will return an empty string if the path cannot be determined
+;
+Function findJVMPath
+
+  ClearErrors
+  
+  ;Step one: Is this a JRE path (Program Files\Java\XXX)
+  StrCpy $1 "$JavaHome"
+  
+  StrCpy $2 "$1\bin\hotspot\jvm.dll"
+  IfFileExists "$2" FoundJvmDll
+  StrCpy $2 "$1\bin\server\jvm.dll"
+  IfFileExists "$2" FoundJvmDll
+  StrCpy $2 "$1\bin\client\jvm.dll"  
+  IfFileExists "$2" FoundJvmDll
+  StrCpy $2 "$1\bin\classic\jvm.dll"
+  IfFileExists "$2" FoundJvmDll
+
+  ;Step two: Is this a JDK path (Program Files\XXX\jre)
+  StrCpy $1 "$JavaHome\jre"
+  
+  StrCpy $2 "$1\bin\hotspot\jvm.dll"
+  IfFileExists "$2" FoundJvmDll
+  StrCpy $2 "$1\bin\server\jvm.dll"
+  IfFileExists "$2" FoundJvmDll
+  StrCpy $2 "$1\bin\client\jvm.dll"  
+  IfFileExists "$2" FoundJvmDll
+  StrCpy $2 "$1\bin\classic\jvm.dll"
+  IfFileExists "$2" FoundJvmDll
+
+  ClearErrors
+  ;Step tree: Read defaults from registry
+  
+  ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
+  ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$1" "RuntimeLib"
+  
+  IfErrors 0 FoundJvmDll
+  StrCpy $2 ""
+
+  FoundJvmDll:
+  ClearErrors
+
+  ; Put the result in the stack
+  Push $2
+
+FunctionEnd
+
+
+; ====================
+; CheckJvm Function
+; ====================
+;
+Function checkJvm
+
+  !insertmacro MUI_INSTALLOPTIONS_READ $3 "jvm.ini" "Field 2" "State"
+  IfFileExists "$3\bin\java.exe" NoErrors1
+  MessageBox MB_OK|MB_ICONSTOP "No Java Virtual Machine found in folder:$\r$\n$3"
+  Quit
+NoErrors1:
+  StrCpy "$JavaHome" $3
+  Call findJVMPath
+  Pop $4
+  StrCmp $4 "" 0 NoErrors2
+  MessageBox MB_OK|MB_ICONSTOP "No Java Virtual Machine found in folder:$\r$\n$3"
+  Quit
+NoErrors2:
+
+FunctionEnd
+
+; ==================
+; Configure Function
+; ==================
+;
+; Display the configuration dialog boxes, read the values entered by the user,
+; and build the configuration files
+;
+Function configure
+
+  !insertmacro MUI_INSTALLOPTIONS_READ $R0 "config.ini" "Field 2" "State"
+  !insertmacro MUI_INSTALLOPTIONS_READ $R1 "config.ini" "Field 5" "State"
+  !insertmacro MUI_INSTALLOPTIONS_READ $R2 "config.ini" "Field 7" "State"
+
+  IfSilent 0 +2
+  StrCpy $R4 'port="8080"'
+
+  IfSilent +2 0
+  StrCpy $R4 'port="$R0"'
+
+  IfSilent 0 +2
+  StrCpy $R5 ''
+
+  IfSilent Silent 0
+
+  ; Escape XML
+  Push $R1
+  Call xmlEscape
+  Pop $R1
+  Push $R2
+  Call xmlEscape
+  Pop $R2
+  
+  StrCpy $R5 '<user name="$R1" password="$R2" roles="admin,manager" />'
+
+Silent:
+  DetailPrint 'HTTP/1.1 Connector configured on port "$R0"'
+  DetailPrint 'Admin user added: "$R1"'
+
+  SetOutPath $TEMP
+  File /r confinstall
+
+  ; Build final server.xml
+  Delete "$INSTDIR\conf\server.xml"
+  FileOpen $R9 "$INSTDIR\conf\server.xml" w
+
+  Push "$TEMP\confinstall\server_1.xml"
+  Call copyFile
+  FileWrite $R9 $R4
+  Push "$TEMP\confinstall\server_2.xml"
+  Call copyFile
+
+  FileClose $R9
+
+  DetailPrint "server.xml written"
+
+  ; Build final tomcat-users.xml
+  
+  Delete "$INSTDIR\conf\tomcat-users.xml"
+  FileOpen $R9 "$INSTDIR\conf\tomcat-users.xml" w
+
+  Push "$TEMP\confinstall\tomcat-users_1.xml"
+  Call copyFile
+  FileWrite $R9 $R5
+  Push "$TEMP\confinstall\tomcat-users_2.xml"
+  Call copyFile
+
+  FileClose $R9
+
+  DetailPrint "tomcat-users.xml written"
+
+  RMDir /r "$TEMP\confinstall"
+
+FunctionEnd
+
+
+Function xmlEscape
+  Pop $0
+  ${StrRep} $0 $0 "&" "&amp;"
+  ${StrRep} $0 $0 "$\"" "&quot;"
+  ${StrRep} $0 $0 "<" "&lt;"
+  ${StrRep} $0 $0 ">" "&gt;"
+  Push $0
+FunctionEnd
+
+
+; =================
+; CopyFile Function
+; =================
+;
+; Copy specified file contents to $R9
+;
+Function copyFile
+
+  ClearErrors
+
+  Pop $0
+
+  FileOpen $1 $0 r
+
+ NoError:
+
+  FileRead $1 $2
+  IfErrors EOF 0
+  FileWrite $R9 $2
+
+  IfErrors 0 NoError
+
+ EOF:
+
+  FileClose $1
+
+  ClearErrors
+
+FunctionEnd
+
+
+;--------------------------------
+;Uninstaller Section
+
+Section Uninstall
+
+  Delete "$INSTDIR\modern.exe"
+  Delete "$INSTDIR\Uninstall.exe"
+
+  ; Stop Tomcat service monitor if running
+  nsExec::ExecToLog '"$INSTDIR\bin\tomcat6w.exe" //MQ//Tomcat6'
+  ; Delete Tomcat service
+  nsExec::ExecToLog '"$INSTDIR\bin\tomcat6.exe" //DS//Tomcat6'
+  ClearErrors
+
+  DeleteRegKey HKCR "JSPFile"
+  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache Tomcat 6.0"
+  DeleteRegKey HKLM "SOFTWARE\Apache Software Foundation\Tomcat\6.0"
+  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "ApacheTomcatMonitor"
+  RMDir /r "$SMPROGRAMS\Apache Tomcat 6.0"
+  Delete "$INSTDIR\tomcat.ico"
+  Delete "$INSTDIR\LICENSE"
+  RMDir /r "$INSTDIR\bin"
+  RMDir /r "$INSTDIR\lib"
+  Delete "$INSTDIR\conf\*.dtd"
+  RMDir "$INSTDIR\logs"
+;  RMDir /r "$INSTDIR\webapps\balancer"
+  RMDir /r "$INSTDIR\webapps\docs"
+  RMDir /r "$INSTDIR\webapps\examples"
+;  RMDir /r "$INSTDIR\webapps\webdav"
+  RMDir /r "$INSTDIR\work"
+  RMDir /r "$INSTDIR\temp"
+  RMDir "$INSTDIR"
+
+  IfSilent Removed 0
+
+  ; if $INSTDIR was removed, skip these next ones
+  IfFileExists "$INSTDIR" 0 Removed 
+    MessageBox MB_YESNO|MB_ICONQUESTION \
+      "Remove all files in your Tomcat 6.0 directory? (If you have anything  \
+ you created that you want to keep, click No)" IDNO Removed
+    RMDir /r "$INSTDIR\webapps\ROOT" ; this would be skipped if the user hits no
+    RMDir "$INSTDIR\webapps"
+    Delete "$INSTDIR\*.*" 
+    RMDir /r "$INSTDIR"
+    Sleep 500
+    IfFileExists "$INSTDIR" 0 Removed 
+      MessageBox MB_OK|MB_ICONEXCLAMATION \
+                 "Note: $INSTDIR could not be removed."
+  Removed:
+
+SectionEnd
+
+;eof