gpt4 book ai didi

.net - Wix 不会卸载 IIS Web 应用程序

转载 作者:行者123 更新时间:2023-12-04 21:43:30 25 4
gpt4 key购买 nike

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

笔记:

  • 该问题仅发生在 x64 Windows Server 2008 R2 中。在 x86 中
    正确地从 IIS 中删除了应用程序。
  • 仅当两个应用程序都安装在
    同一个网站(一个被删除,另一个被留下)。
  • 我已经尝试安装 3 个 Web 应用程序,但我发现其中两个被删除了,第三个被留下了。重新挖掘的 Web 应用程序取决于它们在 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>

    最佳答案

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

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

    除了猜测,详细的答案需要更多信息。

    关于.net - Wix 不会卸载 IIS Web 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12256697/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com