c# - Programmatically enable (install) IIS -
sometimes there pc doesn't have iis. either disabled or either not installed. in case need enable myself according steps.
i'm trying create application check if iis enabled (installed), , if not enable (install) it.
i tried install iis using .msi files here, asking me follow those stpes before installation.
i tried use advanced installer apparently installing iis 8.0 express still keeps iis disabled.
what need enable iis programmatically? acceptable if i'll need run iis installation file make done (i didn't find right one).
you can install iis via command line. following command install iis on windows 8 (you can edit add/remove features. it's command i've used in past):
pkgmgr:
start /w pkgmgr /iu:iis-webserverrole;iis-webserver;iis-commonhttpfeatures;iis-staticcontent;iis-defaultdocument;iis-directorybrowsing;iis-httperrors;iis-applicationdevelopment;iis-isapiextensions;iis-isapifilter;iis-netfxextensibility45;iis-aspnet45;iis-netfxextensibility;iis-aspnet;iis-healthanddiagnostics;iis-httplogging;iis-requestmonitor;iis-security;iis-requestfiltering;iis-httpcompressionstatic;iis-webservermanagementtools;iis-managementconsole;was-windowsactivationservice;was-processmodel;was-netfxenvironment;was-configurationapi
dism:
start /wait dism /online /enable-feature /featurename:iis-applicationdevelopment /featurename:iis-asp /featurename:iis-aspnet /featurename:iis-basicauthentication /featurename:iis-cgi /featurename:iis-clientcertificatemappingauthentication /featurename:iis-commonhttpfeatures /featurename:iis-customlogging /featurename:iis-defaultdocument /featurename:iis-digestauthentication /featurename:iis-directorybrowsing /featurename:iis-ftpextensibility /featurename:iis-ftpserver /featurename:iis-ftpsvc /featurename:iis-healthanddiagnostics /featurename:iis-hostablewebcore /featurename:iis-httpcompressiondynamic /featurename:iis-httpcompressionstatic /featurename:iis-httperrors /featurename:iis-httplogging /featurename:iis-httpredirect /featurename:iis-httptracing /featurename:iis-iis6managementcompatibility /featurename:iis-iiscertificatemappingauthentication /featurename:iis-ipsecurity /featurename:iis-isapiextensions /featurename:iis-isapifilter /featurename:iis-legacyscripts /featurename:iis-legacysnapin /featurename:iis-logginglibraries /featurename:iis-managementconsole /featurename:iis-managementscriptingtools /featurename:iis-managementservice /featurename:iis-metabase /featurename:iis-netfxextensibility /featurename:iis-odbclogging /featurename:iis-performance /featurename:iis-requestfiltering /featurename:iis-requestmonitor /featurename:iis-security /featurename:iis-serversideincludes /featurename:iis-staticcontent /featurename:iis-urlauthorization /featurename:iis-webdav /featurename:iis-webserver /featurename:iis-webservermanagementtools /featurename:iis-webserverrole /featurename:iis-windowsauthentication /featurename:iis-wmicompatibility /featurename:was-configurationapi /featurename:was-netfxenvironment /featurename:was-processmodel /featurename:was-windowsactivationservice
in c#, can create process executes command so:
string command = "the above command"; processstartinfo pstartinfo = new processstartinfo("cmd.exe", "/c " + command); process p = new process(); p.startinfo = pstartinfo; p.start();
Comments
Post a Comment