WiX: configureIIS custom action is executed despite no web related component is selected

Sometimes, when you have a complex setup which contains both web related components and other components.

For example:

<Component Id=WebComponent Guid=4f85112d-2084-49e1-abb5-0631e842dfb4>


  <iis:WebSite Id=DefaultWebSite Description=Default Web Site Directory=INSTALLLOCATION>

    <iis:WebAddress Id=AllUnassigned Port=80  />


  <iis:WebVirtualDir Id=VirtualDir Alias=vdir Directory=INSTALLLOCATION WebSite=DefaultWebSite>

    <iis:WebApplication Id=WebApplication Name=vdir />



<Component Id=NoWebComponent Guid=4b852c0b-43e0-47b1-99ec-a1e80dc06f6e>

  <File Id=F_README Source=readme.txt Name=readme.txt/>


But despite the fact that no web related features were selected, installer fails with message that it cannot connect to iis. It turns out that ConfigureIIs custom action is executed. In WiX version 3 you can disable this action with:


  <Custom Action=ConfigureIIs After=InstallFiles>$WebComponent>2</Custom>