当ConfigureIfExists 设置为 yes 时,WiX 网站创建第二个重复绑定

发布于 2024-11-26 13:18:39 字数 394 浏览 2 评论 0原文

我正在修改一个安装程序,我们正在修改 IIS 中的网站。要求规定最终用户必须首先在 IIS 中创建站点。我们读取他们从安装程序的下拉列表中为其站点选择的站点信息,并将该信息存储在 WiX 的属性中。

我在组件下有一个 WebSite 元素,并将 ConfigureIfExists 设置为 yes。其中很多似乎都工作得很好,它将网站的目录重置为网站在驱动器上的位置。

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

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

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.

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.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凉宸 2024-12-03 13:18:39

我建议您使用 WiX v3.6 尝试此方案(采用最新的可用版本)。 IIS7 扩展中有很多修复,您的问题很可能就会消失。

编辑:现在 WiX 3.6 处于正式测试阶段。它非常稳定,并且包含许多对 IIS 扩展的修复。

I advise you to try this scenario with WiX v3.6 (take the latest available build). There were lots of fixes in IIS7 extension, and it's very likely your problem will just go away.

EDIT: now WiX 3.6 is in official beta. It is quite stable and contains lots of fixes to IIS extension.

铁憨憨 2024-12-03 13:18:39

我有类似的问题。我可以使用以下方法解决这个问题,但请注意,这是一种黑客行为。

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

这是我能找到让它在 Wix 3.5 中工作的唯一方法。这不是最好的方法,但它对我有用。

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.

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.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文