我正在使用Wix 3.5构建一个MSI安装程序,在IIS 7中安装两个Web应用程序。用户可以为每个应用程序选择是将其安装在“默认网站”下还是IIS中的任何其他现有WebSite中。 通过在IIS中创建两个Web应用程序,安装程序在INSTALL期间可以正常工作。问题是卸载产品后,一个应用程序被删除但另一个应用程序留在IIS管理器中,因此必须手动删除。 所有与WebApp相关的文件都会被删除,组件也会被删除,但IIS WebApp会被遗忘。 安装程序针对x86和x64目标体系结构进行了编译。 我正在Windows Server 2008 R2中测试安装程序。
注意:
我看不出我做错了什么。我在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 :(得分:0)
我没有看到您的功能或产品元素。您是将这些组件构建为1个MSI还是2个MSI?
一般来说,请阅读安装程序日志,以了解卸载时是否遗留了任何组件。我在共享组件/多实例安装中看到了很多。一旦解决方案是为组件提供伪文本文件并将其标记为密钥文件并将组件标记为共享。
除了猜测之外,详细的答案需要更多信息。