Link to home
Create AccountLog in
Avatar of flutophilus
flutophilus

asked on

VS2005 Setup Project. How to prevent overwrite of existing installed file?

I have a VS2005 Setup Prokject that deploys a config file (MyApp.exe.config). The first time the application is installed I need this file to be deployed along with the .exe - that's fine I can do that. However if the application is reinstalled or upgraded into the same location I do not want the file MyApp.exe.config to be overwritten as it will contain information specific to that installation.
Any ideas how I can do this would be gratefully received.
SOLUTION
Avatar of ZachSmith
ZachSmith
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of flutophilus
flutophilus

ASKER

That's the way I was thinking but I've struggled to make sense of the documentation for these conditions - I can't find any examples anywhere.
Since posting the question it seems that the first thing to do is to ensure that the file is not removed by an uninstall as a re-install to the same location is effectively and uninstall/install. There is a property on the file called "permanent" that needs settin to true.
I'm off to investigate Installer classes, it seems crazy but I think you have to write custom code for this simple requirement (in Ghost Installer it's a tick box).

Cheers
Unfortunately the setup projects in Visual Studio leave a lot to be desired! I wouldn't be surprised at all if you have to do some custom coding to get it to work.
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account