Re: Question about Info.plist's
Re: Question about Info.plist's
- Subject: Re: Question about Info.plist's
- From: Michael Hall via Cocoa-dev <email@hidden>
- Date: Wed, 19 Aug 2020 21:04:26 -0500
> On Aug 19, 2020, at 11:07 AM, Gabriel Zachmann via Cocoa-dev
> <email@hidden> wrote:
>
> Question:
>
> Is there a way to use a key/value that was defined earlier in the plist file
> to define a value for a later key?
>
Maybe off-topic but this used to be supported for Java applications for pre-set
variables. I’m not remembering exactly for what . Directories, I think, like
$APPDIR could be referenced anywhere.
I’m not familiar with the Plistbuddy that’s been mentioned. But I’ve written
java code to parse, modify and create plist files. If not the bin ones then
they are XML so a parser for that can be used. It’s been sometimes handy for
java applications like when Apple’s apps cut over to Oracle ones. I had code
that could handle simple application conversions or provide a starting
framework for more complex app’s.
More off-topic. I was recently looking at that code again. A (java) application
I sometimes use had added a nice new Python interface. It didn’t seem to work
for me because it was trying to use an old python 2, instead of the 3,7.3 I got
by having Anaconda installed. After some discussion on the app mailing list it
was mentioned that Anaconda did some things in .bash_profile.
I found that if I did a Terminal execution of the app like…
/Applications/weka-3-9-3-corretto-jvm.app/Contents/MacOS/JavaAppLauncher
It ran correctly, picking up my current user .bash_profile. Normally OS X
applications don’t seem to pick this up but get a very stripped down bash
environment.
I suspected changes to the PATH environment variable might be all that the new
app needed. I couldn’t figure out an easy way to change that at execution time.
So I was thinking of parsing the info.plist and adding LSEnvironment,
environment variable entries myself for PATH and maybe any other Anaconda
related. So I would have a script that would do something like…
env | java plistparser
I decided first to try and see if I could use the XCode plist editor to make
the changes manually. It didn’t work. It seemed like in the past you had to do
something like duplicate the application to get plist changes to take effect?
But I didn’t want to get into that. Or it might be that PATH is not an
environment variable that can be plist changed? I would be sort of curious to
know if that is the case if anyone knows?
Anyhow, at that point it seemed easier for my own use simply to have an alias
in my .bash_profile to the above command line application invocation.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden