This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Detect IIS
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 22, 2009
06:02 PM
Detect IIS
I'm trying to find a reliable way of detecting whether IIS7 is installed on a Windows Server 2008 machine. The most common method I've seen is to check for \\HKLM\SOFTWARE\Microsoft\InetStp. However, this method is flawed. This registry key appears to be created when the "Web Server (IIS)" role is installed but if the role is removed this registry key remains which results in a false positive. Does anyone have a better detection mechanism that's triggered off the presence/absence of DLL or some combination of conditions?
(8) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 23, 2009
11:15 AM
What type of install project are you using?
You should be able to use the IIS_VERSION property within a Basic MSI or Installscript MSI project to determine the version of IIS installed on the target machine.
If there is no IIS installed, this property is undefined and will always evaluate to false.
James
You should be able to use the IIS_VERSION property within a Basic MSI or Installscript MSI project to determine the version of IIS installed on the target machine.
If there is no IIS installed, this property is undefined and will always evaluate to false.
James
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 07, 2009
01:56 PM
IIS_VERSION appears to only get set if you use the built-in IIS functionality. For a variety of reasons we cannot do this. The primary reason is that our software gives the client the ability to set the vroot name to whatever they want at install time. The built-in functions appear to require that we hard-code the vroot name. There are also several features we need to configure which simply cannot be done within the current IIS features within IS2009. Is there another detection that is reliable to simply determine if IIS7 in installed or not?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 07, 2009
02:02 PM
you could check the value of the \\HKLM\SOFTWARE\Microsoft\InetStp\InstallPath registry key and then use that path to determine which version if any is installed. The directory should not be present if it was uninstalled at some point even if the key is still there.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 07, 2009
02:28 PM
That's the current method I'm attempting to get to work. Unfortunately I end up here ... http://community.acresso.com/showthread.php?t=187789
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 07, 2009
07:01 PM
After solving the non-expanded string problem I looked at what DLL files are installed and what files get uninstalled. We will be pulling the path to IIS from the registry and checking for "iiscore.dll" to verify whether IIS is really installed or not. We're also looking at the MajorVersion registry entry to verify that it is IIS7 that's installed.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 20, 2009
04:51 AM
Hi Honolua,
How do you read the MajorVersion from registry and check if it is version 6 or higher?
Here is what I am trying to do, but it fails:
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
RegDBGetKeyValueEx ("SYSTEM\\CurrentControlSet\\Services\\W3SVC\\Parameters","MajorVersion",nvType,szReturn,nReturn);
StrReplace(szReturn,".","",0);
StrToNum(nReturn,szReturn);
if (szReturn < "6") then
MessageBox("The Internet Information Server must be version 6.0 or higher", SEVERE);
abort;
endif;
-danjal
How do you read the MajorVersion from registry and check if it is version 6 or higher?
Here is what I am trying to do, but it fails:
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
RegDBGetKeyValueEx ("SYSTEM\\CurrentControlSet\\Services\\W3SVC\\Parameters","MajorVersion",nvType,szReturn,nReturn);
StrReplace(szReturn,".","",0);
StrToNum(nReturn,szReturn);
if (szReturn < "6") then
MessageBox("The Internet Information Server must be version 6.0 or higher", SEVERE);
abort;
endif;
-danjal
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 26, 2009
04:56 PM
@danjal
We're doing almost the same thing but on a different registry key in HKLM:
If all you need is the version this should work (for IIS 7, anyway). If you need to know if IIS is currently installed you'll want to look at the same key to grab "InstallPath", expand it as necessary, then look for a DLL file such as "iiscore.dll" (again, in IIS 7) in the expanded directory. We thought our detection was sufficient with looking at the registry until I uninstalled IIS to validate our check and found the check thought IIS was installed after I had just uninstalled it.
We're doing almost the same thing but on a different registry key in HKLM:
szKey = "SOFTWARE\\Microsoft\\InetStp";
szName = "MajorVersion";
nSize = 10;
nResult = RegDBGetKeyValueEx( szKey, szName, nType, szValue, nSize );
if ( StrCompare( szValue, "7" ) < 0 ) then
// wrong version of IIS is installed
return( FALSE );
endif;
If all you need is the version this should work (for IIS 7, anyway). If you need to know if IIS is currently installed you'll want to look at the same key to grab "InstallPath", expand it as necessary, then look for a DLL file such as "iiscore.dll" (again, in IIS 7) in the expanded directory. We thought our detection was sufficient with looking at the registry until I uninstalled IIS to validate our check and found the check thought IIS was installed after I had just uninstalled it.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 27, 2009
06:07 AM
Thank you Honolua!!!
That worked perfectly 😉
-Dánjal
That worked perfectly 😉
-Dánjal