Skip to main content
Question

How to automatically reinstall software


Forum|alt.badge.img+5

Hello,

We are trying to push out a web and application filter for our Middle School students. Because each student is an admin on their computer, they can easily uninstall the software. If I place the packages in a hidden folder, is there a script that can check if the application is installed and if not install it from the hidden directory?

Thanks,
Nick

6 replies

Forum|alt.badge.img+7
  • Contributor
  • 10 replies
  • December 1, 2016

You can have an extension attribute to look for the application/required files and create a smart group to include machines that come back with an uninstalled response. Then scope a policy as ongoing with the target set to that smart group. Any machine that inventories and is in that smart group would then receive the policy.


Forum|alt.badge.img+8
  • Valued Contributor
  • 70 replies
  • December 1, 2016

I've started relying heavily on EA for situations like this. Here is a small EA that detects if a folder exists. If you want to search for a file you can use the "-e" flag instead of "-d".

#!/bin/sh

if
[ -d "/Applications/Application Support/Cisco" ] 
then
echo "<result>Installed</result>"
else
echo "<result>Not Installed</result>"
fi

mm2270
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • December 1, 2016

Why use an EA for something like this when the JSS already captures application inventory? I don't understand the reasoning behind an EA, especially since that EA would only get updated on a full inventory collection, same as the regular application inventory it already captures.


Forum|alt.badge.img+8
  • Valued Contributor
  • 70 replies
  • December 1, 2016

@mm2270 I just provided this as an option. I use an EA like this if I am looking for a specific file or folder that is outside of the Applications folder. But you are right, if its an application then just use the JSS inventory. Much easier.


mm2270
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • December 1, 2016

@danshaw Sure thing. I love EAs in general and they are great options for non-standard captured items, or when you need the information in a format the JSS doesn't provide. But yes, for something like a regular app, I would go with using the built in captured data to reduce any overhead during recons.


Forum|alt.badge.img+3
  • New Contributor
  • 22 replies
  • December 2, 2016

I would first create a Smart Group with Application Name [LIKE] "application name". Then create a Policy to install the application and scope it to "All Managed Clients" and add the Smart Group to the Exceptions. This will install the application on clients that do not have the app. Make sure to update inventory after installation otherwise the policy will run until your next inventory is complete.


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