Install a file which should be removed only on real uninstall and never overwritten

Posted by Viv Coco on Stack Overflow See other posts from Stack Overflow or by Viv Coco
Published on 2010-04-01T09:32:49Z Indexed on 2010/04/01 9:53 UTC
Read the original article Hit count: 391

Filed under:
|
|
|

When I install my application, along with the binaries, a conf file is installed that the user can change as he needs (it's actually the user data file). I would like this file to not be overwritten or deleted when a repair, upgrade, modify happens and it should be deleted only when a real uninstall happens. In other words: this conf file is installed along with the binaries and should never be touched again (overwritten/deleted) until a real uninstall happens (not repairs, modifies, upgrades) in which case it should be deleted.

So I was thinking of doing:

<Component Id="aaa.cfg" Guid="GUID"> <File Id="aaa.cfg" Source="aaa.cfg" KeyPath="yes" /> </Component>

But I don't know how could I condition the component so that:

1) the component to be removed only on a real uninstall - not upgrades, repairs, modifies?

2) the file should in no case be overwritten if already exists.

Thx, Viv

© Stack Overflow or respective owner

Related posts about component

Related posts about condition