Policy Rules

thoule
Valued Contributor II

I need to install a program (X2Go) via Self Service. That program requires XQuartz. I don't want to bundle the XQuartz program into the policy as users may already have it or may have a later version. Or perhaps this issue isn't a big deal and that's ok to do? I don't want 'failed' for end users if they have a later version of XQuartz already.

I dont want a smart group that shows X2Go for only for users that already have XQuartz. What I'm thinking of doing is creating a smart group of users that do not have XQuartz. Then a policy with only a custom event trigger to install it. Finally as a 'files and processes' task at the end of X2Go, run 'jamf policy -event xquartz'. It'll either say no such policy if they already have it, or it'll install. I'm assuming it won't be a failed policy if 'jamf policy -event xquartz' returns no such policy.

I'm curious how you would solve this situation. thanks -T-

1 REPLY 1

chriscollins
Valued Contributor

You have the right idea. What I would do a little differently is do it as a script in the JSS instead of using the files and processes step at the end. Its just a little easier to edit and maintain, etc.

You would add the script to the policy and have it run as a BEFORE action. In the script you'd have it check for xQuartz and if it doesn't have it then run the custom trigger as you planned and if they do have it already it just exits. It will then go on and install the package.

We do this for our printers which I took as an idea from Rich Trouton. Our user's go to install a printer and on every printer policy in the JSS there is a script attached to the policy to check for the appropriate drivers like Xerox ones. If they have it, it just exits and the install moves on to installing the printer itself. If it doesn't find the drivers it will pop up a message to the user telling them its going to go and install the drivers and does that, then installs the printer.