0

My C# application takes settings from user & saves them to a user.config file for further use. I want to delete that user.config file which application creates after installation so that after re-installation user can again select the settings according to his requirements.

Is there any way to reset those settings?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

You'd need to revert to the VS 2005 behavior of uninstalling the entire older product first before installing the new one.

If that works, you'd need to edit the MSI file, use Orca. In the InstallExecute table sequence delete the InstallExecute action, and resequence RemoveExistingProducts to be immediately after InstallInitialize, number it as something like 1520.

Maybe you are the same person that asked this question in the MSDN forums - this is the same answer I gave there.

Custom actions in your new install are no good - they run after the install is almost finished, that's too late. The suggestion that you should update the existing file is a good one, so you don't destroy what the user put in there. You write a custom action that locates the file and updates it.

PhilDW
  • 20,260
  • 1
  • 18
  • 28