2012-09-04 77 views
4

我使用Wix 3.5构建MSI安装程序,该安装程序在IIS 7中安装两个Web应用程序。用户可以为每个应用程序选择是将其安装在“默认Web站点”还是任何其他现有IIS中的WebSite。 安装程序在INSTALL期间通过在IIS中创建两个Web应用程序正常工作。问题是卸载产品后,一个应用程序被删除,但另一个被留在IIS管理器中,因此必须手动删除。 与WebApp相关的所有文件都被删除,组件也被删除,但IIS WebApp被留下。 安装程序是针对x86和x64目标体系结构编译的。 我正在测试Windows Server 2008 R2中的安装程序。Wix不卸载IIS Web应用程序

注:

  • 问题只发生在64位的Windows Server 2008 R2。在x86中, 应用程序均正确地从IIS中删除。
  • 这个问题只发生在两个应用程序安装在 下同一个网站(一个被删除,另一个被留下)时。
  • 我试过安装3个Web应用程序,我发现有两个被删除,第三个被留下。剩下的Web App取决于它们在Product.wxs中定义的顺序
  • 我在卸载过程中检查了空属性,事实并非如此。
  • 通过从WebService应用程序中删除“iis:WebApplication”标记元素,将虚拟目录从IIS中删除。

我看不到我做错了什么。我读过很多关于Stackoverflow的文章,但是我没有发现这个问题。我真的很感谢你在这个问题上的帮助或指导。

这是我在该网站的第一篇文章,所以如果我犯了错误请求原谅。 我一直在寻找这个问题的解决方案很长时间,并没有发现任何人有这个问题。也许我的Wix XML代码有问题。

Product.wxs的相关部分:

<Directory Id="TARGETDIR" Name="SourceDir"> 
     <!-- Program Files (x86) --> 
     <Directory Id="ProgramFilesFolder">    
      <Directory Id="INSTALLDIR_x86" Name="MyApplications">         
       <!-- Web Service IIS WebAPP --> 
       <Directory Id="WebServicesDIR" Name="MyWebApp1 5.2"> 
        <!-- Windows Server 2008 and Vista Application pool --> 
        <Component Id="WebReportingAppPool" Guid="{SOME_GUID}" DiskId="1" KeyPath="yes" Win64="no"> 
         <!-- Define Application Pool --> 
         <iis:WebAppPool Id="WebServicesAppPool" Name="Web Reporting 5.2" Identity="networkService" ManagedPipelineMode="integrated" ManagedRuntimeVersion="v2.0" /> 
         <!-- remove WebServicesDIR folder on uninstall --> 
         <RemoveFolder Id="WebServicesDIR" On="uninstall" /> 
        </Component> 
        <!-- Web App 1 Virtual Directory --> 
        <Component Id="App1_VirtualDirectory" Guid="{SOME_GUID2}" DiskId="1" KeyPath="yes" Win64="no"> 
         <!-- Virtual directory --> 
         <iis:WebVirtualDir Id="App1_WebVirtualDirectory" Alias="WebReportingServices_1" Directory="WebServicesDIR" WebSite="IWSTargetWebSite"> 
          <!-- Web Application --> 
          <iis:WebApplication Id="WebServicesWebApp" Name="WebReportingServices-5.2" WebAppPool="WebServicesAppPool">         
           <iis:WebApplicationExtension Extension="dll" CheckPath="yes" Script="yes" Executable="[#FIsapi_dll]" Verbs="GET,HEAD,POST" /> 
           <iis:WebApplicationExtension Extension="srf" CheckPath="yes" Script="yes" Executable="[#FIsapi_dll]" Verbs="GET,HEAD" /> 
          </iis:WebApplication> 
          <!-- Properties --> 
          <iis:WebDirProperties Id="WebServicesWebDirProp" Read="yes" LogVisits="yes" Index="yes" Script="yes" Execute="no" DefaultDocuments="default.htm" BasicAuthentication="no" PassportAuthentication="no" DigestAuthentication="no" IIsControlledPassword="no" WindowsAuthentication="yes" /> 
         </iis:WebVirtualDir> 
         <!-- indicate the application is installed --> 
         <RegistryValue Root="HKLM" Key="Software\MyCompany\WebServices-5.2" Name="installed" Type="integer" Value="1" /> 
        </Component> 
       </Directory>               
      </Directory> 
     </Directory>      
    </Directory> 

    <Directory Id="WebTaskFolder" Name="Web Tasks 4.3"> 
      <!-- Application pool user --> 
      <Component Id="IWAApplicationPoolUser" Guid="{SOME_GUID3}" DiskId="1" Permanent="yes" Transitive="yes"> 
       <!-- do not anything on uninstall/upgrade/reinstall --> 
       <Condition>NOT Installed AND NOT UPGRADE AND NOT (REINSTALL ~= "ALL")</Condition> 
       <CreateFolder /> 
       <!-- Application Pool and anonymous User --> 
       <util:User Id="IWAApplicationPoolAccount" Domain="[IWA_APP_POOL_DOMAIN]" Name="[IWA_APP_POOL_USERNAME]" Password="[IWA_APP_POOL_PASSWORD]" CreateUser="no" UpdateIfExists="no" RemoveOnUninstall="no">      
        <util:GroupRef Id="IISGroup" /> 
       </util:User> 
      </Component> 
      <!-- Windows Server 2008 and Vista Application pool --> 
      <Component Id="IWAApplicationPool" Guid="{Guid Here}" DiskId="1" KeyPath="yes"> 
       <!-- Define Application Pool --> 
       <iis:WebAppPool Id="IWAWebAppPool" Name="Web Tasks 4.3" Identity="other" User="IWAApplicationPoolAccount" ManagedPipelineMode="integrated" ManagedRuntimeVersion="v2.0" /> 
       <!-- remove folder on uninstall --> 
       <RemoveFolder Id="WebTaskFolder" On="uninstall" />     
      </Component> 
      <!-- Virtual Directory --> 
      <Component Id="WebTaskVirtualDir" Guid="{Guid here}" DiskId="1" KeyPath="yes">     
       <iis:WebVirtualDir Id="IWAWebVirtualDir" Alias="WebTasks4.3" Directory="WebTaskFolder" WebSite="IWATargetWebSite"> 
        <!-- Web Application --> 
        <iis:WebApplication Id="WebTasksVirtualDirectoryWebApplication" Name="WebTasks6.3" WebAppPool="IWAWebAppPool" /> 
        <!-- Properties --> 
        <iis:WebDirProperties Id="IWAVirtualDirectoryWebDirProperties" AnonymousAccess="yes" AnonymousUser="IWAApplicationPoolAccount" Read="yes" LogVisits="yes" Index="yes" Script="yes" Execute="no" DefaultDocuments="default.aspx" BasicAuthentication="no" PassportAuthentication="no" DigestAuthentication="no" IIsControlledPassword="no" WindowsAuthentication="yes" /> 
       </iis:WebVirtualDir> 
       <!-- indicate the application is installed --> 
       <RegistryValue Root="HKLM" Key="Software\MyCompany\WebTasks-4.2" Name="installed" Type="integer" Value="1" />     
      </Component>         
    </Directory>         
    <!-- Add Virtual Directory to IWSTargetWebSite --> 
    <iis:WebSite Id='IWSTargetWebSite' Description="WebTasks WebApp" Directory="WebServicesDIR" SiteId="[IWS_TARGET_WEBSITE]"> 
     <iis:WebAddress Id="IWerbServiceWebAddress" IP="*" Port="80" /> 
    </iis:WebSite> 
    <!-- Add Virtual Directory to IWATargetWebSite --> 
    <iis:WebSite Id='IWATargetWebSite' Description="WebServices WebApp" Directory="WebTaskFolder" SiteId="[IWA_TARGET_WEBSITE]"> 
     <iis:WebAddress Id="IWebTaskWebAddress" IP="*" Port="80" /> 
    </iis:WebSite> 
+0

我有非常类似的问题:我的安装程序创建一个单独的网站与子虚拟目录。启用UAC后,它不会在Windows Server 2008 R2上使用原始安装程序进行卸载。有趣的细节:从控制面板运行卸载可成功移除站点。仅当直接运行原始安装程序时才会出现此问题。希望这个细节将有助于调查这个 –

回答

0

我没有看到你的功能或产品元素。您是将这些组件构建为1个MSI还是2个MSI?

一般来说,请阅读安装程序日志以查看是否有任何组件在卸载时被留下。我在共享组件/多实例安装中看到了很多。一旦解决方案是给组件一个伪造的文本文件并将其标记为密钥文件并将该组件标记为共享。

其他然后猜测,详细的答案需要更多的信息。

+0

你好,谢谢你的回答。我已经检查了一段时间的日志,并且发现这些组件正在被请求卸载,并被卸载。 (请求:不存在,操作:不存在)文件被删除,所有内容都被删除,但WebApp保留在IIS管理器控制台中。我有两个功能,每个功能都安装了带有所有组件的WebApp。 – Herno

+0

另外,我正在从一样的源代码构建一切到2 MSI。我编译一次生成MyProduct-x86.msi,第二次生成MyProduct-x64.msi。 – Herno

+0

你正在安装吗?您可能有违反组件规则的情况,它会混淆组件引用计数,导致组件/资源(IIS元)的非完全卸载。 –