Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you _create_ a text file in Wix?

Tags:

wix

wix3.5

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.

like image 495
carmbrester Avatar asked Nov 15 '25 08:11

carmbrester


2 Answers

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.

like image 135
Wim Coenen Avatar answered Nov 18 '25 19:11

Wim Coenen


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.

like image 34
Bob Arnson Avatar answered Nov 18 '25 20:11

Bob Arnson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!