https://bz.apache.org/bugzilla/show_bug.cgi?id=70262
Bug ID: 70262
Summary: --rename option for service.bat fails to rename exe
files
Product: Tomcat 11
Version: 11.0.25
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Packaging
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: -------
I am calling
service.bat install NewName --rename
It gives these errors:
The system cannot find the file specified.
The system cannot find the file specified.
'"C:\Level8\Tomcat\tomcat-11\bin\NewName.exe"' is not recognized as an internal
or external command, operable program or batch file.
Looking at service.bat, I found the following:
if exist "%CATALINA_HOME%\bin\%DEFAULT_SERVICE_NAME%.exe" (
if "x%RENAME%x" == "x--renamex" (
rename "%DEFAULT_SERVICE_NAME%.exe" "%SERVICE_NAME%.exe"
rename "%DEFAULT_SERVICE_NAME%w.exe" "%SERVICE_NAME%w.exe"
set "EXECUTABLE=%CATALINA_HOME%\bin\%SERVICE_NAME%.exe"
)
)
Either these rename commands need to include the path to the files, as used in
the exist test, or there needs to be a cd to move to the correct folder.
Similarly, on remove, the code is:
if exist "%CATALINA_HOME%\bin\%SERVICE_NAME%.exe" (
rename "%SERVICE_NAME%.exe" "%DEFAULT_SERVICE_NAME%.exe"
rename "%SERVICE_NAME%w.exe" "%DEFAULT_SERVICE_NAME%w.exe"
)
It fails for the same reasons as the install rename commands, but doesn't this
need a check to see if SERVICE_NAME and DEFAULT_SERVICE_NAME are the same?
It currently always tries to rename the files and always fails.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]