cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
pmatlock
Level 6

How to detect if a Server Role for WebServer(IIS) is installed + features

I am creating an InstallScriptMSI project, and I need to a way to verify on a SQL Server 2008 R2 server that
1. a Server Role for Web Server (IIS) has been installed
2. various features have been installed on this server (i.e)
a. .NET Framework 3.5.1 Features
b. WCF Activation

Any help/direction would be greatly appreciated.
Labels (1)
0 Kudos

(3) Replies
DanCla
Level 5

I think the best thing to do is to look for registry keys. This is what I do in one of my projects.
function ScriptingToolsCheck(hMSI)
STRING szKey, szName, svValue, szMsg;
NUMBER nvType, nvSize;
begin
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
szKey = "SOFTWARE\\Microsoft\\InetStp\\Components";
szName = "ManagementScriptingTools";
nvType = REGDB_STRING;
if(RegDBGetKeyValueEx(szKey, szName, nvType, svValue, nvSize) < 0) then
szMsg = "The setup needs IIS Management Scripts and Tools to be installed. ";
szMsg = szMsg + "Please add this role in Server Manager and then run this setup again.";
MessageBox(szMsg, SEVERE);
abort
endif;
RegDBSetDefaultRoot(HKEY_CLASSES_ROOT);
end;
0 Kudos
girishkatti123
Level 7

you can use the "Is" operation to check .dotnet framework .
You could also automate IIS installation by using the command line options and passing a Text file to it.
sysocmgr /i:c:\windows\info\sysoc.inf /u:c:\iis.txt
Attached the test file for your reference.
0 Kudos
lonewolf32
Level 5

Is there any chance that the "Is" function would find the Framework version 3.5 and not 3.5.1? My installer needs 3.5.1, is it possible that only 3.5 would be installed on a Server 2008 or Server 2008 R2 box? The reason I ask is because the Is function does not have a REGDB_KEYPATH_DOTNET_35_SP define.
0 Kudos