Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wix major upgrade

How do I use WIX to prevent overwriting a config file during a 'Major Upgrade'?

I want the file to be installed on the initial install, removed on uninstall, and left unchanged on a 'Major Upgrade'.

Thanks

like image 559
user38309 Avatar asked Jan 28 '09 17:01

user38309


2 Answers

The most straight forward way would be to schedule your RemoveExistingProducts after InstallExecute or InstallFinalize. That way the config file is not removed and then installed again (like if you schedule before InstallInitialize). Of course, scheduling RemoveExistingProduct so late means you need to be very careful about your Component Rules.

My personal favorite is to treat configuration like "user data" and not have the installtouch it at all. You ship defaults with the application but any changes are made by the user in their private user profile. Gets you out of all kinds of nasty migration problems that just aren't solved well during setup.

like image 139
Rob Mensching Avatar answered Sep 23 '22 23:09

Rob Mensching


Do you ever want it overwritten? If not in cases like this I assign the config files to their own components and mark them as Never Overwrite. This way upgrades will not overwrite the file but uninstalls will remove it.

e.g.

<Component Id="myComp" Guid="myguid" NeverOverwrite="yes">
like image 24
Mike Marshall Avatar answered Sep 22 '22 23:09

Mike Marshall