I have a .ini configuration file. I need to check if it exists in the new installation so as not to create it again. Also, if the new .ini adds new fields to an existing file.
Do not set the ini file as a file, but convert the records to IniFile Table Entries . This allows all ini file changes to be treated as “atomic change units”, which allow merging and rolling back correctly through the built-in MSI mechanism. You avoid the complexity of custom actions.
As Chris points out in his main commentary on the update: do everything right in Wix / MSI, and you avoid the many problems that begin to arise when requirements or updates change. Updated IniFile updates are correct and easy to use.
On Wix, you use the IniFile Element for this . All merging options, rollback support and advanced ini file processing are free. All you have to do is determine what needs to be added or changed in the ini file during installation. It will also be created if it is not there.
Using an IniFile element may look harder than it is. Here is an example . You can also watch the famous Wix tutorial here .
MSI : , MSI.
NeverOverwrite = "yes" .ini .
. , IniFile, , rollback . , , INI, , , - MSI. , "" INI . , INI . , ( ). , INI , IniFile (, - , , ini), , INI , - - . .
2 INI . , , , /. INI , .