Skip to main content

Ok, so I created a package for The Unarchiver, and in that package is
the com.apple.launchservices.plist. Now I know that there is a lot
more info stored in that file than just the file types that I want The
Unarchiver to open. When I push out this software will it just
overwrite the existing launchservices plist or will it add to the one
that is there? Ideally I would like it to add to it so I don't have to
keep track of a master with all of my file associations. Does anyone
know what the behavior is here with Casper? If it does overwrite the
file does anyone have a solution that will allow me to add to the
existing plist? Thanks!



Alan



Sent from my iPhone

No, it will not merge. Source files overwrite destination files.



Behind the scenes, Casper uses the "ditto" command to install .dmg packages.
Ditto overwrites existing files with the source files you're installing. I'm
not sure what the "installer" command for installing .pkg files, but it too
generally overwrites existing destination files with with source files from
your install package.



I would suggest you get into a little scripting for this situation and use
Composer's ability to create .pkg packages. A .dmg package is dumb and flat.
It contains files to copy and that's it. A .pkg package, however, can be
smart and include post install scripts that run once the files are in place.



In Composer, create a new package by dragging the files you want to install
into its window. You'll see the package name on the left. Twiddle the
disclosure triangle open to view the Scripts section. Right-click or
Control-click the Scripts section and select Add Shell Script -->
postinstall.



Select the postinstall script and you'll be able to edit it in the pane on
the right. You'll probably want to use a "defaults write" command to edit
com.apple.launchservices and run this recursively through every user folder
as well as your User Template. Remember, each user has his own
launchservices database.



Or, if you are using the MCX preferences feature of Casper Suite 7.0, then
you can specify a default launchservices setting and it will apply to all
users at login, merging your setting with their existing settings. This
would be much simpler to maintain but requires you also be using a JSS.



--



bill



William M. Smith, Technical Analyst
MCS IT
Merrill Communications, LLC
(651) 632-1492


Reply