Question

My application has some data (config files, worked files etc), which should be placed on hard disk. Therefore I have some questions about it:

  1. where is the best place to store it? Special folder inside User's Documents like "...User's Documents\MyAppFolder" or AppData or something else?
  2. Remove or not these files during uninstall? If yes, then files will be lost if user wants to install new version of program, yes?
  3. Create this folder during installation or during first start of application?
Was it helpful?

Solution

There are three things to consider here:

  1. What is the nature of the data: settings or documents—or some of each?
  2. Is the app installed per user or per machine?
  3. Should settings data roam with the user or not?

Sometimes it is hard to determine the nature of the data. For simplicity, divide the data into two categories: settings and documents. They are typically stored in different places as discussed in the The New Old Thing blog

The most important difference between My Documents and Application Data is that My Documents is where users store their files, whereas Application Data is where programs store their files.

If the app is installed per machine then the "app installer" can have nothing to with user data. (If otherwise, then which users' data?) User data should be created by the app when the user uses the app (settings) or by the user through the app (documents). Now, when a user starts the app the first time, it can provide a means for the user to manage the per user data so the user can clean up after the app is uninstalled or after that user decides to not use it anymore.

The means could be a user ARP entry that the app creates with an UninstallString that runs something it copies to the user's AppData folder. Or, it could be a user shortcut to do the same. Or, if you want something the user doesn't trigger, a user Run registry entry to launch a utility that detects if the app has been uninstalled (which could be a challenge).

If the app is installed per user then the "app install" could remove the app, settings and documents but should only remove the app.

Documents are the user's but depending on the app, if a user has no intention of running the app again, the documents might be worthless. You should either leave them or ask.

As for settings, as you point out, they would be useful if the user runs any version of the app in the future. An app should be able to upgrade or ignore settings for a newer or older version.

See this other New Old Thing post for more views on app data.


So, to answer your questions:

  1. Both, depending on what the files are.
  2. Settings: maybe (but can't if the app installed per user). Documents: No.
  3. Usually the app should create app data, but an exception would be if you want users to know of an "all users" location for their documents.

Only designing the app and installer together produce the best user experience.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top