Deploying on MacOS with Jamf

This Article Applies to:

  • Avast Business Cloud Console
  • Avast Business On-Premise Console

Avast Business Antivirus can be deployed remotely to MacOS X devices through Jamf using the .dmg installer downloaded from the Management Consoles. For more information on how to download the .dmg installer, see Adding Devices via the Console.

While the script was created by a Jamf Nation community member on this forum post, Avast agents have confirmed its effectiveness in other live environments.

Deploying with Jamf

  1. Rename the vanilla Avast .dmg file to simply "avast.dmg" and upload to Jamf
  2. Make your Jamf policy:
    1. Cache avast.dmg
    2. Run the following script set to "After"
    3. Update inventory (under maintenance in the policy)

Script Text

#!/bin/bash

 

# the dmg has been cached and should be on the disk in this location

/usr/bin/hdiutil attach /Library/Application\ Support/JAMF/Waiting\ Room/avast.dmg -nobrowse

 

# Install the avast.pkg from inside the avast dmg so it works properly

/usr/sbin/installer -pkg /Volumes/Avast\ Business\ Antivirus/Avast\ Business\ Antivirus.pkg -target /

 

# Wait for a few seconds to make sure the app opens before trying to kill it

sleep 5

 

# quit the desktop app so the user doesn't have to interact with it

osascript -e 'quit app "Avast"'

 

# detach the avast dmg

/usr/bin/hdiutil detach /Volumes/Avast\ Business\ Antivirus/

 

# cleanup by removing the avast.dmg from the disk

rm /Library/Application\ Support/JAMF/Waiting\ Room/avast.dmg

rm /Library/Application\ Support/JAMF/Waiting\ Room/avast.dmg.cache.xml