Wix does not remove IIS web application

I use Wix 3.5 to create an MSI installer that installs two web applications in IIS 7. The user can choose for each application whether to install it in the Default Website section or any other existing website in IIS. The installer works correctly during the INSTALLATION by creating two web applications in IIS. The problem is that after the product is uninstalled, one application is uninstalled and the other remains in IIS Manager, so you must uninstall it manually. All WebApp-related files are deleted, as are the components, but IIS WebApp is left behind. The installer is compiled for both x86 and x64 target architectures. I am testing the installer on Windows Server 2008 R2.

Notes:

  • The problem only occurs in x64 Windows Server 2008 R2. On x86, both applications are patched from IIS.
  • The problem only occurs if both applications are installed in the same WebSite (one is uninstalled and the other is left behind).
  • I tried installing 3 web applications, and I found that two of them were removed and the third was behind. An expanding web application depends on what they are defined in Product.wxs
  • I checked for empty properties at the time of deletion, and that is not the case.
  • By removing the "iis: WebApplication" tag element from the WebService application, the virtual directory is removed from IIS.

I do not see what I am doing wrong. I read a lot of articles on Stackoverflow about that, but I did not find this problem. I would really appreciate your help or guidance in this matter.

This is my first post on the site, so I apologize if I made any mistakes. I searched for a solution to this problem for a long time and did not find a single problem. Maybe something is wrong with my Wix XML code.

Relevant part of 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> 
+4
source share
1 answer

I do not see your Feature or Product items. Are you building these components in 1 MSI or 2 MSI?

Generally speaking, read the installerโ€™s log to see if any of the components remained during uninstallation. I see this a lot in installations with common components / multiple instances. As soon as the solution is to provide the component with a fake text file and mark it as a key file and mark the component as shared.

Another, then guessing, detailed answer requires additional information.

0
source

Source: https://habr.com/ru/post/1432183/


All Articles