开发者

How can you _create_ a text file in Wix?

开发者 https://www.devze.com 2023-01-30 03:37 出处:网络
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.

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.


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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消