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"> <Directory Id="ProgramFilesFolder"> <Directory Id="INSTALLDIR_x86" Name="MyApplications"> <Directory Id="WebServicesDIR" Name="MyWebApp1 5.2"> <Component Id="WebReportingAppPool" Guid="{SOME_GUID}" DiskId="1" KeyPath="yes" Win64="no"> <iis:WebAppPool Id="WebServicesAppPool" Name="Web Reporting 5.2" Identity="networkService" ManagedPipelineMode="integrated" ManagedRuntimeVersion="v2.0" /> <RemoveFolder Id="WebServicesDIR" On="uninstall" /> </Component> <Component Id="App1_VirtualDirectory" Guid="{SOME_GUID2}" DiskId="1" KeyPath="yes" Win64="no"> <iis:WebVirtualDir Id="App1_WebVirtualDirectory" Alias="WebReportingServices_1" Directory="WebServicesDIR" WebSite="IWSTargetWebSite"> <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> <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> <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"> <Component Id="IWAApplicationPoolUser" Guid="{SOME_GUID3}" DiskId="1" Permanent="yes" Transitive="yes"> <Condition>NOT Installed AND NOT UPGRADE AND NOT (REINSTALL ~= "ALL")</Condition> <CreateFolder /> <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> <Component Id="IWAApplicationPool" Guid="{Guid Here}" DiskId="1" KeyPath="yes"> <iis:WebAppPool Id="IWAWebAppPool" Name="Web Tasks 4.3" Identity="other" User="IWAApplicationPoolAccount" ManagedPipelineMode="integrated" ManagedRuntimeVersion="v2.0" /> <RemoveFolder Id="WebTaskFolder" On="uninstall" /> </Component> <Component Id="WebTaskVirtualDir" Guid="{Guid here}" DiskId="1" KeyPath="yes"> <iis:WebVirtualDir Id="IWAWebVirtualDir" Alias="WebTasks4.3" Directory="WebTaskFolder" WebSite="IWATargetWebSite"> <iis:WebApplication Id="WebTasksVirtualDirectoryWebApplication" Name="WebTasks6.3" WebAppPool="IWAWebAppPool" /> <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> <RegistryValue Root="HKLM" Key="Software\MyCompany\WebTasks-4.2" Name="installed" Type="integer" Value="1" /> </Component> </Directory> <iis:WebSite Id='IWSTargetWebSite' Description="WebTasks WebApp" Directory="WebServicesDIR" SiteId="[IWS_TARGET_WEBSITE]"> <iis:WebAddress Id="IWerbServiceWebAddress" IP="*" Port="80" /> </iis:WebSite> <iis:WebSite Id='IWATargetWebSite' Description="WebServices WebApp" Directory="WebTaskFolder" SiteId="[IWA_TARGET_WEBSITE]"> <iis:WebAddress Id="IWebTaskWebAddress" IP="*" Port="80" /> </iis:WebSite>
source share