如果AppPool已经存在,WebAppPool将失败 - WiX 3.5

时间:2011-01-18 19:21:05

标签: wix wix3.5

这适用于WiX 3.0。

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="inetpubDir" Name="inetpub">
    <Directory Id="wwwrootDir" Name="wwwroot">
      <Directory Id="INSTALLDIR" Name="DS3000Services" FileSource="\Server\Implementation\DS3000Services\Web">
        <Component Id="DS3000ServicesVirtualDir" Guid="{4EFD7047-09F4-42e7-ACB5-A209D26B0338}">
          <CreateFolder />
          <iis:WebAppPool Id="AppPool" Name="[AppPoolName]" Identity="other" User="PortalUser" IdleTimeout="0" RecycleMinutes="0">
            <iis:RecycleTime Value="1:00" />
          </iis:WebAppPool>
          <iis:WebVirtualDir Id="DS3000ServicesVirtualDir" Alias="[VIRTUALDIR]" Directory="INSTALLDIR" WebSite="DefaultWebSite">
            <iis:WebApplication Id="DS3000ServicesApp" Name="DS3000 Services" Isolation="medium" WebAppPool="AppPool" />
          </iis:WebVirtualDir>
        </Component>

安装日志:

MSI (s) (10:E8) [09:57:58:553]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI14A0.tmp, Entrypoint: WriteIIS7ConfigChanges
WriteIIS7ConfigChanges:  Error 0x800700b7: Failed to add appPool element
WriteIIS7ConfigChanges:  Error 0x800700b7: Failed to configure IIS appPool.
WriteIIS7ConfigChanges:  Error 0x800700b7: WriteIIS7ConfigChanges Failed.
CustomAction WriteIIS7ConfigChanges returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (10:4C) [09:57:58:585]: User policy value 'DisableRollback' is 0
MSI (s) (10:4C) [09:57:58:585]: Machine policy value 'DisableRollback' is 0
Action ended 9:57:58: InstallFinalize. Return value 3.

在Win Server 2008 R2上安装。 AppPool已经存在。如果我删除AppPool,安装程序会成功。有什么想法吗?感谢...

1 个答案:

答案 0 :(得分:1)

我建议你创建一个customAction来创建虚拟目录以及Application Pool。

为此,我在项目中使用了自定义操作。在自定义操作中,您可以检查具有给定名称的应用程序池是否存在。

添加了内置命令

<Component Id="VDWeb" Guid="493E3487-AA4C-4476-8CC0-4B1C763AF6F7" Permanent="no">
    <iis:WebVirtualDir Id="VDir" Alias="[VDNAME]" Directory="dir_Application_0" WebSite="WebSelectedWebSite">
        <iis:WebApplication Id="WebApp" Name="[VDNAME]" WebAppPool="ABCAppPool" />
    </iis:WebVirtualDir>
    <RegistryKey Root="HKLM" Action="createAndRemoveOnUninstall" Key="SOFTWARE\ABC\[ProductCode]\VirtualDirectory">
        <RegistryValue Name="VDName" Type="string" Value="[VDNAME]"/>
    </RegistryKey>
</Component>

<Component Id="AppPool_1" Guid="414a377f-e044-49d5-b905-66bf3da6489f" Permanent="no">
    <util:User Id="PoolAccount" Domain="[DOMAINNAME]" Name="[LogonUser]" Password="[NT_PASSWORD]" CreateUser="no">
        <util:GroupRef Id="IISUsersGroup"/>
    </util:User>

    <iis:WebAppPool Id="ABCAppPool_NT" Name="[APPPOOLNAME_NT]" ManagedRuntimeVersion="v4.0" ManagedPipelineMode="integrated" Identity="other" User="PoolAccount">
        <iis:RecycleTime Value="05:00" />
    </iis:WebAppPool>
</Component>

<util:Group Id="IISUsersGroup" Name="IIS_IUSRS"/>

<iis:WebSite Id="WebSelectedWebSite" Description="[WEB_WEBSITE_DESCRIPTION]">
  <iis:WebAddress Id="AllUnassigned1" Port="[WEB_WEBSITE_PORT]" IP="[WEB_WEBSITE_IP]" Header="[WEB_WEBSITE_HEADER]" />
</iis:WebSite>

使用它并且它完全正常。