delphi - Usage of SHGetSpecialFolderPath to retrieve an application folder that can be accessed also to non admin users, which CSIDL to choose? -


in application store on every machine files in application folder.

a simplified version of real case this:

..\project1\loginhistory (login history file - common users) ..\project1\translations (localization files - common users) ..\project1\formsettings\user1\ (this contains ini file per form user1) ..\project1\formsettings\usern\ (this contains ini file per form usern) 

so can see why use this: save data specific machine (remember latest logins made machine, kind of mru), store translation strings or 3rd party components (these extracted runtime exe resources) , saving user specific data (like form size). real case more complex, @ least can there "common folder" , "user folders".

now keep structure, files in single ..\project1 folder (+ subfolders). because users not windows users, sql server users.

my question folder choose ..\.

currently (succesfully) using code retrieveing ..\

uses shlobj;  function getspecialfolder(const csidl: integer) : string; var   recpath : pwidechar; begin   recpath := stralloc(max_path);     try     fillchar(recpath^, max_path, 0);     if shgetspecialfolderpath(0, recpath, csidl, false)        result := recpath       else result := '';           strdispose(recpath);     end; end; 

and call with

getspecialfolder(csidl_appdata) 

where list of cdisl defined here.

getspecialfolder(csidl_appdata) returns c:\users\username\appdata\roaming in windows 7.

so used work, recieved complaint customer seems directly related read/write problems in these folders. (for example c:\users\username\appdata\roaming\project1\loginhistory - using folders listed above).

so question is: correct use csidl_appdata? have suggestion? there chance on os or users reduced privileges there can read/write problems on folder?

please remember not have more 1 root folder files.

i think want use csidl_common_appdata files not user-specific. if assumed (in code) files stored in csidl_appdata shared among users, not allowed.


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -