简体   繁体   中英

Wix does not uninstall IIS Web Application

I am using Wix 3.5 to build a MSI installer that installs two Web Applications in IIS 7. The user can choose for each application whether to install it under "Default Web Site" or any other existing WebSite in IIS. The installer works correctly during INSTALL by creating the two Web Applications in IIS. The problem is that after uninstalling the product, one application is removed but the other is left behind in the IIS Manager, so it has to be deleted by hand. All files related to the WebApp are removed and the components too, but the IIS WebApp is left behind. The installer is compiled both for x86 and x64 target architectures. I am testing the installer in a Windows Server 2008 R2.

Notes:

  • The problem only happens in x64 Windows Server 2008 R2. In x86 both applications are correcly removed from IIS.
  • The problem only happens when both application are installed under the same WebSite(one is removed and the other is left behind).
  • I've tried installing 3 Web Applications and i discovered that two are removed, and a third is left behind. The reamining Web App depends in the order that they were defined in the Product.wxs
  • I've checked for empty properties during uninstall, and that's not it.
  • By removing the "iis:WebApplication" tag element from the WebService App, the Virtual Directory is removed from IIS.

I can't see what i am doing wrong. I've read many articles in Stackoverflow about the but i didn't found this problem. I'd really appreciate your help or guideance in the issue.

This is my first post in the site so i beg your pardon if i've made any mistakes. I've been searching for a solution to this issue for long and haven't found anyone having this problem. Maybe there is something wrong with my Wix XML code.

The 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>

I don't see your Feature or Product elements. Are you building these components into 1 MSI or 2 MSI's?

Generally speaking, read the installer log to see if any of the components are being left behind on uninstall. I see this a lot in shared components / multiple instance installs. Once solution is to give the component a fake text file and mark it as the key file and mark the component as shared.

Other then guessing, a detailed answer requires more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM