有什么方法可以从C#代码安装IIS吗?我需要为我的应用程序创建一个部署安装程序,但我需要在计算机中安装IIS,因此我想验证IIS是否使用C#代码安装,如果没有安装,则安装它。安装程序必须适用于所有版本的IIS。先谢了。保罗
u4dcyp6a1#
在我使用的方法中:我为不同的IIS版本调用followind命令行应用程序。对于IIS 5.1(Windows XP)和IIS 6(Windows Server 2003):
Sysocmgr.exe /i:sysoc.inf /u:IIS_on.txt
IIS_on. txt的内容
[Components] iis_common = ON iis_www = ON iis_www_vdir_scripts = ON iis_inetmgr = ON fp_extensions = ON iis_ftp = ON
对于IIS 7(Windows Vista)和7.5(Windows 7):
start /w pkgmgr /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-Security;IIS-BasicAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI
这里有一些关于这个主题的链接:Linkhttp://support.microsoft.com/kb/309506http://technet.microsoft.com/pt-br/library/cc731911(WS.10).aspxhttp://learn.iis.net/page.aspx/132/install-iis-7-from-the-command-line/http://learn.iis.net/page.aspx/479/iis-70-features-and-vista-editions/http://learn.iis.net/page.aspx/135/discover-installed-components/
1条答案
按热度按时间u4dcyp6a1#
在我使用的方法中:我为不同的IIS版本调用followind命令行应用程序。
对于IIS 5.1(Windows XP)和IIS 6(Windows Server 2003):
IIS_on. txt的内容
对于IIS 7(Windows Vista)和7.5(Windows 7):
这里有一些关于这个主题的链接:
Link
http://support.microsoft.com/kb/309506
http://technet.microsoft.com/pt-br/library/cc731911(WS.10).aspx
http://learn.iis.net/page.aspx/132/install-iis-7-from-the-command-line/
http://learn.iis.net/page.aspx/479/iis-70-features-and-vista-editions/
http://learn.iis.net/page.aspx/135/discover-installed-components/