cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
danjal
Level 5

Check if IIS 6 or higher is installed

Hi,

I have a InstallScript MSI Project where I want to be able to check if IIS 6 or higher is installed.
I want to display a message if IIS 6 or higher is not installed.

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;


Thanx.
Labels (1)
0 Kudos
(1) Reply
danjal
Level 5

I found help and resolved the problem. This is the code that works.


RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
if (RegDBKeyExist("SOFTWARE\\Microsoft\\InetStp") < 0) then
MessageBox("The Internet Information Server must be version 6.0 or higher", SEVERE);
abort;
else
nSize = 10;
if (RegDBGetKeyValueEx("SOFTWARE\\Microsoft\\InetStp","MajorVersion",nvType,szReturn,nSize) < 0) then
MessageBox("The Internet Information Server must be version 6.0 or higher", SEVERE);
abort;
else
if ( StrCompare( szReturn, "6" ) < 0 ) then
MessageBox("The Internet Information Server must be version 6.0 or higher", SEVERE);
abort;
else
if ( StrCompare( szReturn, "7" ) < 0 ) then
iisVersion = 6;
else
iisVersion = 7;
endif;
endif;
endif;
endif;


Thanks to Honolua:
http://community.acresso.com/showthread.php?p=439374#post439374
0 Kudos