Le 4 déc. 06 à 15:46, Nicola Pero a écrit :
What do you mean by 'enviromental' variables ? Which variables
exactly
do you need and why ? ;-)
GNUSTEP_SYSTEM_ROOT, LD_LIBRARY_PATH etc.
Just to be able to launch tool like gpbs with NSTask and without
modifying PATH or using opentool. I would like to do the same for
an application like Gorm (I mean without using openapp). If I know
GNUSTEP_SYSTEM_ROOT, I can find them easily because tools or
applications I plan to launch won't be moved once installed.
However GNUSTEP_SYSTEM_ROOT may change depending on the user or the
machine, so I either need a way to know its value or an API that
allows to search for tool and application path in standard
locations like GNUSTEP_SYSTEM_ROOT and GNUSTEP_LOCAL_ROOT.
My daemonizer process is launched with a copy of libgnustep-base
put in /usr/lib because if I try to launch it without such copy, it
complains about libgnustep-base not available (not surprisingly
since it is installed by default in /System/Library/Libraries on my
machine).
So I was supposing that environment variables I just mention
weren't set for this process, but perhaps I make a wrong assumption?
To locate the application binaries, you should use gnustep-base's
NSBundle
methods to locate stuff in the various domains.
Which methods? I don't understand how I can find an application
binary like Gorm with NSBundle (from another process). May be with
NSWorkspace though by running make_services first?
But this wouldn't solve the problem for a tool like gpbs. I don't
think make_services cache information about installed tools.
One you have found the application binary, you just execute it.
Give to
the application binary the same environment that your process is
using,
and it will work. :-)
If the environment is properly set, it should work :-)