如何在 Wix 中读取 app.config 值并设置属性

发布于 2024-09-13 16:33:30 字数 119 浏览 1 评论 0原文

我有一个 .NET 程序,我为它编写了 Wix 安装程序。我希望能够从 Wix 之前的版本进行更新。为此,我想读取已安装程序的 app.config 文件。这将使用户不​​必手动重新输入所有这些值。有办法做到这一点吗?谢谢!

I have a .NET program that I've written a Wix installer for. I want to be able to update from a pre-Wix version. To do this, I'd like to read from the installed program's app.config file. This will save the user from having to manually retype in all of these values. Is there anyway to do this? Thanks!

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

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

发布评论

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

评论(2

芯好空 2024-09-20 16:33:30

MSI 或 WiX 目前都没有内置支持读取 xml 文件,仅支持写入。您必须编写一个自定义操作来读取其中的值。(扩展 AppsSearch )

除此之外,我强烈建议您遵循此处描述的模式并将其改编为 XML 而不是注册表:

http://robmensching.com/blog/posts/2010/5/ 2/WiX 工具集记住属性模式

Neither MSI or WiX currently has built-in support for reading xml files, only writing. You'll have to write a custom action to read the values in. ( Extend AppsSearch )

In addition to this, I highly suggest you follow the pattern described here and adapt it for XML instead of registry:

http://robmensching.com/blog/posts/2010/5/2/The-WiX-toolsets-Remember-Property-pattern

吾性傲以野 2024-09-20 16:33:30

一种解决方案是使用“社区 MSI 扩展”

您需要的自定义操作可能是Xml_SelectNodeValue (有一个关于如何使用它的示例)。

One solution is to use the "Community MSI Extensions"

The custom action you're after is probably Xml_SelectNodeValue (there's an example on how to use it).

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