In one of the installer script I am working on I came across the requirement of getting port number on which tomcat service is running.
So is there a way in nsis by which given a service name we can get port number on which it is running.
If not how can it be achieved.
I assume you do not know where tomcat is installed (if it is installed at all).
A few pointers - not sure if all this is possible in NSIS:
Use Processes plugin to find if tomcat is running. You will be able filter by java.exe, but if there are more than one java processes, not sure what we can do.
Assuming you find one java processes which indicates tomcat running, use nsExec plugin to run netstat command, again filter by java.exe and parse the line to get the port number.