mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-23 13:14:13 +00:00
added markers and updated adobe adobereader labels
This commit is contained in:
@@ -13,7 +13,7 @@ VERSIONDATE='20200609'
|
|||||||
|
|
||||||
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
||||||
|
|
||||||
# adjust these variables:
|
# NOTE: adjust these variables:
|
||||||
|
|
||||||
# set to 0 for production, 1 for debugging
|
# set to 0 for production, 1 for debugging
|
||||||
# while debugging, items will be downloaded to the parent directory of this script
|
# while debugging, items will be downloaded to the parent directory of this script
|
||||||
@@ -38,6 +38,8 @@ BLOCKING_PROCESS_ACTION=prompt_user
|
|||||||
# - kill kill process without prompting or giving the user a chance to save
|
# - kill kill process without prompting or giving the user a chance to save
|
||||||
|
|
||||||
|
|
||||||
|
# NOTE: How labels work
|
||||||
|
|
||||||
# Each workflow label needs to be listed in the case statement below.
|
# Each workflow label needs to be listed in the case statement below.
|
||||||
# for each label these variables can be set:
|
# for each label these variables can be set:
|
||||||
#
|
#
|
||||||
@@ -110,16 +112,8 @@ BLOCKING_PROCESS_ACTION=prompt_user
|
|||||||
# When this variable is set (any value), $updateTool will be run as the current user.
|
# When this variable is set (any value), $updateTool will be run as the current user.
|
||||||
#
|
#
|
||||||
|
|
||||||
# todos:
|
|
||||||
|
|
||||||
# TODO: better logging (or, really, any logging other than echo)
|
# MARK: functions to help with getting data
|
||||||
# TODO: generic function Sparkle to get latest download
|
|
||||||
# TODO: ?notify user of errors
|
|
||||||
# TODO: ?generic function to initiate a Sparkle Update
|
|
||||||
# TODO: better version retrieval and reporting, before and after install
|
|
||||||
|
|
||||||
|
|
||||||
# functions to help with getting info
|
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
log_location="/private/var/log/Installomator.log"
|
log_location="/private/var/log/Installomator.log"
|
||||||
@@ -602,10 +596,17 @@ jamfreenroller)
|
|||||||
downloadURL=$(downloadURLFromGit jamf ReEnroller)
|
downloadURL=$(downloadURLFromGit jamf ReEnroller)
|
||||||
expectedTeamID="PS2F6S478M"
|
expectedTeamID="PS2F6S478M"
|
||||||
;;
|
;;
|
||||||
adobereaderdc)
|
adobereaderdc|adobereaderdc-install)
|
||||||
name="Adobe Acrobat Reader DC"
|
name="Adobe Acrobat Reader DC"
|
||||||
type="pkgInDmg"
|
type="pkgInDmg"
|
||||||
downloadURL=$(adobecurrent=`curl -s https://armmf.adobe.com/arm-manifests/mac/AcrobatDC/reader/current_version.txt | tr -d '.'` && echo http://ardownload.adobe.com/pub/adobe/reader/mac/AcrobatDC/"$adobecurrent"/AcroRdrDC_"$adobecurrent"_MUI.dmg)
|
downloadURL=$(curl --silent --fail -H "Sec-Fetch-Site: same-origin" -H "Accept-Encoding: gzip, deflate, br" -H "Accept-Language: en-US;q=0.9,en;q=0.8" -H "DNT: 1" -H "Sec-Fetch-Mode: cors" -H "X-Requested-With: XMLHttpRequest" -H "Referer: https://get.adobe.com/reader/enterprise/" -H "Accept: */*" "https://get.adobe.com/reader/webservices/json/standalone/?platform_type=Macintosh&platform_dist=OSX&platform_arch=x86-32&language=English&eventname=readerotherversions" | grep -Eo '"download_url":.*?[^\\]",' | head -n 1 | cut -d \" -f 4)
|
||||||
|
expectedTeamID="JQ525L2MZD"
|
||||||
|
blockingProcesses=( "AdobeReader" )
|
||||||
|
;;
|
||||||
|
adobereaderdc-update)
|
||||||
|
name="Adobe Acrobat Reader DC"
|
||||||
|
type="pkgInDmg"
|
||||||
|
downloadURL=$(adobecurrent=`curl --fail --silent https://armmf.adobe.com/arm-manifests/mac/AcrobatDC/reader/current_version.txt | tr -d '.'` && echo http://ardownload.adobe.com/pub/adobe/reader/mac/AcrobatDC/"$adobecurrent"/AcroRdrDCUpd"$adobecurrent"_MUI.dmg)
|
||||||
expectedTeamID="JQ525L2MZD"
|
expectedTeamID="JQ525L2MZD"
|
||||||
blockingProcesses=( "AdobeReader" )
|
blockingProcesses=( "AdobeReader" )
|
||||||
;;
|
;;
|
||||||
@@ -884,7 +885,8 @@ brokenteamid)
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# functions
|
# MARK: Functions
|
||||||
|
|
||||||
cleanupAndExit() { # $1 = exit code, $2 message
|
cleanupAndExit() { # $1 = exit code, $2 message
|
||||||
if [[ -n $2 && $1 -ne 0 ]]; then
|
if [[ -n $2 && $1 -ne 0 ]]; then
|
||||||
printlog "ERROR: $2"
|
printlog "ERROR: $2"
|
||||||
@@ -1068,7 +1070,7 @@ mountDMG() {
|
|||||||
cleanupAndExit 3
|
cleanupAndExit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Mounted: $dmgmount"
|
printlog "Mounted: $dmgmount"
|
||||||
}
|
}
|
||||||
|
|
||||||
installFromDMG() {
|
installFromDMG() {
|
||||||
@@ -1110,7 +1112,7 @@ installFromPKG() {
|
|||||||
# check for root
|
# check for root
|
||||||
if [ "$(whoami)" != "root" ]; then
|
if [ "$(whoami)" != "root" ]; then
|
||||||
# not running as root
|
# not running as root
|
||||||
echo "not running as root, exiting"
|
printlog "not running as root, exiting"
|
||||||
cleanupAndExit 6
|
cleanupAndExit 6
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1208,11 +1210,11 @@ runUpdateTool() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
### main code starts here
|
# MARK: main code starts here
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# extract info from data
|
# MARK: extract info from data
|
||||||
if [ -z "$archiveName" ]; then
|
if [ -z "$archiveName" ]; then
|
||||||
case $type in
|
case $type in
|
||||||
dmg|pkg|zip|tbz)
|
dmg|pkg|zip|tbz)
|
||||||
@@ -1256,7 +1258,7 @@ if [[ -z $blockingProcesses ]]; then
|
|||||||
blockingProcesses=( $name )
|
blockingProcesses=( $name )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# determine tmp dir
|
# MARK: determine tmp dir
|
||||||
if [ "$DEBUG" -ne 0 ]; then
|
if [ "$DEBUG" -ne 0 ]; then
|
||||||
# for debugging use script dir as working directory
|
# for debugging use script dir as working directory
|
||||||
tmpDir=$(dirname "$0")
|
tmpDir=$(dirname "$0")
|
||||||
@@ -1265,7 +1267,7 @@ else
|
|||||||
tmpDir=$(mktemp -d )
|
tmpDir=$(mktemp -d )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# change directory to temporary working directory
|
# MARK: change directory to temporary working directory
|
||||||
printlog "Changing directory to $tmpDir"
|
printlog "Changing directory to $tmpDir"
|
||||||
if ! cd "$tmpDir"; then
|
if ! cd "$tmpDir"; then
|
||||||
printlog "error changing directory $tmpDir"
|
printlog "error changing directory $tmpDir"
|
||||||
@@ -1273,7 +1275,7 @@ if ! cd "$tmpDir"; then
|
|||||||
cleanupAndExit 1
|
cleanupAndExit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check if this is an Update
|
# MARK: check if this is an Update
|
||||||
getAppVersion
|
getAppVersion
|
||||||
if [[ -n $appVersion ]]; then
|
if [[ -n $appVersion ]]; then
|
||||||
if [[ $DEBUG -eq 0 ]]; then
|
if [[ $DEBUG -eq 0 ]]; then
|
||||||
@@ -1285,7 +1287,7 @@ if [[ -n $appVersion ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# when user is logged in, and app is running, prompt user to quit app
|
# MARK: when user is logged in, and app is running, prompt user to quit app
|
||||||
|
|
||||||
if [[ $BLOCKING_PROCESS_ACTION == "ignore" ]]; then
|
if [[ $BLOCKING_PROCESS_ACTION == "ignore" ]]; then
|
||||||
printlog "ignoring blocking processes"
|
printlog "ignoring blocking processes"
|
||||||
@@ -1299,7 +1301,7 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# download the archive
|
# MARK: download the archive
|
||||||
|
|
||||||
if [ -f "$archiveName" ] && [ "$DEBUG" -ne 0 ]; then
|
if [ -f "$archiveName" ] && [ "$DEBUG" -ne 0 ]; then
|
||||||
printlog "$archiveName exists and DEBUG enabled, skipping download"
|
printlog "$archiveName exists and DEBUG enabled, skipping download"
|
||||||
@@ -1312,6 +1314,8 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# MARK: install the download
|
||||||
|
|
||||||
case $type in
|
case $type in
|
||||||
dmg)
|
dmg)
|
||||||
installFromDMG
|
installFromDMG
|
||||||
@@ -1337,7 +1341,7 @@ case $type in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# print installed application location and version
|
# MARK: print installed application location and version
|
||||||
sleep 10 # wait a moment to let spotlight catch up
|
sleep 10 # wait a moment to let spotlight catch up
|
||||||
getAppVersion
|
getAppVersion
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user