1

I originally thought that the best way to save data (user settings, high scores, etc) for my application would be by writing to an embedded file in the .exe. After some research I've found that this isn't possible and that I'm better off writing to the App Data folder which is designed for this purpose.

However, I don't like this as it means that the data will persist after the .exe is deleted. It certainly isn't ideal for me as I often make many versions of apps which I ask others to test out — this would mean that their App Data folder would be cluttered with useless data from testing.

Is there a better place or way to store data which will ensure that everything belonging to the application is deleted when the .exe is?

Note that I'd like to be able to store large files, so a string in My.Settings might not be able to handle it. I'd also prefer not to write to the same directory that the program is in.

Shuri2060
  • 729
  • 6
  • 21
  • Unless you are using multiple differently named files each time, there ought not be a lot of orphaned files. You could have a settings value like FirstTimeRun which deletes everything in the folder before saving the new version data. Or provide users with a Vacuum option that deletes data. – Ňɏssa Pøngjǣrdenlarp Sep 05 '16 at 14:55
  • @Plutonix Vacuum option meaning that data is deleted on closure? – Shuri2060 Sep 05 '16 at 15:01
  • I was think more as part of uninstalling. Before they replace v1 with v2, run vacuum to delete all data. The other option is more transparent - put the burden on you – Ňɏssa Pøngjǣrdenlarp Sep 05 '16 at 15:04
  • If you use an installation program creator like Inno Setup (other ones probably have the same capability) then when the user uninstalls the program you can specify [extra items to delete](http://www.jrsoftware.org/ishelp/index.php?topic=uninstcmdline). – Andrew Morton Sep 09 '16 at 17:43

0 Answers0