[Qt-creator] Evaluation on Mac OSX (Eike Ziller)

G3WOE michael at g3woe.com
Mon Jan 5 18:40:22 CET 2009


Hi Eike

Many thanks for your response and comments.

I understand the scope and purpose of the Environment.plist file.

It is possible to set an Environment variable such at TEST="xyz". Once  
set that variable will appear in each instance of the terminal  
application, within the scope of a user login session. (ssh and other  
deamons may not inherit this environment.).

But the problem with this plist method is the fact (certainly on my  
machine), that the PATH variable is not inherited as expected.  
Whatever string value is assigned to PATH does not appear. same with  
path. (lower case). I am guessing Apple intercept it to stop users  
from breaking the OS. I have searched forums for the work around, but  
as yet I have not found a way of setting the PATH variable from  
Environment.plist or of expanding the default PATH using that method.  
If it is possible please can you let me know.

As I outlined it is possible to use the .profile file to expand the  
PATH within the scope of a single terminal instance, it is possible to  
then launch the application manually from within terminal which is a  
bit of a manual kludge.

Apple actually recommend Application vendors should place application  
dependent environment variables into the info.plist file which is  
contained in the application bundle. This plist as I understand it  
also has the same general problem, ie no way of expanding $PATH and  
setting the PATH. Again if you know a solution I would be very  
interested.

See this extract from the same reference at http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html 
  at Application Specific  Environment Variables.

START There are two ways to make environment variables available to an  
application. The first is to define the variables in a Terminal  
session and then launch the application from the same session. When  
launched from Terminal, the application inherits the session settings,  
including any environment variables defined there.

The second way to associate environment variables with an application  
is to include the LSEnvironment key in the application’s information  
property list file. The LSEnvironment key lets you specify an  
arbitrary number of key/value pairs representing environment variables  
and their values. Because it requires modifying the application’s  
information property list file, use of this key is best for options  
that do not change too frequently. For more information on using this  
key, see “Property List Key Reference.” ENDS

I believe there will be a well engineered solution, but I don't know it.

In general I believe Apple are trying to persuade application vendors  
to place all dependent binaries into the single application bundle.  
This avoids the need for default search paths, and eliminates the  
scatter gun approach to application installation which we see so often  
in the Windows world.

I have the similar problem with Eclipse, which I have worked around by  
making a script to launch Eclipse via a terminal window, but it is a  
pain and it leaves an open window running.

Perhaps that is what is required here, until you have negotiated this  
problem.

I will respond to the other points in a separate email.

Thanks
Michael White




On 5 Jan 2009, at 12:42, qt-creator-request at trolltech.com wrote:

> ctually it does - but :)
> On Mac OS the environment used for applications is *not* the
> environment you get when starting the Terminal application. Instead it
> is the environment used for applications is determined at user login
> from a file
> ~/.MacOSX/environment.plist
> in your home directory.
> You find more information on this here:
> <http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html
>>
> under "User Session Environment Variables".





More information about the Qt-creator-old mailing list