当ConfigureIfExists设置为yes时,WiX WebSite创建第二个重复绑定 [英] WiX WebSite creates second duplicate binding when ConfigureIfExists set to yes

查看:82
本文介绍了当ConfigureIfExists设置为yes时,WiX WebSite创建第二个重复绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在修改IIS中网站的安装程序.要求指出最终用户必须首先在IIS中创建站点.我们从安装程序的下拉菜单中读取他们选择的站点信息,并将这些信息存储在WiX的属性中.

I have an installer I am modifying where we are modifying a web site in IIS. The requirements state that the end user must create the site first in IIS. We read the site information they choose from a dropdown in the installer for their site, and store the information in properties in WiX.

我在组件下有一个WebSite元素,并将ConfigureIfExists设置为yes.许多这样的方法似乎工作得很好,它将网站的目录重置为驱动器上的网站.

I have a WebSite element under a component, and have the ConfigureIfExists set to yes. A lot of this seems to be working great, it resets the directory of the site to where the website is on the drive.

问题是,当我在IIS中检查设置时,即使我具有AutoStart = yes和StartOnInstall = yes,网站也无法启动.我看到的问题是,由于它是一个现有网站,因此会为该网站,相同的端口和所有内容创建重复的绑定,这将导致该网站无法运行.

The problem is that when I check the set up in IIS, the web site is not started, even when I have AutoStart = yes and StartOnInstall = yes. The problem I am seeing is that, since it is an existing web site, it creates a duplicate binding for the site, same port and everything, which is causing the site not to run.

有人知道为什么会发生这种情况,或如何解决吗?我需要它不要复制绑定,以便安装完成后可以重新启动网站.

Does anyone know why this is happening, or how to resolve it? I need it to not duplicate the binding so that the web site can be restarted when installation is complete.

推荐答案

我遇到了类似的问题.我可以使用以下方法解决该问题,但请注意,这有点hack.

I had a similar problem. I was able to work around it with the following method, but be advised, it is kind of a hack.

对于我现有的网站,我在SiteId上进行匹配,并使用WebDirProperties属性设置要更改的任何配置属性.然后,在iis:WebAddress元素中,将端口号设置为一些未使用的端口(我使用8081).这将在IIS7中添加一个额外的http绑定(如您在问题中所看到的).然后,我创建一个在InstallFinalize之前运行的自定义操作.自定义操作基本上在站点绑定中循环,查找与我在wix中输入的虚假端口匹配的那个并将其删除.然后,自定义操作将启动网站,一切正常.

For my existing website, I match it on SiteId and set whatever configuration properties I want to change with the WebDirProperties attribute. Then, in the iis:WebAddress element, I set the Port number to some unused port (I used 8081). This will add an extra http binding in IIS7 (as you saw in your question). Then, I create a custom action that I run before InstallFinalize. The custom action basically loops through the site Bindings, looks for the one that matches the bogus port that I entered in wix and deletes it. Then the custom action starts the website and everything is good.

这是我发现可以在Wix 3.5中正常工作的唯一方法.这不是最好的方法,但是对我有用.

This was the only way I could find to get it to work in Wix 3.5. It is not the best method, but it worked for me.

这篇关于当ConfigureIfExists设置为yes时,WiX WebSite创建第二个重复绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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