如何在 Wix 中读取 app.config 值并设置属性
我有一个 .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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
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
一种解决方案是使用“社区 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).