[wix-users] Uninstalling an existing website on upgrade

Brian Enderle brianke at gmail.com
Tue Feb 9 07:49:10 PST 2016


We have a product that was using IIS and WCF to host a CLR.  We have
updated this product to run the WCF/CLR as a Windows service so as to
eliminate the need for IIS setup.

How can I check for the existence of the website & app pool and then
uninstall both during an upgrade if they exist?


Here is how the website is installed with the earlier version of the
product:

    <DirectoryRef Id="INSTALLFOLDER_FOXPROCONNECTWS">

      <!-- Setup application pool information using IISSERVICEACCOUNT
from AcctInfoDlg.wxs -->
      <Component Id="InstallAppPool" Guid="$(var.AppPoolGUID)" KeyPath="yes">
        <iis:WebAppPool Id="FoxProConnectWS"
                        Name="FoxProConnectWS"
                        Identity="applicationPoolIdentity"
                        ManagedPipelineMode="Integrated"
                        ManagedRuntimeVersion="v4.0" />
      </Component>

      <!-- Create the website in IIS -->
      <Component Id="InstallWebsite" Guid="$(var.WebsiteGUID)" KeyPath="yes">
        <iis:WebVirtualDir Id="WebSiteVirtualDir"
Alias="FoxProConnectWS" Directory="INSTALLFOLDER_FOXPROCONNECTWS"
WebSite="FoxProWebsite" >
          <iis:WebApplication Id="WebSiteApp" Name="FoxProConnectWS"
Isolation="medium" WebAppPool="FoxProConnectWS" />
        </iis:WebVirtualDir>
      </Component>


    </DirectoryRef>

    <!-- These 'website's are defined outside of the 'DirectoryRef' so
as to create the websites under the 'Default Web Site' entry in IIS
-->
    <iis:WebSite Id="FoxProWebsite" Description="FoxProConnectWS"
Directory="INSTALLFOLDER_FOXPROCONNECTWS"  >
      <iis:WebAddress Id="AllUnassigned" Port="80" />
    </iis:WebSite>


Brian

If you can't explain it simply, you don't understand it well enough.  -
Albert Einstein


More information about the wix-users mailing list