User-based shell scripts after self-service installation

kalikkalik
New Contributor

Lets say you have a self-service item, iWork for example.
After iWork is installed by the user, you want to serialize iWork by way of either:

1) writing user defaults to that users' preference file (assume you would choose to add a script in casper and run after the package is installed)
2) Deposit a file into the users' /Library/Preferences/ directory

I can't attempt yet (our Casper is offline) - but need to continue working to deploy these once it is online. Does either method work?
They sure don't work in packagemaker as postinstall scripts....since installer runs as root it can't understand the concept of "~" outside of the root user itself.

Thanks,
jeremy

6 REPLIES 6

ernstcs
Contributor III

The problem you might run into here is that the serialization that's created on one machine won't work on a another as it is bound to the hardware it was originally installed on. This is the case with many Apple software products. To get around this you typically need to purchase Volume licensing, which is 5 or more. And realisitically we do that to get the media that allows for a non-hardware bound install that can be packaged and deployed to multiple machines. I know that this is what we do for Final Cut Studio as well as Final Cut Express. I imagine that iWork is the same.

Perhaps this will answer your question.

Craig E

kalikkalik
New Contributor

Actually, we have volume licensing on everything possible - even when there are only a few licenses....except Final Cut Pro.
All the consumer stuff doesn't seem to be bound by hardware...so far.

So, is it doable using either of those methods for the non-hardware- bound apps?

-j

ernstcs
Contributor III

If you use Composer why wouldn't it just be part of the package, why does it need to be a separate file? Is this more for the security/licensing aspect so you don't go over your licenses by everyone just installing it since they see it?

To answer your question, as long as it's just a file you want to modify with defaults or copy down it should work. Right now there would be no trigger to make that second portion happen. You would have to initiate that unless you do more scripting. =)

Craig

kalikkalik
New Contributor

Many of those apps write licenses out to the users' defaults - not global defaults or the system - unfortunately.

We're limiting those who can see what apps by computer groups.

I suppose my question that, when a policy is executed by Casper, and it includes a script to modify user defaults, does it modify the user defaults for the person installing it, or root (which is how packagemaker works). Same goes for pushing a defaults file after an installation via self-service - will it install in that users' home directory (say it installs to ~/Library/Preferences) or instead, the root user (as in packagemaker).

Thanks,
j

milesleacy
Valued Contributor

The script will do what you tell it to. If you tell it to operate in user
space, it will.
I typically use a "for" command when I need to apply the same command to
every item in a particular directory, such as /Users. For example:

for i in $( ls /Users ) ; do defaults write
/Users/$i/Library/Preferences/com.manufacturer.product key type value ; done

Pardon me if my syntax isn't perfect, I don't have my script library or a
Mac OS X box at hand at the moment, but this is the general idea. You can
grep out stuff you don't want, or use if then else statements to avoid
putting your files in places such as /Users/Shared.

kalikkalik
New Contributor

Ah - you know what, I was focusing on using the tilde too much.
It makes total sense just to grep around or whoami and then execute based on that.

Thanks,
j