Samanage shipped a new installer for their agent, and the structure is completely different than the PKG-based install they previously had. Here's how I deployed it.
- Download the new DMG from your Setup area in Samanage
- Extract to /tmp/samanage
- Create a new DMG-based package in Composer, and upload in Casper Admin
- Create a policy with the script below as an "after" script, plus the package you uploaded in step 3.
This script should be version-safe, as long as they don't change the structure again. Note, there's an options file that extracts alongside the .app, where you can set the agent to auto-update. I'd recommend this, to avoid having to keep repackaging their agent every time they ship a new release.
#!/bin/sh
#In the latest version, Samanage changed from a PKG install to DMG+script
#This means we no longer have the ability to pull the installer on-demand with cURL
echo "Running Samanage agent install"
# Uninstall current SAManage agent
echo "Trying to remove old Samanage agent"
/Applications/Samanage*.app/Contents/Resources/uninstaller.sh
# Install the SAManage Mac agent from /tmp/samanage copied by Casper
echo "Running the installer"
/tmp/samanage/Samanage_Agent_*.app/Contents/MacOS/installbuilder.sh --mode unattended
# Clean-up
# Remove the samanage files from /tmp
rm -rf /tmp/samanage/
echo "Exiting with success"
exit 0