08-25-2022 03:56 AM - edited 08-25-2022 03:56 AM
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 ?
Posted on 08-25-2022 07:44 AM
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
Posted on 08-26-2022 01:19 AM
thank you. I will try the steps. Is this a preinstall script ?
Posted on 08-26-2022 03:54 AM
It does not work. It still says "app not found" and installs via MDM.