如何在 Wix 中_创建_文本文件?

发布于 2024-10-06 13:28:07 字数 296 浏览 0 评论 0原文

有没有办法创建一个新的文本文件并使用 Wix 写入它?我遇到过一些元素可以让我处理 Xml 文件和 Ini 文件,但不能处理纯文本文件。

问题的根源在于我们使用的是从其自己的自定义配置文件中读取的第三方库,这确实限制了我对文本文件的外观的了解。配置文件类似于 Ini 文件,但减去了“部分”。我注意到 Wix 处理 Ini 文件时总是将它们放在系统文件夹中,这无法满足我们的需求。

需要写入配置文件的数据是在运行时收集的,因此没有机会简单地放置预配置文件。

如果存在的话,我愿意接受 Wix 扩展来实现相同的结果,但还没有遇到过。

Is there any way to create a new text file and write to it using Wix? I have come across elements that will allow me to work with Xml files and Ini files, but nothing for a plain text file.

The root of the problem stems from the fact that we're using a third party library that reads from its own custom configuration file, which really ties my hands as to what the text file can look like. The configuration file is similar to an Ini file, minus the "sections." And I've noticed that Wix handles Ini files by always placing them in the system folder, which won't work for our needs.

The data that needs to be written to the configuration file is gathered at run-time, so there's no opportunity to simply lay down a pre-configured file.

I would be willing to accept a Wix extension to accomplish the same result if one exists, but haven't come across one yet.

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

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

发布评论

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

评论(3

影子的影子 2024-10-13 13:28:07

Windows Installer 中没有为此提供的内置功能。您必须编写代码来执行此操作并使用自定义操作调用该代码。

There is no built-in feature in Windows Installer for this. You'll have to write code to do it and invoke that code with a custom action.

止于盛夏 2024-10-13 13:28:07

IniFile 元素可以在任何地方写入 .ini 文件;使用@Directory属性来指定它应该进入哪个目录。如果库忽略[section]行,则可以使用任何内容作为@Section属性值。

The IniFile element can write .ini files anywhere; use the @Directory attribute to specify which directory it should go in. If the library ignores [section] lines, you can use anything as the @Section attribute value.

公布 2024-10-13 13:28:07

您可能想看看此项目。它包含 WiX 扩展和自定义操作的集合,我想它还具有用于读取和写入文本文件的 CA。尝试一下 - 据称它已经通过在企业安装中的使用进行了测试和证明。

You might want to have a look at this project. It contains the collection of WiX extensions and custom actions, and I suppose it also has CA to read and write text files. Try it out - it is claimed to be tested and proved by using in enterprise installations.

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