Search code examples
.netvisual-studioapplication-settings

How to cleanup the user settings file on uninstall?


When using Settings.settings when an user changes a setting it saves it to:

%AppData%\Local\Microsoft\%ProcessName%_Url_%hashCode%\%version%\user.config

For an InnoSetup uninstaller it is very difficult to clean all those files.

Isn't there an easier way?


Solution

  • There is a way to change where the ms config stuff writes settings, but after researching it, I ended up just avoiding the MS settings stuff (except for the app.exe.config file that's in the same folder as the exe itself) and just used XML serialization to serialize\deserialize my own settings object into an appropriate \AppData\Folder.