Thanks Rob for your excellent explanation. 

regards

andries

----- Original Message ----
From: Rob Kennedy <[EMAIL PROTECTED]>
To: [email protected]
Sent: Monday, June 23, 2008 6:08:58 PM
Subject: Re: [delphi-en] location of ini file in a citrix network      
environment


Andries Bos wrote:
> A lot of users work in a citrix environment. Replication seems to be a
> problem for them (if it works) and they've asked if the user's ini file
> could be stroed on a common network drive to be used from any work
> station. ( network location via a environent retievable value?)
>
> At this moment i'm using the jedi function  " GetAppdataFolder" to
> retrieve my application data folder.
> This will return somthing like 'C:\Documents and Settings\User\ Application
> Data' (That's valid as long as the user session remains valid : His next
> session could be on another citrix server due to load balancing... )

That's exactly the place to store it. Make a subdirectory for your
program, and put all your program's settings there.

That folder is either mapped to a network location, or the contents are
copied back and forth from a central location when the user logs in and
logs out. That's how roaming profiles work.

> Searching on how to retrieve a network enviroment, I found some people
> stating I have to use the "user's profile directory ". Ive traced this
> back to a jedi function: "GetProfileFolder"  that will return (at my pc)
> "C:\Documents and Settings\User" .
>
> Via a command line i've change my 'userprofile' value to 'h:\myname' (via
> the set command), but I'm not able to retrieve this new value via any
> parameter.

Sounds like you've changed an environment variable. That's not how you
change where the OS gets your profile information.

> To clear my question. If I want to save my ini file to a common network
> location (that could be different for different customers) what OS
> parameter-value would store this value and how could I retrieve this
> value.

Store it in a subdirectory of the application- data folder. You already
know how to find that.

> I'm presuming a network user (within it's citrix environment would
> always have the same (network) storage location available.

We'd hope so. It won't necessarily have the same name all the time,
though. That's why we have the OS functions for determining the location
at run time.

> (I did find some helpfull information at
> http://www.swissdel phicenter. ch/torry/ showcode. php?id=2277 , but it's not
> returning the expected new value back to me. )

Note that Delphi already comes with a function for reading the value of an
environment variable. I don't remember its name right now.

That function won't help, though, since the environment variable isn't the
place to get the information you need. Even if it reliably told you where
the user's profile folder was, that wouldn't help you find the
application- data folder since you don't know what that folder is named.
It's a localized string, and it has different names in different OS
versions.

-- 
Rob

    


      

[Non-text portions of this message have been removed]

Reply via email to