Install prefs-files in user home directory.

734 views
Skip to first unread message

Gaute Helfjord

unread,
Dec 11, 2013, 7:58:53 AM12/11/13
to munk...@googlegroups.com

We have a plugin for InDesign that we sometimes need to update prefs-files for. These files are located in ~/Library/Preferences/Adobe InDesign CS6/Version 8.0/NameOfPlugin/


I have tried for a couple of days to figure out how to do this with Munki. -With no success at all..


Tried to make a package with packagemaker that installs in the user homee directory. The package works if double-clicked and installed manually, but via Munki the prefs-files are not created.

Tried to make the package with The Luggage but found it difficult to deal with folders with spaces in them AND home directories.

Also looked into copy-from-dmg in Munki, but could not find examples on moving items into ~/Library/and-so-on.


Did anyone achieve something similiar and would like to share som insight?


Gaute

Tim Sutton

unread,
Dec 11, 2013, 8:33:21 AM12/11/13
to munk...@googlegroups.com
In this situation, your best option is to write a script that will copy the file(s) from a system location (installed to by Munki) to the user's home directory location, triggered by a LaunchAgent so that it runs for every user on login. It is run by the user, so you can reference the homedir as "$HOME".

Since you usually will need to do this for multiple applications over time, a better way is to use one general-purpose LaunchAgent that just runs all scripts located in a common system location, so that you don't need to write a LaunchAgent every time you need to do this, and use Munki to install the script and needed support files.


Tim
--
You received this message because you are subscribed to the Google Groups "munki-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Gaute Helfjord

unread,
Dec 17, 2013, 3:59:52 AM12/17/13
to munk...@googlegroups.com
Thank you Tim!

Could possibly also just make a pkg that installs to /tmp/ with a postinstall bash script that did something like this:

for dir in /Users/*/Library/Preferences/Adobe\ InDesign/Version\ 8.0/plugin_name/; do cp /tmp/plugin_files/*.xml "$dir"; done


Gaute

Gregory Neagle

unread,
Dec 17, 2013, 9:05:17 AM12/17/13
to munk...@googlegroups.com
You could do that, but then you are making several assumptions:

1) You don't care about user accounts created _after_ this runs.

2) All your users have unencrypted home directories available under /Users. This isn't true for FileVault(1) home directories, external accounts, or network homes.

3) It's OK to leave junk in /Users/Shared/

-Greg

>
>
> Gaute
>

Hugh Burt

unread,
Dec 17, 2013, 4:36:57 AM12/17/13
to munk...@googlegroups.com
Hello Everyone

Trying out the conditional_items manifest key to target LPD printers on different sites but I keep
getting the following error in the managed installs log :-

WARNING: 'ascii' codec can't encode character u'\u2019' in position 26: ordinal not in range(128)

Here is my testing manifest :-

<dict>
<key>catalogs</key>
<array>
<string>testing</string>
</array>
<key>conditional_items</key>
<array>
<dict>
<key>condition</key>
<string>ANY ipv4_address CONTAINS ’10.1.’</string>
<key>managed_installs</key>
<array>
<string>Ricoh_PS_Drivers_site1_staff_10.7plus</string>
</array>
</dict>
<dict>
<key>condition</key>
<string>ANY ipv4_address CONTAINS ’10.50.’</string>
<key>managed_installs</key>
<array>
<string>Ricoh_PS_Drivers_site2_staff_10.7plus</string>
</array>
</dict>
</array>
<key>managed_installs</key>
<array>
<string>VLC media player</string>
</array>
<key>managed_uninstalls</key>
<array/>
</dict>

Would really appreciate any help.

Thanks.


-----------------------------------------------------------------------

“Weaseling out of things is important to learn. It’s what separates
us from the animals.....except the weasel” ~ Homer Simpson

Ken Elliott

unread,
Dec 17, 2013, 10:41:24 PM12/17/13
to munk...@googlegroups.com
Hi,

I’m thinking you have a strange character that’s crept in.

Opening manifest in “TextWrangler” and showing invisibles.

The Manifest has a mix of tabs and spaces.
and your
’10.1.’ is different from me typing ’10.1’
'10.50.’ is different from me typing ’10.50’

Not sure if your manifest is missing the head and tail.

Try manifest below
Regards Ken

<?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">
</plist>

Keith Bracknell

unread,
Apr 3, 2014, 5:18:44 PM4/3/14
to munk...@googlegroups.com
Tim, do you have any examples of how to do this? I need to move some files into a users home directory and realize that I'll probably need to do so in the future. I like having a folder of scripts that can be called as needed. 

Please share if you have anything.

Thanks,
Keith

Tim Sutton

unread,
Apr 3, 2014, 9:23:43 PM4/3/14
to munk...@googlegroups.com
I implemented something based off Nate Walck's scriptRunner, that was in turn based off a pattern Greg has advocated and also documented in a MacTech issue (August 2012, I believe):


There are some other examples like this, but the idea is that you maintain one system for running scripts on login (or startup, for that matter). UNIX has done something similar for a long time with the "conf.d" pattern for config files and init systems.


Tim
For more options, visit https://groups.google.com/d/optout.

bryanzak

unread,
Apr 7, 2014, 12:20:13 PM4/7/14
to munk...@googlegroups.com
I posted a gist of a launch agent and script that would run any scripts found in a given folder every time a user logs in.


Might help.

Bryan

On Wednesday, December 11, 2013 7:33:21 AM UTC-6, Tim Sutton wrote:
Reply all
Reply to author
Forward
0 new messages