有什么方法可以从C#代码安装IIS?
我需要为我的应用程序创建一个部署安装程序,但我需要在机器上安装IIS,因此我想验证是否使用C#代码安装了IIS,如果不是则安装它.
安装程序必须适用于所有版本的IIS.
提前致谢.
圣保罗
在我使用的方法中:我为不同的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
以下是有关此主题的一些链接:
http://blogs.msdn.com/b/rakkimk/archive/2007/06/22/how-to-perform-an-unattended-install-uninstall-of-iis-5- 0-5-1-6-0.aspx 
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/
| 归档时间: | 
 | 
| 查看次数: | 5718 次 | 
| 最近记录: |