thielen
Fri Nov 24 14:49:01 CST 2006
Hi;
For item (2) - that is exactly what I was looking for.
For (1) I have found:
ServiceController[] scServices = ServiceController.GetServices();
foreach (ServiceController srvc in scServices)
if (srvc.ServiceName.ToUpper() == "W3SVC")
return true;
return false;
For (3) I am checking the service to see if it is running and if it is set
to start automatically when the system starts.
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars -
http://www.windwardreports.com/film.htm
""WenJun Zhang[msft]"" wrote:
> Hi Dave,
>
> 1) How can I tell if IIS is installed?
>
> As I mentioned before, you can detect this by querying registry or metabase.
>
> 2) If not installed, how can I kick off the installation - I know this uses
> the Add/Remove applet but how do I kick this off so it starts with install
> IIS selected?
>
> There is no command to start IIS installation directly except performing an
> unattended installation. Using the following command can start Add/Remove
> Windows Components dialog:
>
> sysocmgr /i:%windir%\inf\sysoc.inf
>
> 3) If installed, how do I tell if IIS is enabled and if not enabled, how do
> I enable it?
>
> What's the exact meaning of 'enabled' here? Do you mean you want to check
> if a special web site is started but not stopped? Or you want to check if
> IIS service is running?
>
> IMHO, even if IIS service and web site are started, we still cannot
> determine if the web is running properly. Maybe a most straight-forward way
> to check this is sending a http request to 80 port and check if it returns
> a 200 OK response.
>
> Thanks.
>
> Sincerely,
>
> WenJun Zhang
>
> Microsoft Online Community Support
>
> ==================================================
>
> Get notification to my posts through email? Please refer to:
>
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at:
>
>
http://msdn.microsoft.com/subscriptions/support/default.aspx.
>
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
>
>