views:

24

answers:

1

Some code I inherited has its "configuration" (if you can call it that) embedded into its PHP and ASP (don't ask) code. Because its not an XML or INI file, I'm having the darnedest time figuring out how to modify these files at install time. If I could, I'd like to do a simple search and replace. I've read elsewhere (http://stackoverflow.com/questions/1186415/wix-search-and-replace-on-a-configuration-file) that I should just write a Custom Action. I'd rather avoid it if I could since the code I wish to configure is deprecated and I don't want to create yet another project to support this code.

So is there a way to do this without writing a custom action. If not, is anyone aware of any custom actions that are already built that could help me with this task?

A: 

Windows Installer has built-in support for INI files and WiX / InstallShield has extensions for supporting XML files. InstallShield has an additional extension that supports "Text File Changes" with what they call Replacement Sets. ( Find What, Replace With, Match Whole Word Only, Match Case, Replace Once Only ) I don't think it supports RegEx.

So unless you are going to switch to InstallShield you are going to have to write a custom action or refactor the text file to be XML.

Christopher Painter
That's too bad. :(
Jason Thompson
Could you refactor it easily to abstract the configuration into a second file? Perhaps some kind of server side include from an XML or INI file. Then WiX would easily be able to do the updates for you.
Christopher Painter