Check if Tomcat and MySQL are already installed on machine
How can I check using Java if Tomcat and MySQL are already installed on machine? If it is installed I开发者_Go百科 have to disable those options in my installer.
If Tomcat is installed as a service on Windows, you can check the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Tomcat\[version]\InstallPath
.
To read the registry from Java, you would need to use something like JNA, the methods
Advapi32Util.registryGetKeys()
and Advapi32Util.registryGetStringValue()
can help.
精彩评论