views:

10

answers:

1

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

A: 

The easiest way to address 2 would probably be to install it as a "template", and have the application copy this template to the "final" location, if it doesn't exist. (If it's a user file, install the template alongside your application, and make the final copy somewhere appropriate, under %USERPROFILE%)

Damien_The_Unbeliever
Yes, I know this would be the correct way, but unfortunately I'm not allowed anymore to do changes into my application, so I have to work everything from the installer.
Viv Coco