You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/06/29 16:07:42 UTC

[tomcat] branch 8.5.x updated: Fix BZ 66134 - installer + config file + mgmt apps

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 8d17c6250f Fix BZ 66134 - installer + config file + mgmt apps
8d17c6250f is described below

commit 8d17c6250fdb7d6516b2403ecbfa7781eb0a1fa0
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jun 29 17:06:52 2022 +0100

    Fix BZ 66134 - installer + config file + mgmt apps
    
    https://bz.apache.org/bugzilla/show_bug.cgi?id=66134
    
    The NSIS based Tomcat installer for Windows now correctly handles the
    combination of TomcatAdminRoles defined in a configuration file and
    selecting the Manager and/or Host Manager web applications in the
    installer's GUI.
---
 res/install-win/tomcat.nsi | 30 +++++++++++++++++++++++++-----
 webapps/docs/changelog.xml |  6 ++++++
 2 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/res/install-win/tomcat.nsi b/res/install-win/tomcat.nsi
index 9b0d5f293d..7a14c58e82 100644
--- a/res/install-win/tomcat.nsi
+++ b/res/install-win/tomcat.nsi
@@ -47,6 +47,7 @@ Unicode true
 !include "FileFunc.nsh"
 !include "TextFunc.nsh"
 ${StrRep}
+${Using:StrFunc} StrLoc
 
 Var JavaHome
 Var JavaExe
@@ -67,6 +68,10 @@ Var TomcatAdminUsername
 Var TomcatAdminPassword
 Var TomcatAdminRoles
 
+Var TomcatAdminEnableConfigured
+Var TomcatAdminRolesConfigured
+Var TomcatMenuEntriesEnableConfigured
+
 ; Variables that store handles of dialog controls
 Var CtlJavaHome
 Var CtlTomcatPortShutdown
@@ -488,6 +493,11 @@ Function .onInit
   ${EndIf}
   ClearErrors
 
+  ;take a copy of the default / configured values
+  StrCpy $TomcatAdminEnableConfigured $TomcatAdminEnable
+  StrCpy $TomcatAdminRolesConfigured $TomcatAdminRoles
+  StrCpy $TomcatMenuEntriesEnableConfigured $TomcatMenuEntriesEnable
+
 FunctionEnd
 
 Function pageChooseJVM
@@ -539,15 +549,22 @@ FunctionEnd
 ; It updates options based on what components were selected.
 ;
 Function pageComponentsLeave
-  StrCpy $TomcatAdminEnable "0"
-  StrCpy $TomcatAdminRoles ""
-  StrCpy $TomcatMenuEntriesEnable "0"
+  StrCpy $TomcatAdminEnable $TomcatAdminEnableConfigured
+  StrCpy $TomcatAdminRoles $TomcatAdminRolesConfigured
+  StrCpy $TomcatMenuEntriesEnable $TomcatMenuEntriesEnableConfigured
 
   SectionGetFlags ${SecManager} $0
   IntOp $0 $0 & ${SF_SELECTED}
   ${If} $0 <> 0
     StrCpy $TomcatAdminEnable "1"
-    StrCpy $TomcatAdminRoles "manager-gui"
+    ${If} $TomcatAdminRoles != ""
+      ${StrLoc} $0 $TomcatAdminRoles "manager-gui" 0
+      ${If} $0 == ""
+        StrCpy $TomcatAdminRoles "$TomcatAdminRoles,manager-gui"
+      ${EndIf}
+    ${Else}
+      StrCpy $TomcatAdminRoles "manager-gui"
+    ${EndIf}
   ${EndIf}
 
   SectionGetFlags ${SecHostManager} $0
@@ -555,7 +572,10 @@ Function pageComponentsLeave
   ${If} $0 <> 0
     StrCpy $TomcatAdminEnable "1"
     ${If} $TomcatAdminRoles != ""
-      StrCpy $TomcatAdminRoles "admin-gui,$TomcatAdminRoles"
+      ${StrLoc} $0 $TomcatAdminRoles "admin-gui" 0
+      ${If} $0 == ""
+        StrCpy $TomcatAdminRoles "$TomcatAdminRoles,admin-gui"
+      ${EndIf}
     ${Else}
       StrCpy $TomcatAdminRoles "admin-gui"
     ${EndIf}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c1614a68f6..b7ce0ee2cd 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -164,6 +164,12 @@
         unexpectedly modified some TLS configurations when running on a Java 8
         JDK. (markt)
       </fix>
+      <fix>
+        <bug>66134</bug>: The NSIS based Tomcat installer for Windows now
+        correctly handles the combination of <code>TomcatAdminRoles</code>
+        defined in a configuration file and selecting the Manager and/or
+        Host Manager web applications in the installer's GUI. (markt)
+      </fix>
     </changelog>
   </subsection>
 </section>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org