Store non-essential user data in the local Application Data folder

Store non-essential user data in the local Application Data folder

Benefits

Description

Sometimes the data you have just won’t fit easily into any category, or more likely fits into several. Consider settings that are specific to both a User and a Machine. Where do they belong?

Well, settings that are specific to both machine and user should be placed in CSIDL_LOCAL_APPDATA, which is non-roaming (When writing to CSIDL_LOCAL_APPDATA, you should always append \Software\CompanyName\Application\Version to the path).

It’s important that you don’t confuse this with settings that are specific to a machine but common to all users. These types of settings belong elsewhere (the guidelines for these types are discussed in other sections).

A good example of a setting that is user and machine specific is a game that allows each player to select the default-input device for the user. The options on one machine might include a force-feedback joystick, keyboard, and mouse, while another machine might have a normal joystick, keyboard and mouse. This kind of scenario is rare but important.

CSIDL_LOCAL_APPDATA is also a great place to store non-essential user data. Typically these are things that you’d like to have roamed, but just didn’t have the space for in your roaming profile. Stuff like Window sizes and positions; things that’d be cool to have but that would just add too much of a penalty to your roaming performance.

Considerations

Appending Version number to the CSIDL_LOCAL_APPDATA path is optional, but is always a good idea to help better handle upgrades.

See Also

CSIDLs, Registry Overview, SHGetFolderPath, Store application specific data to HKEY_LOCAL_MACHINE, Store user settings in the user's profile