Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
swdev:dotnet:data_and_configuration_folders [2011/04/01 09:47]
smayr [Resources]
swdev:dotnet:data_and_configuration_folders [2011/04/01 16:08] (current)
smayr [InnoSetup]
Line 88: Line 88:
  
 ===== Native Code ===== ===== Native Code =====
 +
 The best API to use if you are targeting Vista and beyond is the new SHGetKnownFolderPath. This function replaces SHGetFolderPath and has the following advantages. The best API to use if you are targeting Vista and beyond is the new SHGetKnownFolderPath. This function replaces SHGetFolderPath and has the following advantages.
  
Line 143: Line 144:
  
 ===== Native Code ===== ===== Native Code =====
 +
 If you are still targeting XP, you’ll need to use the legacy API SHGetFolderPath that uses CSIDL’s.  This API is still supported in Vista and Windows 7 and will map to the correct locations on all three versions of the OS. If you are still targeting XP, you’ll need to use the legacy API SHGetFolderPath that uses CSIDL’s.  This API is still supported in Vista and Windows 7 and will map to the correct locations on all three versions of the OS.
  
Line 200: Line 202:
 Store only application files in ''C:\Program Files''. Store only application files in ''C:\Program Files''.
 Store share application data in ''C:\ProgramData''. Store share application data in ''C:\ProgramData''.
 +Store user data in ''C:\Users''.
  
 +==== Coding in C# ====
 Use ''Environment.SpecialFolder'' to get these folders. Example: Use ''Environment.SpecialFolder'' to get these folders. Example:
 <code csharp> <code csharp>
Line 207: Line 211:
 </code> </code>
  
 +==== InnoSetup ====
 +Set proper permissions for shared ''C:\ProgramData'' folder to store share database and configuration files.  The permissions should be Read, Write, Modify for user group ''Users'':
 +<code inno>
 +[Dirs]
 +Name: {commonappdata}\Acme\MyApp; Permissions: users-modify
 +</code>
 == Resources == == Resources ==
   * [[http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx|MSDN CSIDL]]   * [[http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx|MSDN CSIDL]]
   * [[http://msdn.microsoft.com/en-us/library/dd378457(v=VS.85).aspx|MSDN KNOWNFOLDERID]]   * [[http://msdn.microsoft.com/en-us/library/dd378457(v=VS.85).aspx|MSDN KNOWNFOLDERID]]