Detecting if IIS is installed...
The past few days, I have noticed a trend whereby users are suddenly re-invigorated to determine if IIS is installed on their system(s). This, I hope, is because of the solid reputation that IIS 6.0 has for being a strong, robust, Enterprise-ready web platform. The last time folks kept asking was not for positive reasons, unfortunately (can you say Code Red?)
I noticed that folks are a bit mystified on how to determine if IIS is in fact installed on their systems without having to make a HTTP request to the server. There are literally a dozen ways that one could go about finding out details such as whether IIS is installed.
This is the reason I write – to spread some love today. The first approach is to help you understand how to do this manually, then maybe cover some automated means of determining whether IIS is installed.
Manually:
The first place is to look in the registry, because, often the registry does not lie. IIS sets a few key registry keys upon install that might be of interest to those looking:
HKLM_Software_Microsoft_InetStp
This is a well-hidden location that many folks don’t realize is installed. This one key will fail to exist if IIS isn’t installed, hence, making it a favorite for many people to determine that state of their system. This key also includes the Major\Minor version as I point out in the W3SVC section below, but as well as the PathWWWRoot in case of automated installed and a custom path being set.
These are some of the interesting pieces of data that can be found using this key -
IISProgramGroup
InstallPath
MajorVersion
MinorVersion
PathWWWRoot
VersionString
HKLM_System_CurrentControlSet_Services_IISADMIN
This key drives the requirements of the Inetinfo.exe process. It can be used as a indication as well if IIS is installed by its lack of existance on a system, though, it can indicate false-positives to users. If you are attempting to detect whether a web server is installed or not, well then, you might make the wrong assumption. There are quite a few dependent services that will require the creation and configuring of IISAdmin. Some notables are FTP, SMTP, NNTP, and several services installed by Exchange 2000 and\or 2003. Hence, the WWW service might not be in use and you would need to further your discover the true state of the web server.
HKLM_System_CurrentControlSet_Services_W3SVC
The reason this key is special is it will tell you some key details about your current W3SVC configuration. It will give you Major & Minor versions of the installation, plus indicate to the user that the web server is installed. This might be helpful if you are unsure what version of IIS you have. The options are as follows:
Major Versions:
4: Shipped in NT Option Pack for Windows NT 4 5: Shipped in Windows 2000 Server & Windows XP Professional 6: Shipped in Windows Server 2003 Minor Versions:
1: Indicates that IIS is installed on Windows XP Professional
As you can see, we are pretty easy to detect if we exist on the system. We also offer many folks the ability to to find out not only if IIS is installed, but what particular version is available.
There is also one other way that I can think of in a manual way is to use the iisx.log that will exist in the %windir% directory on your system. If you like combing through logfiles, then feel free to do so:
IIS 4: %windir%\iis4.log
IIS 5: %windir%\iis5.log
IIS 5.1: %windir%\iis6.log
IIS 6: %windir%\iis6.log
There is some more details on this topic, but I think I will call it an even’n and get back to work. Perhaps more in the future…
Happy IIS installation hunting…
~Chris