How to disable WebSite action on Wix if no web features are selected?

The Wix WebSite action must be specified outside the component if you want to use the default website safely (safely, I mean the installer will not delete the default website when it is deleted).

<Fragment>
    <iis:WebSite Id="DefaultWebSite" Description="Default Web Site" Directory="INSTALLDIR">
        <iis:WebAddress Id="AllUnassigned" Port="80" />
    </iis:WebSite>
</Fragment>

My installer has many features, and some of them are enabled only when installing IIS. Disabling condition-based features works fine and virtual directories or sites are not created, but during the installation, MSI still tries to contact IIS due to WebSite and crashes on the machine without installing IIS:

"Cannot connect to Internet Information Server. (-2137221164      )"

I found something about SKIPCONFIGUREIIS, but this does not seem to work on Wix 3.

+3
3

Wix 3, Custom Action Conditions InstallExecuteSequence. , "" , , IIS:

<InstallExecuteSequence>
    <!-- Disable ConfigureIIS if we don't need it: -->
    <Custom Action="ConfigureIIs" After="InstallFiles">(&amp;Web = 3)</Custom>
</InstallExecuteSequence>
+1

! , IIS . .. , IIS .

, :

<InstallExecuteSequence>
    <!-- Disable ConfigureIIS if we don't need it: -->
    <Custom Action="ConfigureIIs" After="InstallFiles"><![CDATA[&Web=3 OR !Web=3]]></Custom>
</InstallExecuteSequence>
+3

WIX- MSI NOT SKIPCONFIGUREIIS AND VersionNT > 400, ConfigureIis InstallExecuteSequence.

In other words, you can also use a custom action like this:

<InstallExecuteSequence>
  <!-- Disable the ConfigureIIs action if we don't need it: --> 
  <Custom Action="CA.SkipConfigureIIs" 
          After="InstallFiles">NOT &amp;F.IisFeature = 3</Custom>
</InstallExecuteSequence>


<CustomAction Id="CA.SkipConfigureIIs"
              Property="SKIPCONFIGUREIIS"
              Value="1"
              Return="check" />
0
source

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


All Articles