Bug 63689 - Variable DISPLAYNAME in service.bat is empty instead of containing service display name.
Summary: Variable DISPLAYNAME in service.bat is empty instead of containing service di...
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Packaging (show other bugs)
Version: 9.0.24
Hardware: PC All
: P2 normal (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-23 14:03 UTC by Thorsten Schöning
Modified: 2019-09-03 19:42 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thorsten Schöning 2019-08-23 14:03:03 UTC
service.bat from Tomcat 9.0.24 contains the following line:

> --DisplayName "%DISPLAYNAME%" ^

The problem is that this variable is used only ones and never defined anywhere. The same named file in Tomcat 8.0.53 additionally uses lines like the following:

> set SERVICE_NAME=%1
> set DISPLAYNAME=Apache Tomcat 8.0 %1

While most parts of the service are registered properly in Tomcat 9, it's not visible in the GUI service manager started using services.msc in the end. The problem was introduced in Bug 63285 in the following commit:

https://github.com/apache/tomcat/commit/7ac5fc8a59c10e7de1ee6d4b85c1ee797942a1e7#diff-e7a950755e93b9d7b1d4f61f74c93fc2

DISPLAYNAME was available before and got removed during C&P some lines of code:

> if "x%1x" == "x--userx" goto runAsUser
> set SERVICE_NAME=%1
> set DISPLAYNAME=Apache Tomcat @VERSION_MAJOR_MINOR@ %1
> shift

https://github.com/apache/tomcat/commit/7ac5fc8a59c10e7de1ee6d4b85c1ee797942a1e7#diff-e7a950755e93b9d7b1d4f61f74c93fc2L111

Now:

> if "x%1x" == "x--userx" goto runAsUser
> set SERVICE_NAME=%1
> shift

https://github.com/apache/tomcat/commit/7ac5fc8a59c10e7de1ee6d4b85c1ee797942a1e7#diff-e7a950755e93b9d7b1d4f61f74c93fc2R55

Tomcat 8.5.45 has the same problem.
Comment 1 Mark Thomas 2019-09-03 19:42:12 UTC
Thanks for the report and the analysis.

Fixed in:
- master for 9.0.25 onwards
- 8.5.x for 8.5.46 onwards

It was also fixed in 7.0.x but the bg was never included in a release.