- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Hi all!
recently arrived to Apple management and I've got a task pending to fix: to setup two environment variables necessary for one GUI application.
I can setup them over a plist file stored in /Library/LaunchAgents, but same plist file doesn't work loading it as a Configuration Profile from Jamf Pro.
If I look for loaded profiles, it appears from Jamf as well as from terminal typing 'profiles list -all', but it doesn't work. Other plist files launched from Jamf are working properly but no for setting environment variables.
Could someone to assist on this?
Thanks a lot in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
1. Create a LaunchAgent script
Create a com.resolve.env.plist file in /Library/LaunchAgents/ to set the environment for each user launch:
<?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>com.resolve.env</string>
<key>ProgramArguments</key>
<array>
<string>/bin/launchctl</string>
<string>setenv</string>
<string>BMD_RESOLVE_SUPPORT_DIR</string>
<string>/chemin/personnalise/pour/resolve</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/resolve_env.log</string>
<key>StandardErrorPath</key>
<string>/tmp/resolve_env.err</string>
</dict>
</plist>
Replace the path "/path/custom/for/resolve" with the actual path you want to use.
2. Deploy via Jamf
Zip the .plist file (or create it via script in a Files and Processes policy).
Place it in /Library/LaunchAgents/ on the target machines via a package or Jamf policy.
You can also use a deployment script in Jamf to automatically copy it:
#!/bin/bash
cat <<EOF > /Library/LaunchAgents/com.resolve.env.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>com.resolve.env</string>
<key>ProgramArguments</key>
<array>
<string>/bin/launchctl</string>
<string>setenv</string>
<string>BMD_RESOLVE_SUPPORT_DIR</string>
<string>/chemin/personnalise/pour/resolve</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOF
chmod 644 /Library/LaunchAgents/com.resolve.env.plist
chown root:wheel /Library/LaunchAgents/com.resolve.env.plist
3. Restart the user session
Once the .plist is installed, the variable will be set upon user login. If Resolve is subsequently launched, it will be available.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
@javipcn Can you post more info on what app and what exactly you're trying to set? While Configuration Profiles are commonly used to manage preferences for an application they can't be used to deploy something to /Library/LaunchAgents, and that is not normally where app configurations are set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Hi!!
yes, the application is Davinci Resolve and it requires to set a variable called BMD_RESOLVE_CONFIG_DIR to the proper path: '$HOME/Library/Preferences/Blackmagic Design/DaVinci Resolve/' or to other custom path.
Maybe, the best way could be to create a script to execute the setenv command?
Thanks for your quick reply!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Do you have a reference to the docs with instructions to set that path? I am not familiar with that app, but that location should be the default location for an app to store user specific settings.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
It's described in the file "User Configuration folders and customization.txt" copied once the app is installed. In that file you can read as follow for custom locations as it's our case:
...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Do you need to override the default which would already be in "$HOME/Library/Preferences/Blackmagic Design/DaVinci Resolve/'?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Yes, that's the target, to set the path to another location as default

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Since you mentioned you've "recently arrived to Apple management" I'm going to ask what was the need to use another location? The $HOME/Library/Preferences directory is a standard Apple location and Blackmagic Design appears to have been following that standard.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Yes. We're working in a LAN where others resources are shared. The above examples are just some of the custom setup but there is others, required for us. The default preferenceces and other parameters to be used by Resolve are located in a shared folder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
1. Create a LaunchAgent script
Create a com.resolve.env.plist file in /Library/LaunchAgents/ to set the environment for each user launch:
<?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>com.resolve.env</string>
<key>ProgramArguments</key>
<array>
<string>/bin/launchctl</string>
<string>setenv</string>
<string>BMD_RESOLVE_SUPPORT_DIR</string>
<string>/chemin/personnalise/pour/resolve</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/resolve_env.log</string>
<key>StandardErrorPath</key>
<string>/tmp/resolve_env.err</string>
</dict>
</plist>
Replace the path "/path/custom/for/resolve" with the actual path you want to use.
2. Deploy via Jamf
Zip the .plist file (or create it via script in a Files and Processes policy).
Place it in /Library/LaunchAgents/ on the target machines via a package or Jamf policy.
You can also use a deployment script in Jamf to automatically copy it:
#!/bin/bash
cat <<EOF > /Library/LaunchAgents/com.resolve.env.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>com.resolve.env</string>
<key>ProgramArguments</key>
<array>
<string>/bin/launchctl</string>
<string>setenv</string>
<string>BMD_RESOLVE_SUPPORT_DIR</string>
<string>/chemin/personnalise/pour/resolve</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOF
chmod 644 /Library/LaunchAgents/com.resolve.env.plist
chown root:wheel /Library/LaunchAgents/com.resolve.env.plist
3. Restart the user session
Once the .plist is installed, the variable will be set upon user login. If Resolve is subsequently launched, it will be available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Great BGhilardi, it looks nice. I'll test it as soon as I can do.
Thanks both!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
I've deployed the plist file as a package and it's properly copied to the destination folder, so it works!!
Just I need to check because it's installed to the first user loged in, but I need to do for any user so Macos are joined to a Windows domain. But I believe it's another question, maybe to copy the plist to the LaunchAgents from the home folder intead system folder.
Thanks BGhilardi for the tip!
