Default Data Locations
[This is preliminary documentation and subject to change.]
For your application to work properly in a 32-bit enterprise environment, you must take care to store data in standard places. See the Designed for Microsoft® Windows® Logo requirements and recommendations at:
The main things to keep in mind are:
-
Use new Microsoft installation and component management technology to install application files as needed to the correct folders, and to let some components be accessed over a network or from a CD-ROM. Satisfying this Designed for Microsoft® Windows® Logo requirement considerably eases the complexity of creating a good setup. Furthermore, applications installed using the new installer technology are generally much more reconstructable than applications that are not.
-
Avoid DLL version conflicts. Except for operating system components, do not globally share DLLs. The small additional hard drive usage that this requires is more than compensated for by not running the risk of destabilizing your users' environments. The Designed for Microsoft® Windows® Logo guidelines strongly recommend the following:
-
Store user settings in the registry, in the HKEY_CURRENT_USER hive, or, in the case of large blocks of user profile information, in the Application Data folder under the user's Profile folder. If you do need to use the Application Data folder, be sure to establish the same hierarchical structure that HKEY_CURRENT_USER has, namely:
Application Data\
Software\
[company name]\
[product name]\
[version]\
[your top level]\
-
Do not assume that you know the names or locations of any of the standard folders, such as My Documents or Application Data, that you are going to use (for example, starting with Windows NT 5.0, the default name of the Personal folder has changed to My Documents). For all you know, your application might be running on a foreign-language version of Windows, or the user's profile folder might reside on a server instead of on a local hard drive.
Rather than make any assumptions, call SHGetSpecialFolderLocation to obtain a path to standard folders, as explained in Locating the Standard Folders Where Data Belongs.
-
Use the improved My Documents folder (previously the Personal folder) to save all files created by users. "My Documents" is a collection of operating-system changes designed to help centralize local user data storage so as to ensure recoverability and improve discoverability.
A My Documents folder now appears on every desktop (this is not to be confused with the My Documents folder created by Office 95). The Home directory defaults to this folder, and it appears by default in standard FileOpen/SaveAs dialog boxes if you initialize lpstrInitialDir to NULL or to the path to "My Documents". You can always locate it by calling SHGetSpecialFolderLocation with CSIDL_PERSONAL.
-
Support security by assuming that the file system is NTFS, locked down with Access Control Lists (ACLs), and that %UserProfile% and %Temp% are the only writeable locations.
-
Hide extra program files and directories to present a simplified file system (use the hidden attribute).