2010-07-14 4 views
6

Ist irgendeine Weise, die ich IIS vom C# Code installieren kann?
Ich muss ein Implementierungsprogramm für meine Anwendung erstellen, aber ich muss IIS auf dem Computer installieren, damit ich überprüfen kann, ob IIS mit C# -Code installiert ist, und es installiere, wenn dies nicht der Fall ist.
Das Installationsprogramm muss mit allen Versionen von IIS arbeiten.Installiere IIS von C# -Code

Vielen Dank im Voraus.
Paulo

+1

Erste Ergebnisse von Google: http://www.codeproject.com/KB/cs/iisdetection.aspx http://support.microsoft.com /default.aspx?scid=kb;en-us;309506 http://www.appdeploy.com/packages/detail.asp?id=93 –

+0

Werfen Sie einen Blick auf http://StackOverflow.com/questions/1649180/ Do-Web-Plattform-Installer-Support-Automatisierung. Sie können den Web Platform Installer verwenden, um die Installation zu starten, aber es erfordert Benutzerinteraktion. –

+1

@ Jaroslav, wenn das erste Ergebnis von Google für etwas, das mit Programmierung zusammenhängt, keine Seite auf Stackoverflow ist, dann müssen wir das beheben! :) – Rob

Antwort

8

Hier in der Methode, die ich verwendet: Ich rufe die Befehlszeilenprogramme folgeind für die verschiedenen IIS-Versionen.
Für IIS 5.1 (Windows XP) und IIS 6 (Windows Server 2003):

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

Inhalt des IIS_on.txt

[Components] 
iis_common = ON 
iis_www = ON 
iis_www_vdir_scripts = ON 
iis_inetmgr = ON 
fp_extensions = ON 
iis_ftp = ON 

für IIS 7 (Windows Vista) und 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 

Hier sind einige Links zu diesem Thema:
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/