Nearly all our programs have a necesity to write to the folder where the
executable is installed, ie local tables which are synchronised with the
server tables.

All our programs get installed into the program files folder.

We have come accross machines occasionaly where the logged on user has only
'user' rights and cannot write to the installation folder.

My question is, are we using the wrong folder to store our local data and
configuration files or is there another way round this problem.

Re: user rights issue by Stefan

Stefan
Thu Jun 21 08:45:59 CDT 2007


"dave" <dave@somewhere.com> schrieb im Newsbeitrag
news:em5cp5$sHHA.4476@TK2MSFTNGP03.phx.gbl...
> Nearly all our programs have a necesity to write to the folder where the
> executable is installed, ie local tables which are synchronised with the
> server tables.
>
> All our programs get installed into the program files folder.
>
> We have come accross machines occasionaly where the logged on user has
> only 'user' rights and cannot write to the installation folder.
>
> My question is, are we using the wrong folder to store our local data and
> configuration files or is there another way round this problem.

Right, the %appdata" folder is a better place (or the %temp% folder
for temporary files). From Visual FoxPro you can get them using
the native GetEnv() function or the Win API:

Declare Integer SHGetSpecialFolderPath in Shell32.dll ;
Long hwndOwner, String @ lpszPath, Integer nFolder, Integer fCreate
str = SPACE(266)
CSIDL_DESKTOP = 0x0000
SHGetSpecialFolderPath(0, @str, CSIDL_DESKTOP, 0)
? Left(str, At(Chr(0), str)-1)

CSIDL_COMMON_PROGRAMS = 0X0017
SHGetSpecialFolderPath(0, @str, CSIDL_COMMON_PROGRAMS, 0)
? Left(str, At(Chr(0), str)-1)

CSIDL_COMMON_APPDATA = 0x0023
SHGetSpecialFolderPath(0, @str, CSIDL_COMMON_APPDATA, 0)
? Left(str, At(Chr(0), str)-1)

(In real code, the CSIDL_* values are typically constants created via
#Define)


hth
-Stefan



--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------