Hi,
I'm using WiX to create a windows installer. Unfortunately my installer overwrites a config file on every update. What I really want is, that the installer only creates the file if it is not found.
Thanks and regards, forki
Hi,
I'm using WiX to create a windows installer. Unfortunately my installer overwrites a config file on every update. What I really want is, that the installer only creates the file if it is not found.
Thanks and regards, forki
I sure someone will come up with a proper answer, but as a backup:
You could have the installer create a default configuration file, and then have your application copy the default file to the normal configuration file, if the normal configuration file is not present. This also provides an easy way to reset the application to factory default (just delete the configuration file).
You can change the default behavior with REINSTALLMODE property. It defaults to "Reinstall if the file is missing or is an older version", which is logically correct, as for me. But you can experiment with other values to find the behavior you need.
Hope this helps.
This really is an application bug, not a setup issue.
You shouldn't be "installing" data that is later editable by the user, Windows Installer records the size, modification date and hash value of files installed. That way if the file is later discovered to be "corrupt" it can be repaired.
We install a default config file that is copied to the user config when none is found, that way Windows Installer never even knows about the user editable config and so doesn't do any replacement.
The Component @NeverOverwrite="yes"
attribute might be the solution to this problem.
From the WiX help documentation:
If this attribute is set to 'yes', the installer does not install or reinstall the component if a key path file or a key path registry entry for the component already exists. The application does register itself as a client of the component. Use this flag only for components that are being registered by the Registry table. Do not use this flag for components registered by the AppId, Class, Extension, ProgId, MIME, and Verb tables.