What is the best way to find out where and where Apache is installed on a Windows machine?
I am writing a script that uses the installed apache, but configures its own config and server-root, and I do not want to hardcode it, and the user does not explicitly install it (if necessary).
I tried to search the registry, but did not find anything useful.
Update for those sending default paths
On my machine, it was in C: / Program Files / Apache Software Foundation / Apache2.2. And if I had 64-bit Vista, it would probably be in the "Program Files (x86)" section. And if the computer does not have an English OS, this is even worse.
Bypass
Suppose I need to check% PROGRAMFILES% for Apache 2.0 or 2.2 by default, and then return to the prompt. It would be nice to read the registry and find out where it is.
Final note
Apache was not installed for "Everything", but only for the current user. This makes searching difficult, as there are no registry services or registry keys / folders to point there.
Macke source share