views:

308

answers:

2

I have written a .NET C# application and have created an installer in Visual Studio 2008. Everything works fine. The application uses an external config file (not app.config). The application is written such that when the config file is deleted, the defaults for the application are restored and a new config file is created. This behaviour is part of the requirements of the system and cannot be changed.

When the file is deleted, however, the next attempt to run the application results in the following error message:

"The installed product does not match the installation source(s)"

And the system brings up an installer program.

I'm figuring that there is some sort of configuration in the install project that can turn this behavior off, but I cannot find any documentation or parameters to change this behavior.

Any ideas?

+1  A: 

How about just don't install the config file?

If your application is going to generate a default one if none exists, then there really isn't a reason to bundle one in the installer.

Anon.
+1 - far better solution than mine.
ChrisF
+2  A: 

Assuming your config file is in the installation program (it sounds like it is)...

Right-click on your config file, and click Properties. The bottom value is called Vital. Set it to false.

calico-cat
I had checked in there before but had not noticed the "Vital" property. I was looking for something like "Required" and didn't see it at the bottom of the list. I have rebuilt my installer and this change works. Thanks!
arcticfox
No worries. Glad I could help. I Googled this very error for ages with no luck.
calico-cat