Viscosity 1.7.3 JAMF Casper automated upgrade troubles
Posted: Wed Jul 12, 2017 8:00 pm
Hi Guys,
I was wondering if I could get some assistance with programmatically uninstalling and reinstalling Viscosity, or if possible, what it is that the "helpertool" prompt actually installs, so I can replicate appropriately.
I manage an estate of macs and want to bulk update the app, and settings as I can no longer assume users will do this correctly. I am therefore doing the following:
1) force an update of the application (curl command to download and hdutil to unpack and copy)
2) force through our VPN config connections (visc files being pushed are tested and working as should)
3) force through our license, some basic settings and update preferences (and where I believe Im falling over - privileged helper)
I use Casper to manage the macs, so use Composer to capture 2 and 3 and script 1 through a bash script)
Im currently getting mixed results when I uninstall various older versions ranging from 1.6 > 1.7.1 and push the new app, settings and helpertool.
I'll either get the installer helper prompt (even though Ive captured the helper file inside /Library/PriviledgedHelpers, checked its perms and tested) and this check will crash rendering Viscosity useless and have to reinstall manually.
If it does install, connecting to the pushed VPN entries causes a perpetual connect/reconnect or just doesn't connect stating that "Your VPN connection has been disconnected" even though it never connected. Ive had limited success with removing the viscosity/Openvpn1/2 entries from keychain, but this isn't feasible if fixing en mass.
Attached is the script Im using which makes use of instructions for uninstalling from here:
http://www.sparklabs.com/support/kb/art ... osity-mac/
I was wondering if I could get some assistance with programmatically uninstalling and reinstalling Viscosity, or if possible, what it is that the "helpertool" prompt actually installs, so I can replicate appropriately.
I manage an estate of macs and want to bulk update the app, and settings as I can no longer assume users will do this correctly. I am therefore doing the following:
1) force an update of the application (curl command to download and hdutil to unpack and copy)
2) force through our VPN config connections (visc files being pushed are tested and working as should)
3) force through our license, some basic settings and update preferences (and where I believe Im falling over - privileged helper)
I use Casper to manage the macs, so use Composer to capture 2 and 3 and script 1 through a bash script)
Im currently getting mixed results when I uninstall various older versions ranging from 1.6 > 1.7.1 and push the new app, settings and helpertool.
I'll either get the installer helper prompt (even though Ive captured the helper file inside /Library/PriviledgedHelpers, checked its perms and tested) and this check will crash rendering Viscosity useless and have to reinstall manually.
If it does install, connecting to the pushed VPN entries causes a perpetual connect/reconnect or just doesn't connect stating that "Your VPN connection has been disconnected" even though it never connected. Ive had limited success with removing the viscosity/Openvpn1/2 entries from keychain, but this isn't feasible if fixing en mass.
Attached is the script Im using which makes use of instructions for uninstalling from here:
http://www.sparklabs.com/support/kb/art ... osity-mac/
Code: Select all
Cheers#!/bin/bash
##############################`
# MODIFIABLE
##############################
VERSION=$4
DMG_NAME="Viscosity.dmg"
APPNAME="Viscosity.app"
VIS_LINK="https://www.sparklabs.com/downloads/${DMG_NAME}"
FOLDER="viscosity"
APP_PATH="/Applications/$APPNAME"
##############################
# Constants to compute
##############################
if [ -d $APP_PATH ]
then
osascript -e 'tell application “Viscosity” to disconnectall'
sleep 2
sudo pkill -3 Viscosity
launchctl unload "/Library/LaunchDaemons/com.sparklabs.ViscosityHelper.plist"
rm "/Library/PrivilegedHelperTools/com.sparklabs.ViscosityHelper"
rm "/Library/LaunchDaemons/com.sparklabs.ViscosityHelper.plist"
rm -R "/Library/Application Support/Viscosity"
echo "$APP_PATH present - deleting"
rm -rf $APP_PATH
defaults delete com.viscosityvpn.Viscosity
fi
mkdir /private/tmp/"$FOLDER"
cd /private/tmp/"$FOLDER"
curl -L -O "$VIS_LINK"
hdiutil mount -nobrowse "${DMG_NAME}"
cp -R "/Volumes/Viscosity/${APPNAME}" /Applications
hdiutil unmount "/Volumes/Viscosity"
rm -R /private/tmp/"$FOLDER"