Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to set Environment Variables on a per user basis?

Ok,


Mountain Lion no longer uses .MacOSX/environment.plist....


I have some (gui) apps that need access to some environmental variables.


These need to be set on a per user basis... ( Non password login database informtion for

instance).


This means that I cannot simoly modify/create /etc/launchd.conf since this info will

be different for different users.


I have read ( some where ) that one can create a plist file in ~Library/LaunchAgents with

a plist extension that should be able set environmental values...


Here is a file that I created ( does not do the job)


file: org.jerry.WxPgBrowser.plist



<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"

"http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>Label</key>

<string>org.jerry.WxPgBrowser</string>

<key>ProgramArguments</key>

<string>/Users/jerry/Desktop/WxPgBrowser.app/Contents/MacOS/WxPgBrowser</string>

<key>EnvironmentVariables</key>

<dict>

<key>PGDATABASE</key>

<string>levan</string>

<key>PGHOST</key>

<string>localhost</string>

<key>PGUSER</key>

<string>levan</string>

</dict>

<key>KeepAlive</key>

<false/>

</dict>

</plist>


When I run the app located on my desktop the three environment variable are *not*

set in the application. ( and quitting the application does not totally kill the rascal the icon in the dock

indicates that the app is still alive and I have to kill from the icon in the dock).


Am I on the right track, can anyone provide me with an appropriate *.plist file that

does what I want?


Thanks


Jerry

ard-OTHER, OS X Mountain Lion

Posted on Jul 28, 2012 10:04 AM

Reply

There are no replies.

How to set Environment Variables on a per user basis?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.