从C#代码安装IIS [英] Install IIS from C# code

查看:267
本文介绍了从C#代码安装IIS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是我可以从C#代码安装IIS什么办法?结果
我需要创建一个安装部署我的应用程序,但我需要被安装在本机IIS,所以我想,以验证是否IIS装是用C#代码,如果它不安装它。
结果安装人员必须使用IIS的所有版本。

Is any way that I can install IIS from C# code?
I need to create a deploy installer for my application but I need that IIS to be installed in the machine so I want to verify if IIS is installed using C# code and install it if it's not.
The installer must work with all versions of IIS.

感谢。
结果圣保罗

Thanks in advance.
Paulo

推荐答案

在这里,我用的方法:
我称之为followind命令行应用不同的IIS版本。
结果
。对于IIS 5.1(Windows XP中)和IIS 6(在Windows Server 2003):

Here in the method I used: I call the followind command line applications for the different IIS versions.
For IIS 5.1 (Windows XP) and IIS 6 (Windows Server 2003):

Sysocmgr.exe /i:sysoc.inf /u:IIS_on.txt

IIS_on.txt内容

Content of 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中):

For IIS 7 (Windows Vista) and 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-执行安 - 无人值守安装,卸载-的-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 /安装-IIS-7 - 从最命令行/ 结果
http://learn.iis.net/page.aspx/479/iis-70-features-and-vista-editions/ 结果
http://learn.iis.net/page.aspx/135/discover-installed-components /

Here are some links about this subject:
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/

这篇关于从C#代码安装IIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆