Skip to main content
Question

install app or script with detection rules


Forum|alt.badge.img+4

Scenario - If user already has an app "xyz newer version" and we push app from jamf "xyz older version" then the app is getting downgraded. 

Instead can we have rules in Jamf or script which does not install app if it already exists or checks for version before installing ? 

3 replies

dennisnardi
Forum|alt.badge.img+15
  • Jamf Heroes
  • 56 replies
  • August 25, 2022

You can make a smartgroup to determine if an app is installed, or not installed, and use that to target your policy. As long as you make sure all your policies have an inventory update, then that group will be updated immediatley and if the app in your policy installs successfully then that computer falls out of the scope. That is the easiest way to do it. 

For example make a group that shows all machines without Chrome installed. Make a policy to install Chrome and scope it to this group. Make sure you include an inventory update in your policy. When your policy runs, if Chrome installs successfully then the machine will immediatley fall out of scope of the policy. You could then in theory set that policy to run on check-in, daily, weekly, monthly, whatever.

You can build a script to call a custom trigger to install stuff, if you really want. I can see some applications where that's useful, but for most things the smart group is way easier. For example you could do a check to see if a file exists and then run a trigger a la:

if [[ -f /Applications/application.app ]]; then echo "Already Installed" else echo "App not found, installing now" jamf policy -event customtriggerforapp fi

 

 


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 14 replies
  • August 26, 2022

thank you. I will try the steps. Is this a preinstall script ?


Forum|alt.badge.img+4
  • Author
  • Contributor
  • 14 replies
  • August 26, 2022

It does not work. It still says "app not found" and installs via MDM.  


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings