How to configure Installomator to update only installed apps?

GetCart3r
New Contributor III

I have been using Installomator and it has been working great. However, is there an option for the app/script to perform a check-in and install the latest update only if the app is already installed. Currently, when I run Installomator, it installs the app regardless of whether it was previously installed or not.

For instance, during my testing, I didn't install Google Chrome on one machine and installed it on another using Self Service. I would like Installomator to update the app, but only on the computer where it was installed by the user/Self Service. On the machine where Google Chrome was not installed previously, I don't want Installomator to perform any installation.

Is there a way to modify the script so that it only runs when the app is detected on the system? This would ensure that Installomator updates the app only when it is already present.

 

TY

1 ACCEPTED SOLUTION

Tribruin
Valued Contributor II

You need to create a Smart Group with criteria “Application Title is Google Chrome.app” and then scope your Installomator policy to that Smart Group. That will only run Installomator policy on computers wiht Google Chrome already installed. You would then have another Self Service policy that install Google Chrome (you could still use the Installomator script, but just not not have any triggers, just assign it to Self Service.)

If you want to get a little more complex, create a Patch Management item for Google Chrome and then add  the Patch Management criteria in your Smart Group and  “Not on Lastest Version”, so now your upgrade policy will only run on computers that (a) have Google Chrome installed and (b) not up to date. 

View solution in original post

2 REPLIES 2

Tribruin
Valued Contributor II

You need to create a Smart Group with criteria “Application Title is Google Chrome.app” and then scope your Installomator policy to that Smart Group. That will only run Installomator policy on computers wiht Google Chrome already installed. You would then have another Self Service policy that install Google Chrome (you could still use the Installomator script, but just not not have any triggers, just assign it to Self Service.)

If you want to get a little more complex, create a Patch Management item for Google Chrome and then add  the Patch Management criteria in your Smart Group and  “Not on Lastest Version”, so now your upgrade policy will only run on computers that (a) have Google Chrome installed and (b) not up to date. 

ianatkinson
Contributor

I don't think Installomator has this built in however if you're wanting to do the logic in the script rather than in JAMF (that's what I'm doing as it's easier) then you can use the info and techniques already in Installomator for this.

I have a ZSH array of the apps which are to only be updated if installed:

 

updateOnly=(
	'blender'
	'zoom'
	'zulip'
)

And then a function which can iterate this array, pull out the app name from Installomator, check if it's installed (using the same technique they use) and then update if necessary: 

function updateOnlyIfInstalled()
{
	for i in "${updateOnly[@]}"
		do
			appName=$(cat $app | grep -A1 "^$i)$" | tail -1 | cut -d'"' -f2)

			if [[ -z "$appName" ]] ; then
				echo "failed to find full name for $i"
				return
			fi

			if mdfind "kind:application AND name:$appName" -0 2>/dev/null | grep -qE "\w"
				then
					installOrUpdateApp $i
				else
					echo
					echo "   // skipping $i update as not installed"
			fi
		done
}

In here $app is just the path to Installomator and installOrUpdateApp is my wrapper function for calling Installomator.

This seems to work as intended for me:

   // start blender
   ...found app at /Applications/blender.app, version 4.2.0
   ...Latest version of blender is 4.2.0
   ...No newer version.
   ...OK

   // start zoom
   ...found app at /Applications/zoom.us.app, version 6.1.6.37851, on versionKey CFBundleVersion
   ...Latest version of zoom.us is 6.1.6.37851
   ...No newer version.
   ...OK

   // skipping zulip update as not installed