WiX和iis(无法连接到互联网信息服务器) [英] WiX and iis (cannot connect to internet information server)

查看:179
本文介绍了WiX和iis(无法连接到互联网信息服务器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试创建安装程序,也创建了网站。
我使用以下代码

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

但是当我尝试在iis的机器上安装创建的包时没有安装,我收到此消息,即使我不检查此功能:

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:

无法连接到互联网信息服务器

任何人都可以帮我解决这个问题吗?

Can anybody help me with this trouble?

提前致谢。

推荐答案

您正在未安装IIS的计算机上安装软件包。你会期待什么? :)

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

说实话,WiX IIsExtension(定义WebSite元素的那个)使用IIS组件的API来实际完成它的工作。对于WiX v3.0,它甚至要求在IIS 7中打开IIS 6兼容性才能正常工作。

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.

您的组件(包含WebSite元素)不受条件限制。这意味着它将永远安装。安装时,IIsExtension会尝试创建一个在其中定义的网站(如果我们简短地讲述这个故事)。

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).

所以,我建议你做以下事情(如果您希望在目标计算机上跳过安装程序的IIS部分):

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):


  • 添加启动条件以检查IIS组件已安装(您可以依赖于IIsExtension本身定义的IISMAJORVERSION属性)

  • 使用NOT IISMAJORVERSION条件来依赖IIS的组件(或功能)

因此,如果未设置IISMAJORVERSION属性(未安装IIS),则不会安排组件进行安装,并且IIS自定义操作将不会运行。

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.

PS我最初的SKIPCONFIGUREIIS属性是全有或全无切换,并不适合您的情况。

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

这篇关于WiX和iis(无法连接到互联网信息服务器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆