1

I try to create installer, where web site is creates too. I use the following code

....
<DirectoryRef Id="WEBFOLDER">
    <Component Id="WebLibraries" Guid="77532F98-BF0B-4b9d-98AF-15618691A090" KeyPath="yes">
        <iis:WebSite Id="DefaultWebSite" Description="Default Web Site" Directory="WEBFOLDER">
            <iis:WebAddress Id="AllUnassigned" Port="80" />
        </iis:WebSite>
    </Component>
</DirectoryRef>
....
<Feature Id="WebSite" Level="1" Title="Web site">
    <ComponentRef Id="WebLibraries" />
</Feature>
....

but when i try to install a created package on machine where iis is not installed, i have got this message even i don't check this feature:

cannot connect to internet information server

Can anybody help me with this trouble?

Thanks in advance.

basilkot
  • 592
  • 6
  • 15

1 Answers1

2

You're installing your package on a machine where IIS is not installed. What would you expect? :)

To be serious, the WiX IIsExtension (the one which defines WebSite element) uses the API of IIS component to actually do its job. For WiX v3.0 it even requires IIS 6 compatibility to be turned ON in IIS 7 in order to work correctly.

Your component, which contains WebSite element, is not conditioned. this means it will always be installed. When it is installed, the IIsExtension tries to create a website defined in it (if we tell this story short).

So, I would recommend you to do the following (if you wish just skip the IIS part of your installer on target machines like that):

  • add a launch condition to check if the IIS component is installed (you can rely on IISMAJORVERSION property defined by IIsExtension itself)
  • condition your component (or feature) which is dependent on IIS with "NOT IISMAJORVERSION" condition

As a result, when IISMAJORVERSION property is not set (IIS is not installed), your component will not be scheduled for install and the IIS custom actions won't run.

P.S. The SKIPCONFIGUREIIS property I initially meant is "all-or-nothing" switch, and is not an appropriate tool for your case.

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
  • I expect, that IIS extension shuold not be executed when this feature is unchecked. I cannot understand what exactly iis extension try to do in this case? – basilkot Feb 16 '11 at 13:27
  • Well, actually the IIS entities in terms of the installation are tied to the component they reside in. Your component is not conditioned, this means it will always be installed. When the component is installed, the website in it is also created. – Yan Sklyarenko Feb 16 '11 at 14:32
  • I just realized that my initial recommendation is too much for your requirement. It can be made easier. I'll update my answer in a minute... – Yan Sklyarenko Feb 16 '11 at 14:32
  • perhaps i misunderstand smth. In my project component contains iis actions, the feature reffers to this component. and if i uncheck this feature iis actions should not be executed. is it correct? – basilkot Feb 16 '11 at 17:32
  • yes, that's true... what does the verbose log says for that feature you uncheck and the components in it? Pay attention to the lines like this: "Feature: ProductFeature; Installed: Absent; Request: Local; Action: Local". What's 'Request' for that feature? And what's 'Action'? – Yan Sklyarenko Feb 17 '11 at 07:59