CSIDL Data Path Setup
Previous  Top  Next

When the option saying The Path is created from Template Selections below is checked, the tab will display as shown below:

clip0071
In this mode of operation ProPath uses the Windows API to give your program access to file locations as defined by Microsoft Constant Special item ID List equates (CSIDLs). There is more information on CSIDL locations and an example of how they work after this section.


Selecting a CSIDL

To select a CSIDL from the preset values, click the drop down list as shown here:

clip0047
Note:
Not all CSIDL locations are appropriate for normal data or INI files from your program. Only those that are recommended for such use are shown in the list.


The CSIDL options in ProPath for the base folder of your data locations are as follows:

Note:
click any CSIDL below for more information about that item.

CSIDL_PERSONAL  
CSIDL_COMMON_DOCUMENTS  
CSIDL_APPDATA  
CSIDL_COMMON_APPDATA  
CSIDL_LOCAL_APPDATA  




Folder Levels to append to the CSIDL path

clip0048
When you use a CSIDL location, you are selecting a "base folder" (or a starting point) for the location for your files. You should not place files directly in these CSIDL folders

Note:
there are CSIDLs that you can use that way, but they are beyond the scope of this document and do not apply here.

In order to properly use CSIDL locations you need to add at least one folder level below the base folder.

Microsoft Guidelines suggest a structure like this:
<CSIDL Location>\<Company>\<Product>\<Optionally a Dataset>


or this:
<CSIDL Location>\<Product>\<Optionally a Dataset>

You will find that the first example (where the Company level is defined) is used for CSIDL locations such as CSIDL_APPDATA. Products are grouped below the Company level.

Example:

<CSIDL_APPDATA>
   LANSRAD
      ProPath
      ProCodeBlock
      ProPath

The second example is more commonly used in a CSIDL location such as CSIDL_PERSONAL.. In this example the products are visible directly from the CSIDL level.

Example:

<CSIDL_PERSONAL>
   SetupCast
   EZChangeLog






Using Template Selections and CSIDL information in ProPath

You can think of the CSIDL Data Path Setup as "Fixed" paths with a "Variable" twist.

The paths are fixed because the user can not change them, but they are also variable because the Windows CSIDL value will determine part of the path.

Consider the setup above.

CSIDL_APPDATA is a Microsoft
Constant Special item ID List equate (CSIDL) that represents a user's personal folder on the computer. It is commonly referred to as the "My Documents" folder on XP and "Documents" on Vista or Windows 7.

The exact physical location of the files will vary from user to user because the User Name
is a part of the path.

The paths are also different from one Operating System to another.

CSIDL_APPDATA equates to:

XP      C:\Documents and Settings\User Name
\Application Data
Vista      C:\Users\User Name
\Roaming
Windows 7   C:\Users\User Name
\Roaming

So if you have two users, (such as
Charles and Friedrich), the paths for Vista to the CSIDL_APPDATA location would be:

Charles      
C:\Users\Charles\Roaming
Friedrich   C:\Users\Friedrich
\Roaming


Going back to the example above, ProPath would use the CSIDL location (as returned by the Windows API
) to obtain the base folder, then two other levels ( LANSRAD and DemoDefault ) will be added to it.

Thus the actual data path to the SYSTEM data folder for our example users on Vista would be:

Charles      
C:\Users\Charles\Roaming\LANSRAD\DemoDefault
Friedrich   C:\Users\Friedrich
\Roaming\LANSRAD\DemoDefault


If the default option to automatically create folders if they do not exist is enabled, the ProPath would automatically determine the correct location, create the folders (all levels) and map the SYSTEM data variable to it when your program starts.