使用pkgmgr安装IIS 7 [英] Using pkgmgr to install IIS 7

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

问题描述

如果尚未在目标系统上安装IIS 7,我将使用以下自定义操作来安装IIS 7.我正在跟踪错误,我的安装失败.我在msi中使用了很多CA,并且一切正常.但是,对于这一问题,我无法弄清楚可能是什么问题?直接在cmd提示符下执行此命令非常有效. 任何人都可以提供关于我在做什么错的任何建议吗?请指教

I am using following custom action to install IIS 7 using .msi if its not already installed on targeted system. I am getting following errror and my installation fails. I have used quite a few CA in my msi and all work well. However for this one I am not able to figure out what the problem could be? Executing this command directly on cmd prompt works perfect. Can anyone provide any suggestions as to what am i doing wrong? Please advice

目标操作系统:Windows 7 -32位

Targeted OS: Windows 7 -32 bit

CustomAction代码:

CustomAction Code:

<Property Id="INSTALLIISPROP" Value="[SystemFolder]"></Property>
  <CustomAction Id="InstallIISCA" Return="check" Property="INSTALLIISPROP" Execute="deferred" ExeCommand=" start /w pkgmgr /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-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-Security;IIS-WindowsAuthentication;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-WebServerManagementTools; IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI;NetFx3"></CustomAction><InstallExecuteSequence><Custom Action="InstallIISCA" Before="InstallFinalize"><![CDATA[NOT Installed AND IISMAJORVERSION]]></Custom></InstallExecuteSequence>

我的日志文件中的错误:

Error from my log file:

错误1721. Windows Installer程序包存在问题.无法完成该安装所需的程序.请与您的支持人员或包装供应商联系.行动:InstallIISCA,位置:[SystemFolder],命令:start/w pkgmgr/iu:IIS-WebServerRole; IIS-WebServer; IIS-CommonHttpFeatures; IIS-StaticContent; IIS-DefaultDocument; IIS-DirectoryBrowsing; IIS-HttpErrors; IIS-HttpRedirect ; IIS应用程序开发; IIS-ASPNET; IIS-NetFx可扩展性; IIS-ASP; IIS-ISAPI扩展; IIS-ISAPIFilter; IIS-HealthAndDiagnostics; IIS-HttpLogging; IIS-LoggingLibraries; IIS-RequestMonitor; IIS-HttpTracing; IIS-CustomLogging; IIS -安全性; IIS-Windows身份验证; IIS-RequestFiltering; IIS-IP安全性; IIS-性能; IIS-HttpCompressionStatic; IIS-WebServerManagementTools; IIS-ManagementConsole; IIS-ManagementScriptingTools; IIS-ManagementService; WAS-WindowsActivationService; WAS-ProcessModel; WAS-NetFxEnvironment; WAS-ConfigurationAPI; NetFx3

Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: InstallIISCA, location: [SystemFolder], command: start /w pkgmgr /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-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-Security;IIS-WindowsAuthentication;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;WAS-WindowsActivationService; WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI;NetFx3

信息:我正在使用以下代码检查IIS是否已安装

MOre Information: I am using following code to check if IIS is already installed

<Property Id="IISMAJORVERSION"><RegistrySearch Id="IISInstalledVersion" Root="HKLM" Key="SOFTWARE\Microsoft\InetStp" Type="raw" Name="MajorVersion" /></Property><Condition Message="Error: This application requires IIS 7.0 to be installed. Please install IIS 7.0 and run this installer again.">IISMAJORVERSION</Condition>

在另一台计算机上,此条件为true,因为未安装IIS.但是当使用msi时,没有错误消息,并且日志文件显示: MSI(s)(CC:F8)[15:32:00:761]:跳过操作:InstallIISCA(条件为假)?这怎么可能.

On one of the other machine, this condition is true, as there is no IIS installed. But when using msi, there is no error message and log file says: MSI (s) (CC:F8) [15:32:00:761]: Skipping action: InstallIISCA (condition is false)?? How can this be possible.

还用C#创建了一个备用CA,但它也因Windows软件包管理器错误而失败:操作失败

Also created an alternate CA in C# but its also failing with Windows package Manager error: Operation Failed

[CustomAction]
    public static ActionResult InstallIIS(Session session)        
    {
        try
        {
            Process proc = new Process();
            string cmd = @"C:\Windows\System32\pkgmgr.exe";

            string cmdargument =
                @" start /w pkgmgr /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-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;IIS-HttpLogging;
                IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-Security;IIS-WindowsAuthentication;
                IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-WebServerManagementTools;
                IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;WAS-WindowsActivationService;
                WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI;NetFx3";

            proc = Process.Start(cmd, cmdargument);
            proc.WaitForExit();
            proc.Close();
        }
        catch (Exception objException)
        {
            // Log the exception
            MessageBox.Show("Error message:" + objException.Message);
        }
        return ActionResult.Success;
    }

有人可以建议我如何实现这一目标吗?真诚的感谢!

Can someone suggest me on how to achieve this? Sincere thanks!

推荐答案

我知道了!!

在其他人需要相同解决方案的情况下发布解决方案:-)

Posting the solution in case anyone else needs the same :-)

<Property Id="INSTALLIISPROP" Value="C:\Windows\System32\dism.exe"></Property> 
  <CustomAction Id="InstallIISCA" Return="check" Property="INSTALLIISPROP" Execute="deferred" HideTarget="yes"  Impersonate="yes" 
      ExeCommand="/Online /Enable-Feature /FeatureName:IIS-WebServerRole .....(all remaining parameters) />

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

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