3 Commits

Author SHA1 Message Date
Søren Theilgaard
07efbb394f Improved detection if signature was missing
@scriptingosx: Wandering if we should just detect if Team IDs match anyway, and continue the installation no matter the gatekeeper setting for allowing App Store apps only.
2022-04-11 09:02:00 +02:00
Søren Theilgaard
93844fdad9 Update CHANGELOG.md 2022-04-07 20:16:11 +02:00
Søren Theilgaard
27aa86b279 Extra log for spctl rejected 2022-04-07 20:06:17 +02:00
225 changed files with 1063 additions and 8683 deletions

View File

@@ -1,223 +1,8 @@
## v10beta3
- option to add item to dock if dockutil is installed (#701 requires dockutil https://github.com/kcrawford/dockutil )
- further improvements to GitHub downloads (#691)
- updated user dialog when app is already on the latest version (#658)
Plus everything from beta1 and beta2.
- new labels:
- adobeacrobatprodc (#707)
- adobereaderdc-install (#707)
- archiwareb2go (#625, #707)
- archiwarepst (#624)
- bitrix24 (#661)
- charles (#670)
- chronoagent (#617)
- chronosync (#616)
- cytoscape (#689)
- egnytecore (#655)
- fellow (#599)
- filemakerpro (#609)
- fujifilmwebcam (#598)
- gfxcardstatus (#690)
- horos (#610)
- inetclearreportsdesigner (#601)
- jdk18 (#608)
- latexit (#684)
- nudgesuite (#633)
- origin (#662)
- parallelsrasclient (#607)
- polylens (#671)
- splashtopbusiness (#660)
- tailscale (#620)
- zoomoutlookplugin (#656)
- zotero (#634)
- zulujdk18 (#612)
- updated labels:
- acroniscyberprotectconnectagent (#678)
- adobecreativeclouddesktop (#687)
- adobereaderdc-update (#707)
- audacity (#708)
- duckduckgo (#704)
- libreoffice (#605)
- nudge
- obs (#692)
- r (#702)
- rstudio (#702)
- screamingfrogseospider (#665)
- vlc (#705, #606)
- xcreds
## v10beta2
- fixed problem with GitHub labels (#659)
- bz2 archive support (#659)
- fixed WorkspaceOne support (#653)
- updated how `aapNewVersion` is determined (#680)
Plus everything from v10beta1
- new labels:
- abetterfinderrename11 (#552)
- carboncopycloner (#553)
- cocoapods (#659)
- coconutbattery (#588)
- cricutdesignspace (#562)
- dynalist (#591)
- fellow (#591)
- flexoptixapp (#554)
- googleadseditor (#652, #541)
- kap (#568)
- keepingyouawake (#549)
- lcadvancedvpnclient (#584)
- masv (#569)
- merlinproject (#555)
- mongodbcompass (#654)
- netspot (#556)
- relatel (#619)
- sonicvisualiser (#575)
- strongdm (#559)
- synologyassistant (#557)
- synologydriveclient (#582)
- tencentmeeting (#570)
- typinator (#583)
- xcreds (#675)
- updated labels:
- acroniscyberprotectconnect/remotix (#664)
- acroniscyberprotectconnectagent/remotixagent (#664)
- awsvpnclient (#586)
- boxtools (#589)
- clevershare2 (#664)
- coderunner (#664)
- colourcontrastanalyser (#664)
- cryptomator (#664)
- dangerzone (#664)
- drawio (#664)
- golang (#664)
- icons (#664)
- insomnia (#664)
- knockknock (#664)
- libreoffice (#672)
- macports
- opera (#664)
- supportapp (#664)
- vmwarehorizonclient (#645, #511)
- deleted/deactivated labels:
- microsoftyammer (#664)
- wickrme (#664)
- wickrpro (#664)
## v10beta1
- [swiftDialog](https://github.com/bartreardon/swiftDialog) integration (#641, #632), many thanks to @bartreardon, [sample scripts](in the MDM folder)
- added WorkspaceOne option for LOGO (#517)
- added function for JSON parsing with JXA (#529)
- updated assemble.sh script to update Labels.txt when script is rebuilt (#540)
- added a no requisite install script (#493)
- GitHub lookup now don't use API calls, this should avoid or at least reduce rate limiting (#543)
- fixed redundant exit codes (#643, #561)
NOTE: some exit codes have changed! see [Installomator Exit Codes](https://github.com/Installomator/Installomator/wiki/Installomator-Exit-Codes) for a list
- new labels:
- bluejeanswithaudiodriver (#473)
- duodevicehealth (#548)
- googlechromeenterprise (#532)
- ipswupdater (#545)
- mmhmm (#571)
- nordlayer (#419)
- prune (#538)
- whatroute (#560)
- updated labels:
- blender (#535, #622)
- camtasia2019 (#547)
- clickshare (#565)
- egnyte (#500)
- googledrive (#563)
- grammarly (#576)
- marathon, marathon2, marathoninfinity (#544)
- miro (#475, #539)
- notion (#566)
- ringcentralapp (#550)
- sublimetext (#593, #578, #567, #623, #626)
- talkdeskcallbar (#536)
- talkdeskcxcloud (#537)
- wireshark (#585)
## v9.2
**Note**: Both Google and Mozilla recommend using the pkg installers instead of the dmg downloads for managed deployments. So far, Installomator has provided labels for both. (`googlechrome` and `googlechromepkg` or `firefox` and `firefoxpkg`, respectively) Since there are problems with the dmg downloads, a future release of Installomator will _disable_ the `firefox` and `googlechrome` dmg labels. You should switch to using `googlechromepkg` and `firefoxpkg` labels instead.
- bug fix (#434)
- documentation updates (#485, #494)
- new labels:
- 1password8 (#514)
- ultimakercura
- androidstudio (#547)
- atextlegacy (#464)
- camtasia2019, camtasia2020 (#499)
- clue, cluefull (#481)
- craftmanagerforsketch
- displaylinkmanager (#448)
- drawio (#480)
- duckduckgo
- egnytewebedit (#512)
- filezilla (#522)
- firefoxpkg_intl
- flycut (#501)
- fontexplorer (#523)
- hype (#524)
- idrive (#507), idrivethin (#509)
- imageoptim (#525)
- linear (#519)
- macoslaps (#502)
- mightymike
- mindmanager (#479)
- pika (#526)
- propresenter7 (#394)
- qgis-pr
- shottr (#516)
- slab (#487)
- snagit2019, snagit2020, snagit2021 (#498)
- sonobus (#490)
- talkdeskcxcloud (#452)
- thunderbird_intl (#497)
- unnaturalscrollwheels (#503)
- wechat (#510)
- xeroxworkcentre7800 (#527)
- zohoworkdrivegenie
- updated labels
- adobereaderdc-update, adobereaderdc (#503)
- amazoncorretto8jdk (#461)
- camtasia (#499)
- citrixworkspace (#508)
- dbeaverce (#450)
- dropbox
- firefox, firefox_da, firefox_intl (#495), firefoxesr_intl (#496), firefoxpkg
- googlechrome, googlechromepkg (#484)
- gpgsuite (#465)
- grammarly (#515)
- logitechoptions (#478)
- onlyofficedesktop (#454)
- postman (#458)
- rancherdesktop (#463)
- remotedesktopmanagerenterprise
- remotedesktopmanagerfree
- ringcentralapp (#492)
- sketch
- snagit (#498)
- talkdeskcallbar (#453)
- if `spctl`-check is `rejected` then we now show an error that it can be due to Gatekeepr only allowing apps from App Store only. Installomator requires that all identified developers are accepted as well.
## v9.1
**Note**: Both Google and Mozilla recommend using the pkg installers instead of the dmg downloads for managed deployments. So far, Installomator has provided labels for both. (`googlechrome` and `googlechromepkg` or `firefox` and `firefoxpkg`, respectively) Since there are problems with the dmg downloads, a future release of Installomator will _disable_ the `firefox` and `googlechrome` dmg labels. You should switch to using the respective pkg labels instead.
- added option for Microsoft Endpoint Manager (Intune) to `LOGO` (#446)
- minor fixes (#427, #434, #436)

View File

@@ -1,35 +1,33 @@
# Contributing to Installomator
__Please note, that if you are contributing to this project with new labels or other suggestions in PRs, please put your changes in the files in the `fragments` sub-folder. DO NOT edit the full `Installomator.sh` script. The full script is generated from the fragments, and will be overwritten. More details on [how the script is assembled from the fragments here](https://github.com/Installomator/Installomator/tree/main/utils#how-to-assemble-installomatorsh).__
__Please note, that if you are contributing to this project with new labels or other suggestions in PRs, please put your changes in the files below `fragments`-folder. DO NOT edit the full `Installomator.sh` script. The full script is now a build of the fragments, and will be overwritten.__
We try to keep the script as short as possible, and with more than 400 labels, we can save 400 lines in the script, if we do not have credit lines on each of these. So we are thankful for your contribution, but we will be removing these lines in the coming releases.
We try to keep the script as short as possible, and with more than 300 labels, we can save 300 lines in the script, if we do not have credit lines on each of these. So we are thankful for your contribution, but we will be removing these lines in the coming releases.
## Branches
The branch list is as follows:
- `release`: this branch will have the latest released version
- `main`: (default) this branch will be the current build we are working on. It includes new and updated app labels, and critical bug fixes
- `dev`: this will contain new and updated app labels, as well as other code changes that have the risk of significantly changing or breaking behavior
there will be other branches for new features and testing.
- `main`: (default) this branch will be the latest release plus new and updated app labels, and critical bug fixes
- `dev`: this will contain new and updated app labels, as well as any other code changes
there will be other branches for new features and testing
This should allow the contributing team to release minor updates for new and updated app labels while also work on new features for the next major release.
With all the new branches, your local repo may get confused. If you dont have local changes, it is easiest to delete your local repo and re-clone it. If you have local changes you want to preserve, then you should commit those to a local branch, pull the latest changes `git pull --all`, then delete the old master branch: `git branch -d master`.
Please make sure you branch off of main for your PRs.
__Thank you for contributing!__
Make sure you branch off of main for new and updated labels and off of `dev` for other code changes. Thank you for contributing!
## Labels
If you need a new label for a piece of software, please take a look [at the tutorials in the Wiki](https://github.com/Installomator/Installomator/wiki#tutorials), those can be helpful for starting out on the creation of the label.
If you need a new label for a piece of software, please take a look at the tutorials in the Wiki, if those can be helpful for starting out on the creation of the label.
We expect you to try out finding the __version__ of the software online, so that `appNewVersion` can be filled in the label. It helps a lot when the software needs update, and greatly improve user experience.
Please document what you found out about the __version__ of the software if it's not included. We will not accept a new label if this is not documented, we will ask about this if it was not included. This is very important for the quality and reliability of Installomator.
When creating a new label, please file a pull request (PR). And feel free to ask questions or make your comments about what else is needed, if we should take a look at the label, or help out in finding the version or isolating URLs or anything else. You can find [a tutorial on how to create a PR here](https://github.com/Installomator/Installomator/wiki/GitHub-howto-create-PRs).
When creating a new label, please file a pull request (PR). And feel free to ask questions or make your comments about what else is needed, if we should take a look at the label, or help out in finding the version or isolating URLs or anything else.
Please include the log of installing this label in the description, like this:
```
@@ -41,13 +39,11 @@ Please include the log of installing this label in the description, like this:
Please have one label per PR, so we can separate these. Also if you change/fix a label.
__Thank you very much for your contribution!__
Thank you very much for your contribution!
## Issues
Do not create an issue just when you have a questions, but do file an issue or pull request (PR) for bugs or wrong behavior. Include the full log and include the version of Installomator you're running. When you create a PR to follow-up and solve an issue make sure to [mention the issue using the `#xxx` syntax in a commit message or comment to link the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).
Join [the MacAdmins Slack](https://macadmins.org) and find us in the `#installomator` channel for questions, support and discussions.
Do not create an issue just when you have a questions, but do file an issue or pull request (PR) for bugs or wrong behavior. Include the full log and include the version of Installomator you're running.
When in doubt, use the MacAdmins.org Slack as described in [README.md](https://github.com/Installomator/Installomator/)

File diff suppressed because it is too large Load Diff

View File

@@ -1,19 +1,13 @@
1password7
1password8
1passwordcli
4kvideodownloader
8x8
abetterfinderrename11
abstract
acroniscyberprotectconnect
acroniscyberprotectconnectagent
adobeacrobatprodc
adobebrackets
adobeconnect
adobecreativeclouddesktop
adobereaderdc
adobereaderdc-install
adobereaderdc-install
adobereaderdc-update
aircall
airserver
@@ -26,7 +20,6 @@ amazonchime
amazoncorretto8jdk
amazonworkspaces
androidfiletransfer
androidstudio
anydesk
apparency
appcleaner
@@ -37,12 +30,9 @@ applesfmono
applesfpro
applesfsymbols
aquaskk
archiwareb2go
archiwarepst
arq7
asana
atext
atextlegacy
atom
audacity
authydesktop
@@ -60,11 +50,9 @@ bartender
basecamp3
bbedit
bettertouchtool
bitrix24
bitwarden
blender
bluejeans
bluejeanswithaudiodriver
boxdrive
boxsync
boxtools
@@ -76,15 +64,8 @@ calcservice
calibre
camostudio
camtasia
camtasia2019
camtasia2020
camtasia2021
canva
carboncopycloner
charles
chatwork
chronoagent
chronosync
cisdem-documentreader
citrixworkspace
clevershare2
@@ -92,20 +73,13 @@ clickshare
clipy
closeio
cloudya
clue
cluefull
cocoapods
coconutbattery
code42
coderunner
colourcontrastanalyser
cormorant
craftmanager
craftmanagerforsketch
cricutdesignspace
cryptomator
cyberduck
cytoscape
daisydisk
dangerzone
darktable
@@ -120,20 +94,13 @@ dialog
dialpad
discord
diskspace
displaylinkmanager
docker
dockutil
drawio
drift
dropbox
duckduckgo
duodevicehealth
dynalist
easeusdatarecoverywizard
easyfind
egnyte
egnytecore
egnytewebedit
element
eraseinstall
eshareosx
@@ -144,11 +111,8 @@ exifrenamer
fantastical
fastscripts
favro
fellow
ferdi
figma
filemakerpro
filezilla
findanyfile
firefox
firefox_da
@@ -157,22 +121,14 @@ firefoxesr
firefoxesr_intl
firefoxesrpkg
firefoxpkg
firefoxpkg_intl
flexoptixapp
flowjo
flux
flycut
fontexplorer
front
fsmonitor
fujifilmwebcam
gfxcardstatus
gimp
githubdesktop
golang
googleadseditor
googlechrome
googlechromeenterprise
googlechromepkg
googledrive
googledrivebackupandsync
@@ -191,26 +147,19 @@ gyazogif
hancock
handbrake
hazel
horos
houdahspot
hpeasyadmin
hpeasystart
hype
hyper
ibarcoder
icons
idrive
idrivethin
iina
imageoptim
imazingprofileeditor
inetclearreportsdesigner
inkscape
insomnia
installomator
installomator_theile
intellijideace
ipswupdater
istatmenus
iterm2
itsycal
@@ -220,7 +169,6 @@ jamfconnectconfiguration
jamfmigrator
jamfpppcutility
jamfreenroller
jdk18
jetbrainsclion
jetbrainsdatagrip
jetbrainsintellijidea
@@ -231,10 +179,8 @@ jetbrainspycharmce
jetbrainsrubymine
jetbrainstoolbox
jetbrainswebstorm
kap
karabinerelements
keepassxc
keepingyouawake
keka
keybase
keyboardmaestro
@@ -243,13 +189,9 @@ knockknock
krisp
krita
lastpass
latexit
launchbar
lcadvancedvpnclient
lexarrecoverytool
libreoffice
linear
logioptions
logitechoptions
logseq
loom
@@ -259,16 +201,13 @@ lulu
macadminspython
maccyapp
macfuse
macoslaps
macports
malwarebytes
marathon
marathon2
marathoninfinity
masv
mattermost
menumeters
merlinproject
microsoftautoupdate
microsoftazuredatastudio
microsoftazurestorageexplorer
@@ -292,31 +231,25 @@ microsoftskypeforbusiness
microsoftteams
microsoftvisualstudiocode
microsoftword
mightymike
mindmanager
microsoftyammer
miro
mmhmm
mobikinassistantforandroid
mochakeyboard
mochatelnet
mochatn3270
mochatn3812
mochatn5250
mongodbcompass
montereyblocker
mowgliiitsycal
musescore
muzzle
nanosaur
netnewswire
netspot
nextcloud
nomad
nomadlogin
nordlayer
notion
nudge
nudgesuite
nvivo
obs
obsidian
@@ -334,23 +267,19 @@ onlyofficedesktop
openvpnconnect
openvpnconnectv3
opera
origin
ottomatic
overflow
pacifist
packages
pandoc
parallelsrasclient
paretosecurity
parsec
pdfsam
perimeter81
pika
pitch
plantronicshub
platypus
plisteditpro
polylens
postman
prism9
pritunl
@@ -358,19 +287,15 @@ privileges
proctortrack
promiseutility
promiseutilityr
propresenter7
protonvpn
proxyman
prune
pycharmce
pymol
qgis-pr
r
ramboxce
rancherdesktop
rectangle
redeye
relatel
remotedesktopmanagerenterprise
remotedesktopmanagerfree
remotix
@@ -397,7 +322,6 @@ secretive
sequelpro
sfsymbols
shield
shottr
sidekick
signal
silnite
@@ -406,28 +330,21 @@ sizeup
sketch
sketchupviewer
skype
slab
slack
smartgit
snagit
snagit2019
snagit2020
snagit2021
snagit2022
snapgeneviewer
sonicvisualiser
sonobus
sonos
sonoss1
sonoss2
sourcetree
splashtopbusiness
splashtopsos
spotify
sqlpropostgres
sqlprostudio
steelseriesengine
strongdm
strongsync
sublimetext
superhuman
@@ -436,15 +353,11 @@ suspiciouspackage
swiftdialog
swiftruntimeforcommandlinetools
sync
synologyassistant
synologydriveclient
tableaudesktop
tableaupublic
tableaureader
tageditor
tailscale
talkdeskcallbar
talkdeskcxcloud
taskpaper
teamviewer
teamviewerhost
@@ -452,13 +365,11 @@ teamviewerqs
techsmithcapture
telegram
tembo
tencentmeeting
textexpander
textmate
theunarchiver
things
thunderbird
thunderbird_intl
tidal
toggltrack
tom4aconverter
@@ -466,13 +377,10 @@ torbrowser
trex
tunnelbear
tunnelblick
typinator
typora
ultimakercura
umbrellaroamingclient
uniconverter
universaltypeclient
unnaturalscrollwheels
utm
vagrant
vanilla
@@ -490,15 +398,13 @@ wallyezflash
webex
webexmeetings
webexteams
wechat
whatroute
whatsapp
wickrme
wickrpro
wireshark
wordservice
wwdc
xcreds
xeroxphaser7800
xeroxworkcentre7800
xink
xmenu
xquartz
@@ -507,17 +413,13 @@ yubikeymanagerqt
zappy
zeplin
zohoworkdrive
zohoworkdrivegenie
zohoworkdrivetruesync
zoom
zoomclient
zoomgov
zoomoutlookplugin
zoomrooms
zotero
zulujdk11
zulujdk13
zulujdk15
zulujdk17
zulujdk18
zulujdk8

169
MDM/App script.sh Executable file
View File

@@ -0,0 +1,169 @@
#!/bin/zsh
# Installation using Installomator
what="brave" # enter the software to install
# To be used as a script sent out from a MDM.
# Fill the variable "what" above with a label.
# Script will run this label.
###############################################
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
caffexit 99
fi
${destFile} ${what} LOGO=mosyleb BLOCKING_PROCESS_ACTION=tell_user #NOTIFY=all #INSTALL=force
if [ $? != 0 ]; then
# This is currently not working in Mosyle, that will ignore script errors. Please request support for this from Mosyle!
echo "Error installing ${what}. Exit code $?"
caffexit $?
fi
echo "[$(DATE)][LOG-END]"
caffexit 0
# notify behavior
# NOTIFY=success
# options:
# - success notify the user on success
# - silent no notifications
# - all all notifications (great for Self Service installation)
# behavior when blocking processes are found
# BLOCKING_PROCESS_ACTION=tell_user
# options:
# - ignore continue even when blocking processes are found
# - quit app will be told to quit nicely, if running
# - quit_kill told to quit twice, then it will be killed
# Could be great for service apps, if they do not respawn
# - silent_fail exit script without prompt or installation
# - prompt_user show a user dialog for each blocking process found
# abort after three attempts to quit
# (only if user accepts to quit the apps, otherwise
# the update is cancelled).
# - prompt_user_then_kill
# show a user dialog for each blocking process found,
# attempt to quit two times, kill the process finally
# - prompt_user_loop
# Like prompt-user, but clicking "Not Now", will just wait an hour,
# and then it will ask again.
# WARNING! It might block the MDM agent on the machine, as
# the scripts gets stuct in waiting until the hour has passed,
# possibly blocking for other management actions in this time.
# - tell_user User will be showed a notification about the important update,
# but user is only allowed to quit and continue, and then we
# ask the app to quit.
# - tell_user_then_kill
# Show dialog 2 times, and if the quitting fails, the
# blocking processes will be killed.
# - kill kill process without prompting or giving the user a chance to save
# logo-icon used in dialog boxes if app is blocking
# LOGO=appstore
# options:
# - appstore Icon is Apple App Store (default)
# - jamf JAMF Pro
# - mosyleb Mosyle Business
# - mosylem Mosyle Manager (Education)
# - addigy Addigy
# path can also be set in the command call, and if file exists, it will be used.
# Like 'LOGO="/System/Applications/App\ Store.app/Contents/Resources/AppIcon.icns"'
# (spaces have to be escaped).
# App Store apps handling
# IGNORE_APP_STORE_APPS=no
# options:
# - no If installed app is from App Store (which include VPP installed apps)
# it will not be touched, no matter it's version (default)
# - yes Replace App Store (and VPP) version of app and handle future
# updates using Installomator, even if latest version.
# Shouldnt give any problems for the user in most cases.
# Known bad example: Slack will loose all settings.
# install behavior
# INSTALL=""
# options:
# - When not set, software will only be installed
# if it is newer/different in version
# - force Install even if its the same version
# Re-opening of closed app
# REOPEN="yes"
# options:
# - yes App wil be reopened if it was closed
# - no App not reopened
########################
# Often used labels:
########################
# firefox
# firefox_intl
# brave
# torbrowser
# googlechrome
# netnewswire
# adobereaderdc
# textmate
# cyberduck
# keka
# theunarchiver
# vlc
# handbrake
# inkscape
# signal
# telegram
# whatsapp
# hazel
# devonthink
# teamviewerqs
# zoom
# malwarebytes
# githubdesktop
# sublimetext
# textmate
# visualstudiocode
# microsoftskypeforbusiness
# microsoftteams
# microsoftyammer
# microsoftedgeenterprisestable
# microsoftedgeconsumerstable
# microsoftsharepointplugin
# microsoftdefenderatp
# googledrivefilestream
# cdef
# desktoppr
# supportapp
# xink
# wwdc

View File

@@ -1,346 +0,0 @@
#!/bin/sh
# Installation using Installomator with Dialog showing progress (and posibility of adding to the Dock)
# Installation of software using `valuesfromarguments` to install a custom software using Installomator through GitHub
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
#item="gfxcardstatus" # enter the software to install (if it has a label in future version of Installomator)
# Label variables below
# GitHub functions
downloadURLFromGit() { # $1 git user name, $2 git repo name
gitusername=${1?:"no git user name"}
gitreponame=${2?:"no git repo name"}
if [[ $type == "pkgInDmg" ]]; then
filetype="dmg"
elif [[ $type == "pkgInZip" ]]; then
filetype="zip"
else
filetype=$type
fi
if [ -n "$archiveName" ]; then
downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*$archiveName" | head -1 || true)
if [[ "$(echo $downloadURL | grep -ioE "https.*$archiveName" || true)" == "" ]]; then
#printlog "Trying GitHub API for download URL."
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }" || true)
fi
else
downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1 || true)
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype" || true)" == "" ]]; then
#printlog "Trying GitHub API for download URL."
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }" || true)
fi
fi
if [ -z "$downloadURL" ]; then
echo "could not retrieve download URL for $gitusername/$gitreponame"
exit 1
else
echo "$downloadURL"
return 0
fi
}
versionFromGit() {
# credit: Søren Theilgaard (@theilgaard)
# $1 git user name, $2 git repo name
gitusername=${1?:"no git user name"}
gitreponame=${2?:"no git repo name"}
#appNewVersion=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | grep tag_name | cut -d '"' -f 4 | sed 's/[^0-9\.]//g' || true)
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g' || true)
if [ -z "$appNewVersion" ]; then
#echo "could not retrieve version number for $gitusername/$gitreponame"
appNewVersion=""
else
echo "$appNewVersion"
return 0
fi
}
# Variables for label
name="gfxCardStatus"
type="zip"
packageID=""
downloadURL="$(downloadURLFromGit codykrieger gfxCardStatus)"
appNewVersion="$(versionFromGit codykrieger gfxCardStatus)"
versionKey=""
expectedTeamID="LF22FTQC25"
# Dialog icon
icon=""
# icon should be a file system path or an URL to an online PNG.
# In Mosyle an URL can be found by copy picture address from a Custom Command icon.
# dockutil variables
addToDock="1" # with dockutil after installation (0 if not)
appPath="/Applications/$name.app"
# Other variables
dialog_command_file="/var/tmp/dialog.log"
dialogApp="/Library/Application Support/Dialog/Dialog.app"
dockutil="/usr/local/bin/dockutil"
installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user DIALOG_CMD_FILE=${dialog_command_file}" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 10.0.2 : Improved icon checks and failovers
# v. 10.0.1 : github-functions added. Improved appIcon handling. Can add the app to Dock using dockutil.
# v. 10.0 : Integration with Dialog and Installomator v. 10
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
dialogUpdate() {
# $1: dialog command
local dcommand="$1"
if [[ -n $dialog_command_file ]]; then
echo "$dcommand" >> "$dialog_command_file"
echo "Dialog: $dcommand"
fi
}
checkCmdOutput () {
# $1: cmdOutput
local cmdOutput="$1"
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
}
# Check the currently logged in user
currentUser=$(stat -f "%Su" /dev/console)
if [ -z "$currentUser" ] || [ "$currentUser" = "loginwindow" ] || [ "$currentUser" = "_mbsetupuser" ] || [ "$currentUser" = "root" ]; then
echo "ERROR. Logged in user is $currentUser! Cannot proceed."
exit 97
fi
# Get the current user's UID for dockutil
uid=$(id -u "$currentUser")
# Find the home folder of the user
userHome="$(dscl . -read /users/${currentUser} NFSHomeDirectory | awk '{print $2}')"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Mark: Installation begins
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then
echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion."
echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)."
installomatorNotify="NOTIFY=all"
else
installomatorNotify="NOTIFY=silent"
# check for Swift Dialog
if [[ ! -d $dialogApp ]]; then
echo "Cannot find dialog at $dialogApp"
# Install using Installlomator
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
checkCmdOutput $cmdOutput
fi
# Configure and display swiftDialog
itemName=$( ${destFile} ${item} RETURN_LABEL_NAME=1 LOGGING=REQ INSTALL=force | tail -1 || true )
if [[ "$itemName" != "#" ]]; then
message="Installing ${itemName}"
else
message="Installing ${item}"
fi
echo "$item $itemName"
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
echo "icon before check: $icon"
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
echo "icon looks to be web-link"
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
echo "ERROR: Cannot download link. Reset icon."
icon=""
fi
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
echo "icon looks to be a file"
if [[ ! -a "${icon}" ]]; then
echo "ERROR: Cannot find file. Reset icon."
icon=""
fi
else
echo "ERROR: Cannot figure out icon. Reset icon."
icon=""
fi
echo "icon after first check: $icon"
# If no icon defined we are trying to search for installed app icon
if [[ "$icon" == "" ]]; then
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
appIcon=$(defaults read "${appPath}/Contents/Info.plist" CFBundleIconFile || true)
if [[ "$(echo "$appIcon" | grep -io ".icns")" == "" ]]; then
appIcon="${appIcon}.icns"
fi
icon="${appPath}/Contents/Resources/${appIcon}"
echo "Icon before file check: ${icon}"
if [ ! -f "${icon}" ]; then
# Using LOGO variable to show logo in swiftDialog
case $LOGO in
appstore)
# Apple App Store on Mac
if [[ $(sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
;;
jamf)
# Jamf Pro
LOGO_PATH="/Library/Application Support/JAMF/Jamf.app/Contents/Resources/AppIcon.icns"
;;
mosyleb)
# Mosyle Business
LOGO_PATH="/Applications/Self-Service.app/Contents/Resources/AppIcon.icns"
;;
mosylem)
# Mosyle Manager (education)
LOGO_PATH="/Applications/Manager.app/Contents/Resources/AppIcon.icns"
;;
addigy)
# Addigy
LOGO_PATH="/Library/Addigy/macmanage/MacManage.app/Contents/Resources/atom.icns"
;;
microsoft)
# Microsoft Endpoint Manager (Intune)
LOGO_PATH="/Library/Intune/Microsoft Intune Agent.app/Contents/Resources/AppIcon.icns"
;;
ws1)
# Workspace ONE (AirWatch)
LOGO="/Applications/Workspace ONE Intelligent Hub.app/Contents/Resources/AppIcon.icns"
;;
esac
if [[ ! -a "${LOGO_PATH}" ]]; then
printlog "ERROR in LOGO_PATH '${LOGO_PATH}', setting Mac App Store."
if [[ $(/usr/bin/sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
fi
icon="${LOGO_PATH}"
fi
fi
echo "LOGO: $LOGO"
echo "icon: ${icon}"
# display first screen
open -a "$dialogApp" --args \
--title none \
--icon "$icon" \
--message "$message" \
--mini \
--progress 100 \
--position bottomright \
--movable \
--commandfile "$dialog_command_file"
# give everything a moment to catch up
sleep 0.1
fi
# Install software using Installomator with valuesfromarguments
cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \
name=${name} \
type=${type} \
packageID=${packageID} \
downloadURL=\"$downloadURL\" \
appNewVersion=${appNewVersion} \
versionKey=${versionKey} \
expectedTeamID=${expectedTeamID} \
${installomatorOptions} ${installomatorNotify} || true)"
checkCmdOutput $cmdOutput
# Mark: dockutil stuff
if [[ $addToDock -eq 1 ]]; then
dialogUpdate "progresstext: Adding to Dock"
if [[ ! -d $dockutil ]]; then
echo "Cannot find dockutil at $dockutil, trying installation"
# Install using Installlomator
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
checkCmdOutput $cmdOutput
fi
echo "Adding to Dock"
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
sleep 1
else
echo "Not adding to Dock."
fi
# Mark: Ending
if [[ $installomatorVersion -lt 10 ]]; then
echo "Again skipping Dialog stuff."
else
# close and quit dialog
dialogUpdate "progress: complete"
dialogUpdate "progresstext: Done"
# pause a moment
sleep 0.5
dialogUpdate "quit:"
# let everything catch up
sleep 0.5
# just to be safe
#killall "Dialog" 2>/dev/null || true
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -1,293 +0,0 @@
#!/bin/sh
# Installation using Installomator with Dialog showing progress (and posibility of adding to the Dock)
# Installation of software using `valuesfromarguments` to install a custom software using Installomator
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
#item="" # enter the software to install (if it has a label in future version of Installomator)
# Variables for label
name="ClickShare"
type="appInDmgInZip"
packageID=""
downloadURL="https://www.barco.com$( curl -fs "https://www.barco.com/en/clickshare/app" | grep -A6 -i "macos" | grep -i "FileNumber" | tr '"' "\n" | grep -i "FileNumber" )"
appNewVersion="$(eval "$( echo $downloadURL | sed -E 's/.*(MajorVersion.*BuildVersion=[0-9]*).*/\1/' | sed 's/&amp//g' )" ; ((MajorVersion++)) ; ((MajorVersion--)); ((MinorVersion++)) ; ((MinorVersion--)); ((PatchVersion++)) ; ((PatchVersion--)); ((BuildVersion++)) ; ((BuildVersion--)); echo "${MajorVersion}.${MinorVersion}.${PatchVersion}-b${BuildVersion}")"
versionKey=""
expectedTeamID="P6CDJZR997"
# Dialog icon
icon=""
# icon should be a file system path or an URL to an online PNG.
# In Mosyle an URL can be found by copy picture address from a Custom Command icon.
# dockutil variables
addToDock="1" # with dockutil after installation (0 if not)
appPath="/Applications/$name.app"
# Other variables
dialog_command_file="/var/tmp/dialog.log"
dialogApp="/Library/Application Support/Dialog/Dialog.app"
dockutil="/usr/local/bin/dockutil"
installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user DIALOG_CMD_FILE=${dialog_command_file}" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 10.0.2 : Improved icon checks and failovers
# v. 10.0.1 : Improved appIcon handling. Can add the app to Dock using dockutil
# v. 10.0 : Integration with Dialog and Installomator v. 10
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
dialogUpdate() {
# $1: dialog command
local dcommand="$1"
if [[ -n $dialog_command_file ]]; then
echo "$dcommand" >> "$dialog_command_file"
echo "Dialog: $dcommand"
fi
}
checkCmdOutput () {
# $1: cmdOutput
local cmdOutput="$1"
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
}
# Check the currently logged in user
currentUser=$(stat -f "%Su" /dev/console)
if [ -z "$currentUser" ] || [ "$currentUser" = "loginwindow" ] || [ "$currentUser" = "_mbsetupuser" ] || [ "$currentUser" = "root" ]; then
echo "ERROR. Logged in user is $currentUser! Cannot proceed."
exit 97
fi
# Get the current user's UID for dockutil
uid=$(id -u "$currentUser")
# Find the home folder of the user
userHome="$(dscl . -read /users/${currentUser} NFSHomeDirectory | awk '{print $2}')"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Mark: Installation begins
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then
echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion."
echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)."
installomatorNotify="NOTIFY=all"
else
installomatorNotify="NOTIFY=silent"
# check for Swift Dialog
if [[ ! -d $dialogApp ]]; then
echo "Cannot find dialog at $dialogApp"
# Install using Installlomator
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
checkCmdOutput $cmdOutput
fi
# Configure and display swiftDialog
itemName=$( ${destFile} ${item} RETURN_LABEL_NAME=1 LOGGING=REQ INSTALL=force | tail -1 || true )
if [[ "$itemName" != "#" ]]; then
message="Installing ${itemName}"
else
message="Installing ${item}"
fi
echo "$item $itemName"
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
echo "icon before check: $icon"
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
echo "icon looks to be web-link"
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
echo "ERROR: Cannot download link. Reset icon."
icon=""
fi
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
echo "icon looks to be a file"
if [[ ! -a "${icon}" ]]; then
echo "ERROR: Cannot find file. Reset icon."
icon=""
fi
else
echo "ERROR: Cannot figure out icon. Reset icon."
icon=""
fi
echo "icon after first check: $icon"
# If no icon defined we are trying to search for installed app icon
if [[ "$icon" == "" ]]; then
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
appIcon=$(defaults read "${appPath}/Contents/Info.plist" CFBundleIconFile || true)
if [[ "$(echo "$appIcon" | grep -io ".icns")" == "" ]]; then
appIcon="${appIcon}.icns"
fi
icon="${appPath}/Contents/Resources/${appIcon}"
echo "Icon before file check: ${icon}"
if [ ! -f "${icon}" ]; then
# Using LOGO variable to show logo in swiftDialog
case $LOGO in
appstore)
# Apple App Store on Mac
if [[ $(sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
;;
jamf)
# Jamf Pro
LOGO_PATH="/Library/Application Support/JAMF/Jamf.app/Contents/Resources/AppIcon.icns"
;;
mosyleb)
# Mosyle Business
LOGO_PATH="/Applications/Self-Service.app/Contents/Resources/AppIcon.icns"
;;
mosylem)
# Mosyle Manager (education)
LOGO_PATH="/Applications/Manager.app/Contents/Resources/AppIcon.icns"
;;
addigy)
# Addigy
LOGO_PATH="/Library/Addigy/macmanage/MacManage.app/Contents/Resources/atom.icns"
;;
microsoft)
# Microsoft Endpoint Manager (Intune)
LOGO_PATH="/Library/Intune/Microsoft Intune Agent.app/Contents/Resources/AppIcon.icns"
;;
ws1)
# Workspace ONE (AirWatch)
LOGO="/Applications/Workspace ONE Intelligent Hub.app/Contents/Resources/AppIcon.icns"
;;
esac
if [[ ! -a "${LOGO_PATH}" ]]; then
printlog "ERROR in LOGO_PATH '${LOGO_PATH}', setting Mac App Store."
if [[ $(/usr/bin/sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
fi
icon="${LOGO_PATH}"
fi
fi
echo "LOGO: $LOGO"
echo "icon: ${icon}"
# display first screen
open -a "$dialogApp" --args \
--title none \
--icon "$icon" \
--message "$message" \
--mini \
--progress 100 \
--position bottomright \
--movable \
--commandfile "$dialog_command_file"
# give everything a moment to catch up
sleep 0.1
fi
# Install software using Installomator with valuesfromarguments
cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \
name=${name} \
type=${type} \
packageID=${packageID} \
downloadURL=\"$downloadURL\" \
appNewVersion=${appNewVersion} \
versionKey=${versionKey} \
expectedTeamID=${expectedTeamID} \
${installomatorOptions} ${installomatorNotify} || true)"
checkCmdOutput $cmdOutput
# Mark: dockutil stuff
if [[ $addToDock -eq 1 ]]; then
dialogUpdate "progresstext: Adding to Dock"
if [[ ! -d $dockutil ]]; then
echo "Cannot find dockutil at $dockutil, trying installation"
# Install using Installlomator
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
checkCmdOutput $cmdOutput
fi
echo "Adding to Dock"
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
sleep 1
else
echo "Not adding to Dock."
fi
# Mark: Ending
if [[ $installomatorVersion -lt 10 ]]; then
echo "Again skipping Dialog stuff."
else
# close and quit dialog
dialogUpdate "progress: complete"
dialogUpdate "progresstext: Done"
# pause a moment
sleep 0.5
dialogUpdate "quit:"
# let everything catch up
sleep 0.5
# just to be safe
#killall "Dialog" 2>/dev/null || true
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -1,275 +0,0 @@
#!/bin/sh
# Installation using Installomator with Dialog showing progress (and posibility of adding to the Dock)
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
item="" # enter the software to install
# Examples: brave, duckduckgo, firefoxpkg, googlechromepkg, microsoftedge, opera
# Dialog icon
icon=""
# icon should be a file system path or an URL to an online PNG.
# In Mosyle an URL can be found by copy picture address from a Custom Command icon.
# dockutil variables
addToDock="1" # with dockutil after installation (0 if not)
appPath="/Applications/Firefox.app"
# Other variables
dialog_command_file="/var/tmp/dialog.log"
dialogApp="/Library/Application Support/Dialog/Dialog.app"
dockutil="/usr/local/bin/dockutil"
installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user_then_quit DIALOG_CMD_FILE=${dialog_command_file}" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 10.0.2 : Improved icon checks and failovers
# v. 10.0.1 : Improved appIcon handling. Can add the app to Dock using dockutil
# v. 10.0 : Integration with Dialog and Installomator v. 10
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
dialogUpdate() {
# $1: dialog command
local dcommand="$1"
if [[ -n $dialog_command_file ]]; then
echo "$dcommand" >> "$dialog_command_file"
echo "Dialog: $dcommand"
fi
}
checkCmdOutput () {
# $1: cmdOutput
local cmdOutput="$1"
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
}
# Check the currently logged in user
currentUser=$(stat -f "%Su" /dev/console)
if [ -z "$currentUser" ] || [ "$currentUser" = "loginwindow" ] || [ "$currentUser" = "_mbsetupuser" ] || [ "$currentUser" = "root" ]; then
echo "ERROR. Logged in user is $currentUser! Cannot proceed."
exit 97
fi
# Get the current user's UID for dockutil
uid=$(id -u "$currentUser")
# Find the home folder of the user
userHome="$(dscl . -read /users/${currentUser} NFSHomeDirectory | awk '{print $2}')"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Mark: Installation begins
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then
echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion."
echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)."
installomatorNotify="NOTIFY=all"
else
installomatorNotify="NOTIFY=silent"
# check for Swift Dialog
if [[ ! -d $dialogApp ]]; then
echo "Cannot find dialog at $dialogApp"
# Install using Installlomator
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
checkCmdOutput $cmdOutput
fi
# Configure and display swiftDialog
itemName=$( ${destFile} ${item} RETURN_LABEL_NAME=1 LOGGING=REQ INSTALL=force | tail -1 || true )
if [[ "$itemName" != "#" ]]; then
message="Installing ${itemName}"
else
message="Installing ${item}"
fi
echo "$item $itemName"
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
echo "icon before check: $icon"
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
echo "icon looks to be web-link"
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
echo "ERROR: Cannot download link. Reset icon."
icon=""
fi
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
echo "icon looks to be a file"
if [[ ! -a "${icon}" ]]; then
echo "ERROR: Cannot find file. Reset icon."
icon=""
fi
else
echo "ERROR: Cannot figure out icon. Reset icon."
icon=""
fi
echo "icon after first check: $icon"
# If no icon defined we are trying to search for installed app icon
if [[ "$icon" == "" ]]; then
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
appIcon=$(defaults read "${appPath}/Contents/Info.plist" CFBundleIconFile || true)
if [[ "$(echo "$appIcon" | grep -io ".icns")" == "" ]]; then
appIcon="${appIcon}.icns"
fi
icon="${appPath}/Contents/Resources/${appIcon}"
echo "Icon before file check: ${icon}"
if [ ! -f "${icon}" ]; then
# Using LOGO variable to show logo in swiftDialog
case $LOGO in
appstore)
# Apple App Store on Mac
if [[ $(sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
;;
jamf)
# Jamf Pro
LOGO_PATH="/Library/Application Support/JAMF/Jamf.app/Contents/Resources/AppIcon.icns"
;;
mosyleb)
# Mosyle Business
LOGO_PATH="/Applications/Self-Service.app/Contents/Resources/AppIcon.icns"
;;
mosylem)
# Mosyle Manager (education)
LOGO_PATH="/Applications/Manager.app/Contents/Resources/AppIcon.icns"
;;
addigy)
# Addigy
LOGO_PATH="/Library/Addigy/macmanage/MacManage.app/Contents/Resources/atom.icns"
;;
microsoft)
# Microsoft Endpoint Manager (Intune)
LOGO_PATH="/Library/Intune/Microsoft Intune Agent.app/Contents/Resources/AppIcon.icns"
;;
ws1)
# Workspace ONE (AirWatch)
LOGO="/Applications/Workspace ONE Intelligent Hub.app/Contents/Resources/AppIcon.icns"
;;
esac
if [[ ! -a "${LOGO_PATH}" ]]; then
printlog "ERROR in LOGO_PATH '${LOGO_PATH}', setting Mac App Store."
if [[ $(/usr/bin/sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
fi
icon="${LOGO_PATH}"
fi
fi
echo "LOGO: $LOGO"
echo "icon: ${icon}"
# display first screen
open -a "$dialogApp" --args \
--title none \
--icon "$icon" \
--message "$message" \
--mini \
--progress 100 \
--position bottomright \
--movable \
--commandfile "$dialog_command_file"
# give everything a moment to catch up
sleep 0.1
fi
# Install software using Installomator
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)"
checkCmdOutput $cmdOutput
# Mark: dockutil stuff
if [[ $addToDock -eq 1 ]]; then
dialogUpdate "progresstext: Adding to Dock"
if [[ ! -d $dockutil ]]; then
echo "Cannot find dockutil at $dockutil, trying installation"
# Install using Installlomator
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
checkCmdOutput $cmdOutput
fi
echo "Adding to Dock"
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
sleep 1
else
echo "Not adding to Dock."
fi
# Mark: Ending
if [[ $installomatorVersion -lt 10 ]]; then
echo "Again skipping Dialog stuff."
else
# close and quit dialog
dialogUpdate "progress: complete"
dialogUpdate "progresstext: Done"
# pause a moment
sleep 0.5
dialogUpdate "quit:"
# let everything catch up
sleep 0.5
# just to be safe
#killall "Dialog" 2>/dev/null || true
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -1,278 +0,0 @@
#!/bin/sh
# Installation using Installomator with Dialog showing progress (and posibility of adding to the Dock)
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
item="microsoftoffice365" # enter the software to install
# Examples: microsoftofficebusinesspro, microsoftoffice365
# Dialog icon
icon=""
# icon should be a file system path or an URL to an online PNG.
# In Mosyle an URL can be found by copy picture address from a Custom Command icon.
# dockutil variables
addToDock="1" # with dockutil after installation (0 if not)
appPaths=("/Applications/Microsoft Outlook.app" "/Applications/Microsoft Word.app" "/Applications/Microsoft Excel.app" "/Applications/Microsoft PowerPoint.app" "/Applications/Microsoft OneNote.app")
# Other variables
dialog_command_file="/var/tmp/dialog.log"
dialogApp="/Library/Application Support/Dialog/Dialog.app"
dockutil="/usr/local/bin/dockutil"
installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user DIALOG_CMD_FILE=${dialog_command_file}" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 10.0.2 : Improved icon checks and failovers
# v. 10.0.1 : Improved appIcon handling. Can add the app to Dock using dockutil
# v. 10.0 : Integration with Dialog and Installomator v. 10
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
dialogUpdate() {
# $1: dialog command
local dcommand="$1"
if [[ -n $dialog_command_file ]]; then
echo "$dcommand" >> "$dialog_command_file"
echo "Dialog: $dcommand"
fi
}
checkCmdOutput () {
# $1: cmdOutput
local cmdOutput="$1"
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
}
# Check the currently logged in user
currentUser=$(stat -f "%Su" /dev/console)
if [ -z "$currentUser" ] || [ "$currentUser" = "loginwindow" ] || [ "$currentUser" = "_mbsetupuser" ] || [ "$currentUser" = "root" ]; then
echo "ERROR. Logged in user is $currentUser! Cannot proceed."
exit 97
fi
# Get the current user's UID for dockutil
uid=$(id -u "$currentUser")
# Find the home folder of the user
userHome="$(dscl . -read /users/${currentUser} NFSHomeDirectory | awk '{print $2}')"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Mark: Installation begins
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then
echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion."
echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)."
installomatorNotify="NOTIFY=all"
else
installomatorNotify="NOTIFY=silent"
# check for Swift Dialog
if [[ ! -d $dialogApp ]]; then
echo "Cannot find dialog at $dialogApp"
# Install using Installlomator
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
checkCmdOutput $cmdOutput
fi
# Configure and display swiftDialog
itemName=$( ${destFile} ${item} RETURN_LABEL_NAME=1 LOGGING=REQ INSTALL=force | tail -1 || true )
if [[ "$itemName" != "#" ]]; then
message="Installing ${itemName}"
else
message="Installing ${item}"
fi
echo "$item $itemName"
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
echo "icon before check: $icon"
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
echo "icon looks to be web-link"
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
echo "ERROR: Cannot download link. Reset icon."
icon=""
fi
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
echo "icon looks to be a file"
if [[ ! -a "${icon}" ]]; then
echo "ERROR: Cannot find file. Reset icon."
icon=""
fi
else
echo "ERROR: Cannot figure out icon. Reset icon."
icon=""
fi
echo "icon after first check: $icon"
# If no icon defined we are trying to search for installed app icon
if [[ "$icon" == "" ]]; then
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
appIcon=$(defaults read "${appPath}/Contents/Info.plist" CFBundleIconFile || true)
if [[ "$(echo "$appIcon" | grep -io ".icns")" == "" ]]; then
appIcon="${appIcon}.icns"
fi
icon="${appPath}/Contents/Resources/${appIcon}"
echo "Icon before file check: ${icon}"
if [ ! -f "${icon}" ]; then
# Using LOGO variable to show logo in swiftDialog
case $LOGO in
appstore)
# Apple App Store on Mac
if [[ $(sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
;;
jamf)
# Jamf Pro
LOGO_PATH="/Library/Application Support/JAMF/Jamf.app/Contents/Resources/AppIcon.icns"
;;
mosyleb)
# Mosyle Business
LOGO_PATH="/Applications/Self-Service.app/Contents/Resources/AppIcon.icns"
;;
mosylem)
# Mosyle Manager (education)
LOGO_PATH="/Applications/Manager.app/Contents/Resources/AppIcon.icns"
;;
addigy)
# Addigy
LOGO_PATH="/Library/Addigy/macmanage/MacManage.app/Contents/Resources/atom.icns"
;;
microsoft)
# Microsoft Endpoint Manager (Intune)
LOGO_PATH="/Library/Intune/Microsoft Intune Agent.app/Contents/Resources/AppIcon.icns"
;;
ws1)
# Workspace ONE (AirWatch)
LOGO="/Applications/Workspace ONE Intelligent Hub.app/Contents/Resources/AppIcon.icns"
;;
esac
if [[ ! -a "${LOGO_PATH}" ]]; then
printlog "ERROR in LOGO_PATH '${LOGO_PATH}', setting Mac App Store."
if [[ $(/usr/bin/sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
fi
icon="${LOGO_PATH}"
fi
fi
echo "LOGO: $LOGO"
echo "icon: ${icon}"
# display first screen
open -a "$dialogApp" --args \
--title none \
--icon "$icon" \
--message "$message" \
--mini \
--progress 100 \
--position bottomright \
--movable \
--commandfile "$dialog_command_file"
# give everything a moment to catch up
sleep 0.1
fi
# Install software using Installomator
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)"
checkCmdOutput $cmdOutput
# Mark: dockutil stuff
if [[ $addToDock -eq 1 ]]; then
dialogUpdate "progresstext: Adding to Dock"
if [[ ! -d $dockutil ]]; then
echo "Cannot find dockutil at $dockutil, trying installation"
# Install using Installlomator
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
checkCmdOutput $cmdOutput
fi
echo "Adding to Dock"
for appPath in "${appPaths[@]}"; do
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" --no-restart || true
done
$dockutil --add "/AppThatDoesNotExistAnywhereOnDiskButMakingDockutilRestartTheDock" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
sleep 1
else
echo "Not adding to Dock."
fi
# Mark: Ending
if [[ $installomatorVersion -lt 10 ]]; then
echo "Again skipping Dialog stuff."
else
# close and quit dialog
dialogUpdate "progress: complete"
dialogUpdate "progresstext: Done"
# pause a moment
sleep 0.5
dialogUpdate "quit:"
# let everything catch up
sleep 0.5
# just to be safe
#killall "Dialog" 2>/dev/null || true
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -1,272 +0,0 @@
#!/bin/sh
# Installation using Installomator with Dialog showing progress (and posibility of adding to the Dock)
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
item="" # enter the software to install
# Examples: adobecreativeclouddesktop, canva, cyberduck, handbrake, inkscape, textmate, vlc
# Dialog icon
icon=""
# icon should be a file system path or an URL to an online PNG, so beginning with either “/” or “http”.
# In Mosyle an URL can be found by copy picture address from a Custom Command icon.
# dockutil variables
addToDock="0" # with dockutil after installation (0 if not)
appPath="/Applications/Cyberduck.app"
# Other variables
dialog_command_file="/var/tmp/dialog.log"
dialogApp="/Library/Application Support/Dialog/Dialog.app"
dockutil="/usr/local/bin/dockutil"
installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user DIALOG_CMD_FILE=${dialog_command_file}" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 10.0.2 : Improved icon checks and failovers
# v. 10.0.1 : Improved appIcon handling. Can add the app to Dock using dockutil
# v. 10.0 : Integration with Dialog and Installomator v. 10
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
dialogUpdate() {
# $1: dialog command
local dcommand="$1"
if [[ -n $dialog_command_file ]]; then
echo "$dcommand" >> "$dialog_command_file"
echo "Dialog: $dcommand"
fi
}
checkCmdOutput () {
# $1: cmdOutput
local cmdOutput="$1"
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
}
# Check the currently logged in user
currentUser=$(stat -f "%Su" /dev/console)
if [ -z "$currentUser" ] || [ "$currentUser" = "loginwindow" ] || [ "$currentUser" = "_mbsetupuser" ] || [ "$currentUser" = "root" ]; then
echo "ERROR. Logged in user is $currentUser! Cannot proceed."
exit 97
fi
# Get the current user's UID for dockutil
uid=$(id -u "$currentUser")
# Find the home folder of the user
userHome="$(dscl . -read /users/${currentUser} NFSHomeDirectory | awk '{print $2}')"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Mark: Installation begins
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then
echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion."
echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)."
installomatorNotify="NOTIFY=all"
else
installomatorNotify="NOTIFY=silent"
# check for Swift Dialog
if [[ ! -d $dialogApp ]]; then
echo "Cannot find dialog at $dialogApp"
# Install using Installlomator
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
checkCmdOutput $cmdOutput
fi
# Configure and display swiftDialog
itemName=$( ${destFile} ${item} RETURN_LABEL_NAME=1 LOGGING=REQ INSTALL=force | tail -1 || true )
if [[ "$itemName" != "#" ]]; then
message="Installing ${itemName}"
else
message="Installing ${item}"
fi
echo "$item $itemName"
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
echo "icon before check: $icon"
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
echo "icon looks to be web-link"
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
echo "ERROR: Cannot download link. Reset icon."
icon=""
fi
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
echo "icon looks to be a file"
if [[ ! -a "${icon}" ]]; then
echo "ERROR: Cannot find file. Reset icon."
icon=""
fi
else
echo "ERROR: Cannot figure out icon. Reset icon."
icon=""
fi
echo "icon after first check: $icon"
# If no icon defined we are trying to search for installed app icon
if [[ "$icon" == "" ]]; then
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
appIcon=$(defaults read "${appPath}/Contents/Info.plist" CFBundleIconFile || true)
if [[ "$(echo "$appIcon" | grep -io ".icns")" == "" ]]; then
appIcon="${appIcon}.icns"
fi
icon="${appPath}/Contents/Resources/${appIcon}"
echo "Icon before file check: ${icon}"
if [ ! -f "${icon}" ]; then
# Using LOGO variable to show logo in swiftDialog
case $LOGO in
appstore)
# Apple App Store on Mac
if [[ $(sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
;;
jamf)
# Jamf Pro
LOGO_PATH="/Library/Application Support/JAMF/Jamf.app/Contents/Resources/AppIcon.icns"
;;
mosyleb)
# Mosyle Business
LOGO_PATH="/Applications/Self-Service.app/Contents/Resources/AppIcon.icns"
;;
mosylem)
# Mosyle Manager (education)
LOGO_PATH="/Applications/Manager.app/Contents/Resources/AppIcon.icns"
;;
addigy)
# Addigy
LOGO_PATH="/Library/Addigy/macmanage/MacManage.app/Contents/Resources/atom.icns"
;;
microsoft)
# Microsoft Endpoint Manager (Intune)
LOGO_PATH="/Library/Intune/Microsoft Intune Agent.app/Contents/Resources/AppIcon.icns"
;;
ws1)
# Workspace ONE (AirWatch)
LOGO="/Applications/Workspace ONE Intelligent Hub.app/Contents/Resources/AppIcon.icns"
;;
esac
if [[ ! -a "${LOGO_PATH}" ]]; then
printlog "ERROR in LOGO_PATH '${LOGO_PATH}', setting Mac App Store."
if [[ $(/usr/bin/sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
fi
icon="${LOGO_PATH}"
fi
fi
echo "LOGO: $LOGO"
echo "icon: ${icon}"
# display first screen
open -a "$dialogApp" --args \
--title none \
--icon "$icon" \
--message "$message" \
--mini \
--progress 100 \
--position bottomright \
--movable \
--commandfile "$dialog_command_file"
# give everything a moment to catch up
sleep 0.1
fi
# Install software using Installomator
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)"
checkCmdOutput $cmdOutput
# Mark: dockutil stuff
if [[ $addToDock -eq 1 ]]; then
dialogUpdate "progresstext: Adding to Dock"
if [[ ! -d $dockutil ]]; then
echo "Cannot find dockutil at $dockutil, trying installation"
# Install using Installlomator
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
checkCmdOutput $cmdOutput
fi
echo "Adding to Dock"
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
sleep 1
else
echo "Not adding to Dock."
fi
# Mark: Ending
if [[ $installomatorVersion -lt 10 ]]; then
echo "Again skipping Dialog stuff."
else
# close and quit dialog
dialogUpdate "progress: complete"
dialogUpdate "progresstext: Done"
# pause a moment
sleep 0.5
dialogUpdate "quit:"
# let everything catch up
sleep 0.5
# just to be safe
#killall "Dialog" 2>/dev/null || true
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -1,275 +0,0 @@
#!/bin/sh
# Installation using Installomator
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
item="" # enter the software to install
# Examples: applenyfonts, applesfarabic, applesfcompact, applesfmono, applesfpro, applesfsymbols, desktoppr, dialog, dockutil, knockknock, lulu, nomad, nudge, shield, supportapp, wordservice, xcreds, xink
# Dialog icon
icon=""
# icon should be a file system path or an URL to an online PNG.
# In Mosyle an URL can be found by copy picture address from a Custom Command icon.
# dockutil variables
addToDock="1" # with dockutil after installation (0 if not)
appPath="/Applications/Xink.app"
# Other variables
dialog_command_file="/var/tmp/dialog.log"
dialogApp="/Library/Application Support/Dialog/Dialog.app"
dockutil="/usr/local/bin/dockutil"
installomatorOptions="BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent DIALOG_CMD_FILE=${dialog_command_file}" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 10.0.2 : Improved icon checks and failovers
# v. 10.0.1 : Can add the app to Dock using dockutil
# v. 10.0 : Integration with Dialog and Installomator v. 10
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
dialogUpdate() {
# $1: dialog command
local dcommand="$1"
if [[ -n $dialog_command_file ]]; then
echo "$dcommand" >> "$dialog_command_file"
echo "Dialog: $dcommand"
fi
}
checkCmdOutput () {
# $1: cmdOutput
local cmdOutput="$1"
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
}
# Check the currently logged in user
currentUser=$(stat -f "%Su" /dev/console)
if [ -z "$currentUser" ] || [ "$currentUser" = "loginwindow" ] || [ "$currentUser" = "_mbsetupuser" ] || [ "$currentUser" = "root" ]; then
echo "ERROR. Logged in user is $currentUser! Cannot proceed."
exit 97
fi
# Get the current user's UID for dockutil
uid=$(id -u "$currentUser")
# Find the home folder of the user
userHome="$(dscl . -read /users/${currentUser} NFSHomeDirectory | awk '{print $2}')"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Mark: Installation begins
installomatorVersion="$(${destFile} version | cut -d "." -f1 || true)"
if [[ $installomatorVersion -lt 10 ]] || [[ $(sw_vers -buildVersion) < "20A" ]]; then
echo "Installomator should be at least version 10 to support Dialog. Installed version $installomatorVersion."
echo "And macOS 11 Big Sur (build 20A) is required for Dialog. Installed build $(sw_vers -buildVersion)."
installomatorNotify="NOTIFY=all"
else
installomatorNotify="NOTIFY=silent"
# check for Swift Dialog
if [[ ! -d $dialogApp ]]; then
echo "Cannot find dialog at $dialogApp"
# Install using Installlomator
cmdOutput="$(${destFile} dialog LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
checkCmdOutput $cmdOutput
fi
# Configure and display swiftDialog
itemName=$( ${destFile} ${item} RETURN_LABEL_NAME=1 LOGGING=REQ INSTALL=force | tail -1 || true )
if [[ "$itemName" != "#" ]]; then
message="Installing ${itemName}"
else
message="Installing ${item}"
fi
echo "$item $itemName"
#Check icon (expecting beginning with “http” to be web-link and “/” to be disk file)
echo "icon before check: $icon"
if [[ "$(echo ${icon} | grep -iE "^(http|ftp).*")" != "" ]]; then
echo "icon looks to be web-link"
if ! curl -sfL --output /dev/null -r 0-0 "${icon}" ; then
echo "ERROR: Cannot download link. Reset icon."
icon=""
fi
elif [[ "$(echo ${icon} | grep -iE "^\/.*")" != "" ]]; then
echo "icon looks to be a file"
if [[ ! -a "${icon}" ]]; then
echo "ERROR: Cannot find file. Reset icon."
icon=""
fi
else
echo "ERROR: Cannot figure out icon. Reset icon."
icon=""
fi
echo "icon after first check: $icon"
# If no icon defined we are trying to search for installed app icon
if [[ "$icon" == "" ]]; then
appPath=$(mdfind "kind:application AND name:$itemName" | head -1 || true)
appIcon=$(defaults read "${appPath}/Contents/Info.plist" CFBundleIconFile || true)
if [[ "$(echo "$appIcon" | grep -io ".icns")" == "" ]]; then
appIcon="${appIcon}.icns"
fi
icon="${appPath}/Contents/Resources/${appIcon}"
echo "Icon before file check: ${icon}"
if [ ! -f "${icon}" ]; then
# Using LOGO variable to show logo in swiftDialog
case $LOGO in
appstore)
# Apple App Store on Mac
if [[ $(sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
;;
jamf)
# Jamf Pro
LOGO_PATH="/Library/Application Support/JAMF/Jamf.app/Contents/Resources/AppIcon.icns"
;;
mosyleb)
# Mosyle Business
LOGO_PATH="/Applications/Self-Service.app/Contents/Resources/AppIcon.icns"
;;
mosylem)
# Mosyle Manager (education)
LOGO_PATH="/Applications/Manager.app/Contents/Resources/AppIcon.icns"
;;
addigy)
# Addigy
LOGO_PATH="/Library/Addigy/macmanage/MacManage.app/Contents/Resources/atom.icns"
;;
microsoft)
# Microsoft Endpoint Manager (Intune)
LOGO_PATH="/Library/Intune/Microsoft Intune Agent.app/Contents/Resources/AppIcon.icns"
;;
ws1)
# Workspace ONE (AirWatch)
LOGO="/Applications/Workspace ONE Intelligent Hub.app/Contents/Resources/AppIcon.icns"
;;
esac
if [[ ! -a "${LOGO_PATH}" ]]; then
printlog "ERROR in LOGO_PATH '${LOGO_PATH}', setting Mac App Store."
if [[ $(/usr/bin/sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
fi
icon="${LOGO_PATH}"
fi
fi
echo "LOGO: $LOGO"
echo "icon: ${icon}"
# display first screen
open -a "$dialogApp" --args \
--title none \
--icon "$icon" \
--message "$message" \
--mini \
--progress 100 \
--position bottomright \
--movable \
--commandfile "$dialog_command_file"
# give everything a moment to catch up
sleep 0.1
fi
# Install software using Installomator
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} ${installomatorNotify} || true)"
checkCmdOutput $cmdOutput
# Mark: dockutil stuff
if [[ $addToDock -eq 1 ]]; then
dialogUpdate "progresstext: Adding to Dock"
if [[ ! -d $dockutil ]]; then
echo "Cannot find dockutil at $dockutil, trying installation"
# Install using Installlomator
cmdOutput="$(${destFile} dockutil LOGO=$LOGO BLOCKING_PROCESS_ACTION=ignore LOGGING=REQ NOTIFY=silent || true)"
checkCmdOutput $cmdOutput
fi
echo "Adding to Dock"
$dockutil --add "${appPath}" "${userHome}/Library/Preferences/com.apple.dock.plist" || true
sleep 1
else
echo "Not adding to Dock."
fi
# Mark: Ending
if [[ $installomatorVersion -lt 10 ]]; then
echo "Again skipping Dialog stuff."
else
# close and quit dialog
dialogUpdate "progress: complete"
dialogUpdate "progresstext: Done"
# pause a moment
sleep 0.5
dialogUpdate "quit:"
# let everything catch up
sleep 0.5
# just to be safe
#killall "Dialog" 2>/dev/null || true
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -1,98 +0,0 @@
#!/bin/sh
# Installation using Installomator
# Installation of software using valuesfromarguments to install a custom software using Installomator
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
#item="" # enter the software to install (if it has a label in future version of Installomator)
# Variables for label
name="ClickShare"
type="appInDmgInZip"
packageID=""
downloadURL="https://www.barco.com$( curl -fs "https://www.barco.com/en/clickshare/app" | grep -A6 -i "macos" | grep -i "FileNumber" | tr '"' "\n" | grep -i "FileNumber" )"
appNewVersion="$(eval "$( echo $downloadURL | sed -E 's/.*(MajorVersion.*BuildVersion=[0-9]*).*/\1/' | sed 's/&amp//g' )" ; ((MajorVersion++)) ; ((MajorVersion--)); ((MinorVersion++)) ; ((MinorVersion--)); ((PatchVersion++)) ; ((PatchVersion--)); ((BuildVersion++)) ; ((BuildVersion--)); echo "${MajorVersion}.${MinorVersion}.${PatchVersion}-b${BuildVersion}")"
versionKey=""
expectedTeamID="P6CDJZR997"
installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user LOGGING=INFO NOTIFY=all" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "what" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $what"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Install software using Installomator with valuesfromarguments
cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \
name=\"${name}\" \
type=${type} \
packageID=${packageID} \
downloadURL=\"$downloadURL\" \
appNewVersion=${appNewVersion} \
versionKey=${versionKey} \
expectedTeamID=${expectedTeamID} \
blockingProcesses=\"NONE\" \
${installomatorOptions} || true)"
# Check result
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${what} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${what}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -1,79 +0,0 @@
#!/bin/sh
# Installation using Installomator
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
item="firefoxpkg" # enter the software to install
# Examples: brave, duckduckgo, firefoxpkg, googlechromepkg, microsoftedge, opera
installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user_then_quit" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Install software using Installomator
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
# Check result
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -1,79 +0,0 @@
#!/bin/sh
# Installation using Installomator
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
item="" # enter the software to install
# Examples: brave, duckduckgo, firefoxpkg, googlechromepkg, microsoftedge, opera
installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user_then_quit NOTIFY=all" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "what" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $what"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Install software using Installomator
cmdOutput="$(${destFile} ${what} LOGO=$LOGO ${installomatorOptions} || true)"
# Check result
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${what} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${what}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -1,79 +0,0 @@
#!/bin/sh
# Installation using Installomator
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
item="" # enter the software to install
# Examples: adobecreativeclouddesktop, textmate, vlc
installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Install software using Installomator
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
# Check result
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -1,80 +0,0 @@
#!/bin/sh
# Installation using Installomator
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
item="" # enter the software to install
# Examples: adobecreativeclouddesktop, canva, cyberduck, handbrake, inkscape, textmate, vlc
installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user NOTIFY=all" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Install software using Installomator
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
# Check result
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -1,79 +0,0 @@
#!/bin/sh
# Installation using Installomator
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
item="dockutil" # enter the software to install
# Examples: applenyfonts, applesfarabic, applesfcompact, applesfmono, applesfpro, applesfsymbols, desktoppr, dialog, dockutil, knockknock, lulu, nomad, nudge, shield, supportapp, wordservice, xcreds, xink
installomatorOptions="BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Install software using Installomator
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
# Check result
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

177
MDM/App-loop script.sh Executable file
View File

@@ -0,0 +1,177 @@
#!/bin/zsh
# Installation using Installomator
what="microsoftteams microsoftyammer firefox bravebrowser cyberduck vlc signal" # enter the software to install separated with spaces
# To be used as a script sent out from a MDM.
# Fill the variable "what" above with labels separated by space " ".
# Script will loop through these labels.
######################################################################
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Count errors
errorCount=0
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
caffexit 99
fi
for item in $what; do
#echo $item
${destFile} ${item} LOGO=mosyleb BLOCKING_PROCESS_ACTION=tell_user #NOTIFY=all #INSTALL=force
if [ $? != 0 ]; then
# This is currently not working in Mosyle, that will ignore script errors. Please request support for this from Mosyle!
echo "[$(DATE)] Error installing ${item}. Exit code $?"
let errorCount++
fi
done
echo
echo "Errors: $errorCount"
echo "[$(DATE)][LOG-END]"
caffexit $errorCount
# notify behavior
# NOTIFY=success
# options:
# - success notify the user on success
# - silent no notifications
# - all all notifications (great for Self Service installation)
# behavior when blocking processes are found
# BLOCKING_PROCESS_ACTION=tell_user
# options:
# - ignore continue even when blocking processes are found
# - quit app will be told to quit nicely, if running
# - quit_kill told to quit twice, then it will be killed
# Could be great for service apps, if they do not respawn
# - silent_fail exit script without prompt or installation
# - prompt_user show a user dialog for each blocking process found
# abort after three attempts to quit
# (only if user accepts to quit the apps, otherwise
# the update is cancelled).
# - prompt_user_then_kill
# show a user dialog for each blocking process found,
# attempt to quit two times, kill the process finally
# - prompt_user_loop
# Like prompt-user, but clicking "Not Now", will just wait an hour,
# and then it will ask again.
# WARNING! It might block the MDM agent on the machine, as
# the scripts gets stuct in waiting until the hour has passed,
# possibly blocking for other management actions in this time.
# - tell_user User will be showed a notification about the important update,
# but user is only allowed to quit and continue, and then we
# ask the app to quit.
# - tell_user_then_kill
# Show dialog 2 times, and if the quitting fails, the
# blocking processes will be killed.
# - kill kill process without prompting or giving the user a chance to save
# logo-icon used in dialog boxes if app is blocking
# LOGO=appstore
# options:
# - appstore Icon is Apple App Store (default)
# - jamf JAMF Pro
# - mosyleb Mosyle Business
# - mosylem Mosyle Manager (Education)
# - addigy Addigy
# path can also be set in the command call, and if file exists, it will be used.
# Like 'LOGO="/System/Applications/App\ Store.app/Contents/Resources/AppIcon.icns"'
# (spaces have to be escaped).
# App Store apps handling
# IGNORE_APP_STORE_APPS=no
# options:
# - no If installed app is from App Store (which include VPP installed apps)
# it will not be touched, no matter it's version (default)
# - yes Replace App Store (and VPP) version of app and handle future
# updates using Installomator, even if latest version.
# Shouldnt give any problems for the user in most cases.
# Known bad example: Slack will loose all settings.
# install behavior
# INSTALL=""
# options:
# - When not set, software will only be installed
# if it is newer/different in version
# - force Install even if its the same version
# Re-opening of closed app
# REOPEN="yes"
# options:
# - yes App wil be reopened if it was closed
# - no App not reopened
########################
# Often used labels:
########################
# firefox
# firefox_intl
# brave
# torbrowser
# googlechrome
# netnewswire
# adobereaderdc
# textmate
# cyberduck
# keka
# theunarchiver
# vlc
# handbrake
# inkscape
# signal
# telegram
# whatsapp
# hazel
# devonthink
# teamviewerqs
# zoom
# malwarebytes
# githubdesktop
# sublimetext
# textmate
# visualstudiocode
# microsoftskypeforbusiness
# microsoftteams
# microsoftyammer
# microsoftedgeenterprisestable
# microsoftedgeconsumerstable
# microsoftsharepointplugin
# microsoftdefenderatp
# googledrivefilestream
# cdef
# desktoppr
# supportapp
# xink
# wwdc

View File

@@ -1,92 +0,0 @@
#!/bin/sh
# Update with Installomator if app exist
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
item="microsoftedge" # enter the software to install
# Examples: brave, duckduckgo, firefoxpkg, googlechromepkg, microsoftedge, opera
appPath="/Applications/Microsoft Edge.app"
# Examples: Microsoft Edge.app, Brave Browser.app, DuckDuckGo.app, Google Chrome.app, Firefox.app, Opera.app
installomatorOptions="BLOCKING_PROCESS_ACTION=tell_user_then_quit" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
# Check if app is installed
# We only want this to run if it's already installed
if [ ! -e "${appPath}" ]; then
echo "App not found here:"
echo "${appPath}"
echo "Exiting."
exit 98
fi
echo "${appPath} Found!"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Install software using Installomator
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
# Check result
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -1,92 +0,0 @@
#!/bin/sh
# Update with Installomator if app exist
LOGO="" # "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
item="" # enter the software to install
# Examples: cyberduck, handbrake, textmate, vlc
appPath="/Applications/Cyberduck.app"
# Examples: Cyberduck.app, Handbrake.app, Textmate.app, VLC.app
installomatorOptions="BLOCKING_PROCESS_ACTION=prompt_user" # Separated by space
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
# To be used as a script sent out from a MDM.
# Fill the variable "item" above with a label.
# Script will run this label through Installomator.
######################################################################
# v. 9.2.1 : Better logging handling and installomatorOptions fix.
######################################################################
# Mark: Script
# PATH declaration
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
echo "$(date +%F\ %T) [LOG-BEGIN] $item"
# Check if app is installed
# We only want this to run if it's already installed
if [ ! -e "${appPath}" ]; then
echo "App not found here:"
echo "${appPath}"
echo "Exiting."
exit 98
fi
echo "${appPath} Found!"
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
exit 99
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Install software using Installomator
cmdOutput="$(${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true)"
# Check result
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
echo "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "warn" || true )"
echo "$warnOutput"
else
echo "ERROR installing ${item}. Exit code ${exitStatus}"
echo "$cmdOutput"
#errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
#echo "$errorOutput"
fi
echo "[$(DATE)][LOG-END]"
caffexit $exitStatus

View File

@@ -1,360 +0,0 @@
#!/bin/sh
# Installomator 1st installation with DEPNotify window (auto installation at enrollment)
instance="" # Name of used instance
LOGO="" # "appstore", "jamf", "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
items=(dialog dockutil microsoftautoupdate supportapp applenyfonts applesfpro applesfmono applesfcompact xink zohoworkdrivetruesync textmate 1password7 wwdc theunarchiver keka microsoftedge microsoftteams microsoftonedrive microsoftoffice365)
# Remember: dialog dockutil
installomatorOptions="NOTIFY=silent BLOCKING_PROCESS_ACTION=ignore INSTALL=force IGNORE_APP_STORE_APPS=yes LOGGING=REQ"
# DEPNotify display settings, change as desired
title="Installing Apps and other software"
message="Please wait while we download and install the needed software."
endMessage="Installation complete! Please reboot to activate FileVault."
errorMessage="A problem was encountered setting up this Mac. Please contact IT."
######################################################################
# Installomator 1st DEPNotify
#
# Installation using Installomator showing progress with DEPNotify
# Great stand-alone solution if installs are only done using Installomator.
# No customization below…
######################################################################
# This script can be used to install software using Installomator.
# Script will start DEPNotify to display a progress bar.
# Progress bar moves between installations
######################################################################
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
#
# This script made by Søren Theilgaard
# https://github.com/Theile
# Twitter and MacAdmins Slack: @theilgaard
#
# Some functions and code from Installomator:
# https://github.com/Installomator/Installomator
#
######################################################################
scriptVersion="9.5"
# v. 9.5 : 2022-09-21 : change of GitHub download
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API
# v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support.
# v. 9.2.2 : 2022-06-17 : installomatorOptions introduced. Check 1.1.1.1 for internet connection.
# v. 9.2.1 : 2022-05-30 : Some changes to logging
# v. 9.2 : 2022-05-19 : Built in installer for Installlomator, and display dialog if error happens. Now universal script for all supported MDMs based on LOGO variable.
# v. 9.1 : 2022-04-13 : Using INSTALL=force in Label only, so Microsoft labels will not start updating
# v. 9.0.1 : 2022-02-21 : LOGO=addigy, few more "true" lines, and errorOutput on error
# v. 9.0.0 : 2022-02-14 : Updated for Inst. 9.0, Logging improved with printlog
######################################################################
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Check before running
case $LOGO in
addigy|microsoft)
conditionFile="/var/db/.Installomator1stDone"
# Addigy and Microsoft Endpoint Manager (Intune) need a check for a touched file
if [ -e "$conditionFile" ]; then
echo "$LOGO setup detected"
echo "$conditionFile exists, so we exit."
exit 0
else
echo "$conditionFile not found, so we continue…"
fi
;;
esac
# Mark: Constants, logging and caffeinate
log_message="$instance: Installomator 1st with DEPNotify, v$scriptVersion"
label="1st-v$scriptVersion"
log_location="/private/var/log/Installomator.log"
printlog(){
timestamp=$(date +%F\ %T)
if [[ "$(whoami)" == "root" ]]; then
echo "$timestamp :: $label : $1" | tee -a $log_location
else
echo "$timestamp :: $label : $1"
fi
}
printlog "[LOG-BEGIN] ${log_message}"
# Internet check
if [[ "$(nc -z -v -G 10 1.1.1.1 53 2>&1 | grep -io "succeeded")" != "succeeded" ]]; then
printlog "ERROR. No internet connection, we cannot continue."
exit 90
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid" || true
pkill caffeinate || true
printlog "[LOG-END] Status $1"
exit $1
}
# Command-file to DEPNotify
DEPNOTIFY_LOG="/var/tmp/depnotify.log"
# Counters
errorCount=0
countLabels=${#items[@]}
printlog "Total installations: $countLabels"
# Using LOGO variable to specify MDM and shown logo
case $LOGO in
appstore)
# Apple App Store on Mac
if [[ $(sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
;;
jamf)
# Jamf Pro
LOGO_PATH="/Library/Application Support/JAMF/Jamf.app/Contents/Resources/AppIcon.icns"
;;
mosyleb)
# Mosyle Business
LOGO_PATH="/Applications/Self-Service.app/Contents/Resources/AppIcon.icns"
;;
mosylem)
# Mosyle Manager (education)
LOGO_PATH="/Applications/Manager.app/Contents/Resources/AppIcon.icns"
;;
addigy)
# Addigy
LOGO_PATH="/Library/Addigy/macmanage/MacManage.app/Contents/Resources/atom.icns"
;;
microsoft)
# Microsoft Endpoint Manager (Intune)
LOGO_PATH="/Library/Intune/Microsoft Intune Agent.app/Contents/Resources/AppIcon.icns"
;;
ws1)
# Workspace ONE (AirWatch)
LOGO="/Applications/Workspace ONE Intelligent Hub.app/Contents/Resources/AppIcon.icns"
;;
esac
if [[ ! -a "${LOGO_PATH}" ]]; then
printlog "ERROR in LOGO_PATH '${LOGO_PATH}', setting Mac App Store."
if [[ $(/usr/bin/sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
fi
printlog "LOGO: $LOGO - LOGO_PATH: $LOGO_PATH"
# Mark: Functions
printlog "depnotify_command function"
echo "" > $DEPNOTIFY_LOG || true
function depnotify_command(){
printlog "DEPNotify-command: $1"
echo "$1" >> $DEPNOTIFY_LOG || true
}
printlog "startDEPNotify function"
function startDEPNotify() {
currentUser="$(stat -f "%Su" /dev/console)"
currentUserID=$(id -u "$currentUser")
launchctl asuser $currentUserID open -a "/Applications/Utilities/DEPNotify.app/Contents/MacOS/DEPNotify" --args -path "$DEPNOTIFY_LOG" || true # --args -fullScreen
sleep 5
depnotify_command "Command: KillCommandFile:"
depnotify_command "Command: MainTitle: $title"
depnotify_command "Command: Image: $LOGO_PATH"
depnotify_command "Command: MainText: $message"
depnotify_command "Command: Determinate: $countLabels"
}
# Notify the user using AppleScript
printlog "displayDialog function"
function displayDialog(){
currentUser="$(stat -f "%Su" /dev/console)"
currentUserID=$(id -u "$currentUser")
if [[ "$currentUser" != "" ]]; then
launchctl asuser $currentUserID sudo -u $currentUser osascript -e "button returned of (display dialog \"$message\" buttons {\"OK\"} default button \"OK\" with icon POSIX file \"$LOGO_PATH\")" || true
fi
}
# Mark: Code
name="Installomator"
printlog "$name check for installation"
# download URL, version and Expected Team ID
# Method for GitHub pkg
gitusername="Installomator"
gitreponame="Installomator"
#printlog "$gitusername $gitreponame"
filetype="pkg"
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
printlog "Trying GitHub API for download URL."
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
fi
#printlog "$downloadURL"
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
#printlog "$appNewVersion"
expectedTeamID="JME5BW3F3R"
destFile="/usr/local/Installomator/Installomator.sh"
currentInstalledVersion="$(${destFile} version 2>/dev/null || true)"
printlog "${destFile} version: $currentInstalledVersion"
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
printlog "$name not found or version not latest."
printlog "${destFile}"
printlog "Installing version ${appNewVersion} ..."
# Create temporary working directory
tmpDir="$(mktemp -d || true)"
printlog "Created working directory '$tmpDir'"
# Download the installer package
printlog "Downloading $name package version $appNewVersion from: $downloadURL"
installationCount=0
exitCode=9
while [[ $installationCount -lt 3 && $exitCode -gt 0 ]]; do
curlDownload=$(curl -Ls "$downloadURL" -o "$tmpDir/$name.pkg" || true)
curlDownloadStatus=$(echo $?)
if [[ $curlDownloadStatus -ne 0 ]]; then
printlog "error downloading $downloadURL, with status $curlDownloadStatus"
printlog "${curlDownload}"
exitCode=1
else
printlog "Download $name succes."
# Verify the download
teamID=$(spctl -a -vv -t install "$tmpDir/$name.pkg" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' || true)
printlog "Team ID for downloaded package: $teamID"
# Install the package if Team ID validates
if [ "$expectedTeamID" = "$teamID" ] || [ "$expectedTeamID" = "" ]; then
printlog "$name package verified. Installing package '$tmpDir/$name.pkg'."
pkgInstall=$(installer -verbose -dumplog -pkg "$tmpDir/$name.pkg" -target "/" 2>&1)
pkgInstallStatus=$(echo $?)
if [[ $pkgInstallStatus -ne 0 ]]; then
printlog "ERROR. $name package installation failed."
printlog "${pkgInstall}"
exitCode=2
else
printlog "Installing $name package succes."
exitCode=0
fi
else
printlog "ERROR. Package verification failed for $name before package installation could start. Download link may be invalid."
exitCode=3
fi
fi
((installationCount++))
printlog "$installationCount time(s), exitCode $exitCode"
if [[ $installationCount -lt 3 ]]; then
if [[ $exitCode -gt 0 ]]; then
printlog "Sleep a bit before trying download and install again. $installationCount time(s)."
printlog "Remove $(rm -fv "$tmpDir/$name.pkg" || true)"
sleep 2
fi
else
printlog "Download and install of $name succes."
fi
done
# Remove the temporary working directory
printlog "Deleting working directory '$tmpDir' and its contents."
printlog "Remove $(rm -Rfv "${tmpDir}" || true)"
# Handle installation errors
if [[ $exitCode != 0 ]]; then
printlog "ERROR. Installation of $name failed. Aborting."
caffexit $exitCode
else
printlog "$name version $appNewVersion installed!"
fi
else
printlog "$name version $appNewVersion already found. Perfect!"
fi
# Installing DEPNotify
cmdOutput="$( ${destFile} depnotify LOGO=$LOGO NOTIFY=silent BLOCKING_PROCESS_ACTION=ignore LOGGING=WARN || true )"
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
printlog "DEPNotify install result: $exitStatus"
itemName=""
errorLabels=""
((countLabels++))
((countLabels--))
printlog "$countLabels labels to install"
startDEPNotify
for item in "${items[@]}"; do
# Check if DEPNotify is running and try open it if not
if ! pgrep -xq "DEPNotify"; then
startDEPNotify
fi
itemName=$( ${destFile} ${item} RETURN_LABEL_NAME=1 LOGGING=REQ INSTALL=force | tail -1 || true )
if [[ "$itemName" != "#" ]]; then
depnotify_command "Status: $itemName installing…"
else
depnotify_command "Status: $item installing…"
fi
printlog "$item $itemName"
cmdOutput="$( ${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true )"
#cmdOutput="2022-05-19 13:20:45 : REQ : installomator : ################## End Installomator, exit code 0"
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
printlog "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text "WARN" || true )"
printlog "$warnOutput"
else
printlog "Error installing ${item}. Exit code ${exitStatus}"
#printlog "$cmdOutput"
errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
printlog "$errorOutput"
((errorCount++))
errorLabels="$errorLabels ${item}"
fi
((countLabels--))
itemName=""
done
# Mark: Finishing
# Prevent re-run of script if conditionFile is set
if [[ ! -z "$conditionFile" ]]; then
printlog "Touching condition file so script will not run again"
touch "$conditionFile" || true
printlog "$(ls -al "$conditionFile" || true)"
fi
# Show error to user if any
printlog "Errors: $errorCount"
if [[ $errorCount -ne 0 ]]; then
errorMessage="${errorMessage} Total errors: $errorCount"
message="$errorMessage"
displayDialog &
endMessage="$message"
printlog "errorLabels: $errorLabels"
fi
depnotify_command "Command: MainText: $endMessage"
depnotify_command "Command: Quit: $endMessage"
sleep 1
printlog "Remove $(rm -fv $DEPNOTIFY_LOG || true)"
printlog "Ending"
caffexit $errorCount

View File

@@ -1,308 +0,0 @@
#!/bin/sh
# Installomator 1st installation (auto installation at enrollment)
instance="" # Name of used instance
LOGO="" # "appstore", "jamf", "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
items=(dialog dockutil microsoftautoupdate supportapp xink zohoworkdrivetruesync textmate applenyfonts applesfpro applesfmono applesfcompact 1password7 wwdc theunarchiver keka microsoftedge microsoftteams microsoftonedrive microsoftoffice365)
# Remember: dialog dockutil
installomatorOptions="NOTIFY=silent BLOCKING_PROCESS_ACTION=ignore INSTALL=force IGNORE_APP_STORE_APPS=yes LOGGING=REQ"
# Error message to user if any occur
showError="1" # Show error message if 1 (0 if it should not be shown)
errorMessage="A problem was encountered setting up this Mac. Please contact IT."
######################################################################
# Installomator 1st
#
# Installation using Installomator
# (use separate Progress 1st script to show progress)
# No customization below…
######################################################################
# This script can be used to install software using Installomator.
# Script will display a dialog if any errors happens.
# User is not notified about installations.
######################################################################
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
#
# This script made by Søren Theilgaard
# https://github.com/Theile
# Twitter and MacAdmins Slack: @theilgaard
#
# Some functions and code from Installomator:
# https://github.com/Installomator/Installomator
#
######################################################################
scriptVersion="9.5"
# v. 9.5 : 2022-09-21 : change of GitHub download
# v. 9.4 : 2022-09-14 : Making error message optional. downloadURL can fall back on GitHub API.
# v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support.
# v. 9.2.2 : 2022-06-17 : installomatorOptions introduced. Check 1.1.1.1 for internet connection.
# v. 9.2.1 : 2022-05-30 : Some changes to logging
# v. 9.2 : 2022-05-19 : Built in installer for Installomator, and display dialog if error happens. Now universal script for all supported MDMs based on LOGO variable.
######################################################################
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Check before running
case $LOGO in
addigy|microsoft)
conditionFile="/var/db/.Installomator1stDone"
# Addigy and Microsoft Endpoint Manager (Intune) need a check for a touched file
if [ -e "$conditionFile" ]; then
echo "$LOGO setup detected"
echo "$conditionFile exists, so we exit."
exit 0
else
echo "$conditionFile not found, so we continue…"
fi
;;
esac
# Mark: Constants, logging and caffeinate
log_message="$instance: Installomator 1st, v$scriptVersion"
label="1st-v$scriptVersion"
log_location="/private/var/log/Installomator.log"
printlog(){
timestamp=$(date +%F\ %T)
if [[ "$(whoami)" == "root" ]]; then
echo "$timestamp :: $label : $1" | tee -a $log_location
else
echo "$timestamp :: $label : $1"
fi
}
printlog "[LOG-BEGIN] ${log_message}"
# Internet check
if [[ "$(nc -z -v -G 10 1.1.1.1 53 2>&1 | grep -io "succeeded")" != "succeeded" ]]; then
printlog "ERROR. No internet connection, we cannot continue."
caffexit 90
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid" || true
pkill caffeinate || true
printlog "[LOG-END] Status $1"
exit $1
}
# Counters
errorCount=0
countLabels=${#items[@]}
printlog "Total installations: $countLabels"
# Using LOGO variable to specify MDM and shown logo
case $LOGO in
appstore)
# Apple App Store on Mac
if [[ $(sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
;;
jamf)
# Jamf Pro
LOGO_PATH="/Library/Application Support/JAMF/Jamf.app/Contents/Resources/AppIcon.icns"
;;
mosyleb)
# Mosyle Business
LOGO_PATH="/Applications/Self-Service.app/Contents/Resources/AppIcon.icns"
;;
mosylem)
# Mosyle Manager (education)
LOGO_PATH="/Applications/Manager.app/Contents/Resources/AppIcon.icns"
;;
addigy)
# Addigy
LOGO_PATH="/Library/Addigy/macmanage/MacManage.app/Contents/Resources/atom.icns"
;;
microsoft)
# Microsoft Endpoint Manager (Intune)
LOGO_PATH="/Library/Intune/Microsoft Intune Agent.app/Contents/Resources/AppIcon.icns"
;;
ws1)
# Workspace ONE (AirWatch)
LOGO="/Applications/Workspace ONE Intelligent Hub.app/Contents/Resources/AppIcon.icns"
;;
esac
if [[ ! -a "${LOGO_PATH}" ]]; then
printlog "ERROR in LOGO_PATH '${LOGO_PATH}', setting Mac App Store."
if [[ $(/usr/bin/sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
fi
printlog "LOGO: $LOGO LOGO_PATH: $LOGO_PATH"
# Mark: Functions
# Notify the user using AppleScript
function displayDialog(){
currentUser="$(stat -f "%Su" /dev/console)"
currentUserID=$(id -u "$currentUser")
if [[ "$currentUser" != "" ]]; then
launchctl asuser $currentUserID sudo -u $currentUser osascript -e "button returned of (display dialog \"$message\" buttons {\"OK\"} default button \"OK\" with icon POSIX file \"$LOGO_PATH\")" || true
fi
}
# Mark: Code
name="Installomator"
printlog "$name check for installation"
# download URL, version and Expected Team ID
# Method for GitHub pkg
gitusername="Installomator"
gitreponame="Installomator"
#printlog "$gitusername $gitreponame"
filetype="pkg"
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
printlog "Trying GitHub API for download URL."
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
fi
#printlog "$downloadURL"
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
#printlog "$appNewVersion"
expectedTeamID="JME5BW3F3R"
destFile="/usr/local/Installomator/Installomator.sh"
currentInstalledVersion="$(${destFile} version 2>/dev/null || true)"
printlog "${destFile} version: $currentInstalledVersion"
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
printlog "$name not found or version not latest."
printlog "${destFile}"
printlog "Installing version ${appNewVersion} ..."
# Create temporary working directory
tmpDir="$(mktemp -d || true)"
printlog "Created working directory '$tmpDir'"
# Download the installer package
printlog "Downloading $name package version $appNewVersion from: $downloadURL"
installationCount=0
exitCode=9
while [[ $installationCount -lt 3 && $exitCode -gt 0 ]]; do
curlDownload=$(curl -Ls "$downloadURL" -o "$tmpDir/$name.pkg" || true)
curlDownloadStatus=$(echo $?)
if [[ $curlDownloadStatus -ne 0 ]]; then
printlog "error downloading $downloadURL, with status $curlDownloadStatus"
printlog "${curlDownload}"
exitCode=1
else
printlog "Download $name succes."
# Verify the download
teamID=$(spctl -a -vv -t install "$tmpDir/$name.pkg" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' || true)
printlog "Team ID for downloaded package: $teamID"
# Install the package if Team ID validates
if [ "$expectedTeamID" = "$teamID" ] || [ "$expectedTeamID" = "" ]; then
printlog "$name package verified. Installing package '$tmpDir/$name.pkg'."
pkgInstall=$(installer -verbose -dumplog -pkg "$tmpDir/$name.pkg" -target "/" 2>&1)
pkgInstallStatus=$(echo $?)
if [[ $pkgInstallStatus -ne 0 ]]; then
printlog "ERROR. $name package installation failed."
printlog "${pkgInstall}"
exitCode=2
else
printlog "Installing $name package succes."
exitCode=0
fi
else
printlog "ERROR. Package verification failed for $name before package installation could start. Download link may be invalid."
exitCode=3
fi
fi
((installationCount++))
printlog "$installationCount time(s), exitCode $exitCode"
if [[ $installationCount -lt 3 ]]; then
if [[ $exitCode -gt 0 ]]; then
printlog "Sleep a bit before trying download and install again. $installationCount time(s)."
printlog "Remove $(rm -fv "$tmpDir/$name.pkg" || true)"
sleep 2
fi
else
printlog "Download and install of $name succes."
fi
done
# Remove the temporary working directory
printlog "Deleting working directory '$tmpDir' and its contents."
printlog "Remove $(rm -Rfv "${tmpDir}" || true)"
# Handle installation errors
if [[ $exitCode != 0 ]]; then
printlog "ERROR. Installation of $name failed. Aborting."
caffexit $exitCode
else
printlog "$name version $appNewVersion installed!"
fi
else
printlog "$name version $appNewVersion already found. Perfect!"
fi
errorLabels=""
((countLabels++))
((countLabels--))
printlog "$countLabels labels to install"
for item in "${items[@]}"; do
printlog "$item"
cmdOutput="$( ${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true )"
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
printlog "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text "WARN" || true )"
printlog "$warnOutput"
else
printlog "Error installing ${item}. Exit code ${exitStatus}"
#printlog "$cmdOutput"
errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
printlog "$errorOutput"
((errorCount++))
errorLabels="$errorLabels ${item}"
fi
((countLabels--))
itemName=""
done
# Mark: Finishing
# Prevent re-run of script if conditionFile is set
if [[ ! -z "$conditionFile" ]]; then
printlog "Touching condition file so script will not run again"
touch "$conditionFile" || true
printlog "$(ls -al "$conditionFile" || true)"
fi
# Show error to user if any
printlog "Errors: $errorCount"
if [[ $errorCount -ne 0 ]]; then
printlog "ERROR: Display error dialog to user!"
errorMessage="${errorMessage} Total errors: $errorCount"
if [[ $showError -eq 1 ]]; then
message="$errorMessage"
displayDialog &
fi
printlog "errorLabels: $errorLabels"
fi
printlog "Ending"
caffexit $errorCount

View File

@@ -1,360 +0,0 @@
#!/bin/sh
# Installomator 1st installation with DEPNotify window (for self Service deployment)
instance="" # Name of used instance
LOGO="" # "appstore", "jamf", "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
items=(dialog dockutil microsoftautoupdate supportapp applenyfonts applesfpro applesfmono applesfcompact xink zohoworkdrivetruesync textmate 1password7 wwdc theunarchiver keka microsoftedge microsoftteams microsoftonedrive microsoftoffice365)
# Remember: dialog dockutil
installomatorOptions="NOTIFY=all BLOCKING_PROCESS_ACTION=prompt_user"
# DEPNotify display settings, change as desired
title="Installing Apps and other software"
message="Please wait while we download and install the needed software."
endMessage="Installation complete! Please reboot to activate FileVault."
errorMessage="A problem was encountered setting up this Mac. Please contact IT."
######################################################################
# Installomator 1st DEPNotify
#
# Installation using Installomator showing progress with DEPNotify
# Great stand-alone solution if installs are only done using Installomator.
# No customization below…
######################################################################
# This script can be used to install software using Installomator.
# Script will start DEPNotify to display a progress bar.
# Progress bar moves between installations
######################################################################
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
#
# This script made by Søren Theilgaard
# https://github.com/Theile
# Twitter and MacAdmins Slack: @theilgaard
#
# Some functions and code from Installomator:
# https://github.com/Installomator/Installomator
#
######################################################################
scriptVersion="9.5"
# v. 9.5 : 2022-09-21 : change of GitHub download
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API
# v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support.
# v. 9.2.2 : 2022-06-17 : installomatorOptions introduced. Check 1.1.1.1 for internet connection.
# v. 9.2.1 : 2022-05-30 : Some changes to logging
# v. 9.2 : 2022-05-19 : Built in installer for Installlomator, and display dialog if error happens. Now universal script for all supported MDMs based on LOGO variable.
# v. 9.1 : 2022-04-13 : Using INSTALL=force in Label only, so Microsoft labels will not start updating
# v. 9.0.1 : 2022-02-21 : LOGO=addigy, few more "true" lines, and errorOutput on error
# v. 9.0.0 : 2022-02-14 : Updated for Inst. 9.0, Logging improved with printlog
######################################################################
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Check before running
case $LOGO in
addigy|microsoft)
conditionFile="/var/db/.Installomator1stDone"
# Addigy and Microsoft Endpoint Manager (Intune) need a check for a touched file
if [ -e "$conditionFile" ]; then
echo "$LOGO setup detected"
echo "$conditionFile exists, so we exit."
exit 0
else
echo "$conditionFile not found, so we continue…"
fi
;;
esac
# Mark: Constants, logging and caffeinate
log_message="$instance: Installomator 1st with DEPNotify, v$scriptVersion"
label="1st-v$scriptVersion"
log_location="/private/var/log/Installomator.log"
printlog(){
timestamp=$(date +%F\ %T)
if [[ "$(whoami)" == "root" ]]; then
echo "$timestamp :: $label : $1" | tee -a $log_location
else
echo "$timestamp :: $label : $1"
fi
}
printlog "[LOG-BEGIN] ${log_message}"
# Internet check
if [[ "$(nc -z -v -G 10 1.1.1.1 53 2>&1 | grep -io "succeeded")" != "succeeded" ]]; then
printlog "ERROR. No internet connection, we cannot continue."
exit 90
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid" || true
pkill caffeinate || true
printlog "[LOG-END] Status $1"
exit $1
}
# Command-file to DEPNotify
DEPNOTIFY_LOG="/var/tmp/depnotify.log"
# Counters
errorCount=0
countLabels=${#items[@]}
printlog "Total installations: $countLabels"
# Using LOGO variable to specify MDM and shown logo
case $LOGO in
appstore)
# Apple App Store on Mac
if [[ $(sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
;;
jamf)
# Jamf Pro
LOGO_PATH="/Library/Application Support/JAMF/Jamf.app/Contents/Resources/AppIcon.icns"
;;
mosyleb)
# Mosyle Business
LOGO_PATH="/Applications/Self-Service.app/Contents/Resources/AppIcon.icns"
;;
mosylem)
# Mosyle Manager (education)
LOGO_PATH="/Applications/Manager.app/Contents/Resources/AppIcon.icns"
;;
addigy)
# Addigy
LOGO_PATH="/Library/Addigy/macmanage/MacManage.app/Contents/Resources/atom.icns"
;;
microsoft)
# Microsoft Endpoint Manager (Intune)
LOGO_PATH="/Library/Intune/Microsoft Intune Agent.app/Contents/Resources/AppIcon.icns"
;;
ws1)
# Workspace ONE (AirWatch)
LOGO="/Applications/Workspace ONE Intelligent Hub.app/Contents/Resources/AppIcon.icns"
;;
esac
if [[ ! -a "${LOGO_PATH}" ]]; then
printlog "ERROR in LOGO_PATH '${LOGO_PATH}', setting Mac App Store."
if [[ $(/usr/bin/sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
fi
printlog "LOGO: $LOGO - LOGO_PATH: $LOGO_PATH"
# Mark: Functions
printlog "depnotify_command function"
echo "" > $DEPNOTIFY_LOG || true
function depnotify_command(){
printlog "DEPNotify-command: $1"
echo "$1" >> $DEPNOTIFY_LOG || true
}
printlog "startDEPNotify function"
function startDEPNotify() {
currentUser="$(stat -f "%Su" /dev/console)"
currentUserID=$(id -u "$currentUser")
launchctl asuser $currentUserID open -a "/Applications/Utilities/DEPNotify.app/Contents/MacOS/DEPNotify" --args -path "$DEPNOTIFY_LOG" || true # --args -fullScreen
sleep 5
depnotify_command "Command: KillCommandFile:"
depnotify_command "Command: MainTitle: $title"
depnotify_command "Command: Image: $LOGO_PATH"
depnotify_command "Command: MainText: $message"
depnotify_command "Command: Determinate: $countLabels"
}
# Notify the user using AppleScript
printlog "displayDialog function"
function displayDialog(){
currentUser="$(stat -f "%Su" /dev/console)"
currentUserID=$(id -u "$currentUser")
if [[ "$currentUser" != "" ]]; then
launchctl asuser $currentUserID sudo -u $currentUser osascript -e "button returned of (display dialog \"$message\" buttons {\"OK\"} default button \"OK\" with icon POSIX file \"$LOGO_PATH\")" || true
fi
}
# Mark: Code
name="Installomator"
printlog "$name check for installation"
# download URL, version and Expected Team ID
# Method for GitHub pkg
gitusername="Installomator"
gitreponame="Installomator"
#printlog "$gitusername $gitreponame"
filetype="pkg"
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
printlog "Trying GitHub API for download URL."
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
fi
#printlog "$downloadURL"
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
#printlog "$appNewVersion"
expectedTeamID="JME5BW3F3R"
destFile="/usr/local/Installomator/Installomator.sh"
currentInstalledVersion="$(${destFile} version 2>/dev/null || true)"
printlog "${destFile} version: $currentInstalledVersion"
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
printlog "$name not found or version not latest."
printlog "${destFile}"
printlog "Installing version ${appNewVersion} ..."
# Create temporary working directory
tmpDir="$(mktemp -d || true)"
printlog "Created working directory '$tmpDir'"
# Download the installer package
printlog "Downloading $name package version $appNewVersion from: $downloadURL"
installationCount=0
exitCode=9
while [[ $installationCount -lt 3 && $exitCode -gt 0 ]]; do
curlDownload=$(curl -Ls "$downloadURL" -o "$tmpDir/$name.pkg" || true)
curlDownloadStatus=$(echo $?)
if [[ $curlDownloadStatus -ne 0 ]]; then
printlog "error downloading $downloadURL, with status $curlDownloadStatus"
printlog "${curlDownload}"
exitCode=1
else
printlog "Download $name succes."
# Verify the download
teamID=$(spctl -a -vv -t install "$tmpDir/$name.pkg" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' || true)
printlog "Team ID for downloaded package: $teamID"
# Install the package if Team ID validates
if [ "$expectedTeamID" = "$teamID" ] || [ "$expectedTeamID" = "" ]; then
printlog "$name package verified. Installing package '$tmpDir/$name.pkg'."
pkgInstall=$(installer -verbose -dumplog -pkg "$tmpDir/$name.pkg" -target "/" 2>&1)
pkgInstallStatus=$(echo $?)
if [[ $pkgInstallStatus -ne 0 ]]; then
printlog "ERROR. $name package installation failed."
printlog "${pkgInstall}"
exitCode=2
else
printlog "Installing $name package succes."
exitCode=0
fi
else
printlog "ERROR. Package verification failed for $name before package installation could start. Download link may be invalid."
exitCode=3
fi
fi
((installationCount++))
printlog "$installationCount time(s), exitCode $exitCode"
if [[ $installationCount -lt 3 ]]; then
if [[ $exitCode -gt 0 ]]; then
printlog "Sleep a bit before trying download and install again. $installationCount time(s)."
printlog "Remove $(rm -fv "$tmpDir/$name.pkg" || true)"
sleep 2
fi
else
printlog "Download and install of $name succes."
fi
done
# Remove the temporary working directory
printlog "Deleting working directory '$tmpDir' and its contents."
printlog "Remove $(rm -Rfv "${tmpDir}" || true)"
# Handle installation errors
if [[ $exitCode != 0 ]]; then
printlog "ERROR. Installation of $name failed. Aborting."
caffexit $exitCode
else
printlog "$name version $appNewVersion installed!"
fi
else
printlog "$name version $appNewVersion already found. Perfect!"
fi
# Installing DEPNotify
cmdOutput="$( ${destFile} depnotify LOGO=$LOGO NOTIFY=silent BLOCKING_PROCESS_ACTION=ignore LOGGING=WARN || true )"
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
printlog "DEPNotify install result: $exitStatus"
itemName=""
errorLabels=""
((countLabels++))
((countLabels--))
printlog "$countLabels labels to install"
startDEPNotify
for item in "${items[@]}"; do
# Check if DEPNotify is running and try open it if not
if ! pgrep -xq "DEPNotify"; then
startDEPNotify
fi
itemName=$( ${destFile} ${item} RETURN_LABEL_NAME=1 LOGGING=REQ INSTALL=force | tail -1 || true )
if [[ "$itemName" != "#" ]]; then
depnotify_command "Status: $itemName installing…"
else
depnotify_command "Status: $item installing…"
fi
printlog "$item $itemName"
cmdOutput="$( ${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true )"
#cmdOutput="2022-05-19 13:20:45 : REQ : installomator : ################## End Installomator, exit code 0"
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
printlog "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text "WARN" || true )"
printlog "$warnOutput"
else
printlog "Error installing ${item}. Exit code ${exitStatus}"
#printlog "$cmdOutput"
errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
printlog "$errorOutput"
((errorCount++))
errorLabels="$errorLabels ${item}"
fi
((countLabels--))
itemName=""
done
# Mark: Finishing
# Prevent re-run of script if conditionFile is set
if [[ ! -z "$conditionFile" ]]; then
printlog "Touching condition file so script will not run again"
touch "$conditionFile" || true
printlog "$(ls -al "$conditionFile" || true)"
fi
# Show error to user if any
printlog "Errors: $errorCount"
if [[ $errorCount -ne 0 ]]; then
errorMessage="${errorMessage} Total errors: $errorCount"
message="$errorMessage"
displayDialog &
endMessage="$message"
printlog "errorLabels: $errorLabels"
fi
depnotify_command "Command: MainText: $endMessage"
depnotify_command "Command: Quit: $endMessage"
sleep 1
printlog "Remove $(rm -fv $DEPNOTIFY_LOG || true)"
printlog "Ending"
caffexit $errorCount

View File

@@ -1,307 +0,0 @@
#!/bin/sh
# Installomator 1st installation (for Self Service deployment)
instance="" # Name of used instance
LOGO="" # "appstore", "jamf", "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
items=(dialog dockutil microsoftautoupdate supportapp applenyfonts applesfpro applesfmono applesfcompact xink zohoworkdrivetruesync textmate 1password7 wwdc theunarchiver keka microsoftedge microsoftteams microsoftonedrive microsoftoffice365)
# Remember: dialog dockutil
installomatorOptions="NOTIFY=all BLOCKING_PROCESS_ACTION=prompt_user"
# Error message to user if any occur
showError="1" # Show error message if 1 (0 if it should not be shown)
errorMessage="A problem was encountered setting up this Mac. Please contact IT."
######################################################################
# Installomator 1st for Self Service
#
# Installation using Installomator
# No customization below…
######################################################################
# This script can be used to install software using Installomator, where the user activate it in Self Service.
# Script will display a dialog if any errors happens.
# Progress is shown in notifications to the user
######################################################################
# Other installomatorOptions:
# LOGGING=REQ
# LOGGING=DEBUG
# LOGGING=WARN
# BLOCKING_PROCESS_ACTION=ignore
# BLOCKING_PROCESS_ACTION=tell_user
# BLOCKING_PROCESS_ACTION=tell_user_then_quit
# BLOCKING_PROCESS_ACTION=prompt_user
# BLOCKING_PROCESS_ACTION=prompt_user_loop
# BLOCKING_PROCESS_ACTION=prompt_user_then_kill
# BLOCKING_PROCESS_ACTION=quit
# BLOCKING_PROCESS_ACTION=kill
# NOTIFY=all
# NOTIFY=success
# NOTIFY=silent
# IGNORE_APP_STORE_APPS=yes
# INSTALL=force
######################################################################
#
# This script made by Søren Theilgaard
# https://github.com/Theile
# Twitter and MacAdmins Slack: @theilgaard
#
# Some functions and code from Installomator:
# https://github.com/Installomator/Installomator
#
######################################################################
scriptVersion="9.5"
# v. 9.5 : 2022-09-21 : change of GitHub download
# v. 9.4 : 2022-09-14 : Making error message optional. downloadURL can fall back on GitHub API.
# v. 9.3 : 2022-08-29 : installomatorOptions in quotes and ignore blocking processes. Improved installation with looping if it fails, so it can try again. Improved GitHub handling. ws1 support.
# v. 9.2.2 : 2022-06-17 : installomatorOptions introduced. Check 1.1.1.1 for internet connection.
# v. 9.2.1 : 2022-05-30 : Some changes to logging
# v. 9.2 : 2022-05-19 : Built in installer for Installomator, and display dialog if error happens. Now universal script for all supported MDMs based on LOGO variable.
######################################################################
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Check before running
case $LOGO in
addigy|microsoft)
conditionFile="/var/db/.Installomator1stDone"
# Addigy and Microsoft Endpoint Manager (Intune) need a check for a touched file
if [ -e "$conditionFile" ]; then
echo "$LOGO setup detected"
echo "$conditionFile exists, so we exit."
exit 0
else
echo "$conditionFile not found, so we continue…"
fi
;;
esac
# Mark: Constants, logging and caffeinate
log_message="$instance: Installomator 1st, v$scriptVersion"
label="1st-v$scriptVersion"
log_location="/private/var/log/Installomator.log"
printlog(){
timestamp=$(date +%F\ %T)
if [[ "$(whoami)" == "root" ]]; then
echo "$timestamp :: $label : $1" | tee -a $log_location
else
echo "$timestamp :: $label : $1"
fi
}
printlog "[LOG-BEGIN] ${log_message}"
# Internet check
if [[ "$(nc -z -v -G 10 1.1.1.1 53 2>&1 | grep -io "succeeded")" != "succeeded" ]]; then
printlog "ERROR. No internet connection, we cannot continue."
caffexit 90
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid" || true
pkill caffeinate || true
printlog "[LOG-END] Status $1"
exit $1
}
# Counters
errorCount=0
countLabels=${#items[@]}
printlog "Total installations: $countLabels"
# Using LOGO variable to specify MDM and shown logo
case $LOGO in
appstore)
# Apple App Store on Mac
if [[ $(sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
;;
jamf)
# Jamf Pro
LOGO_PATH="/Library/Application Support/JAMF/Jamf.app/Contents/Resources/AppIcon.icns"
;;
mosyleb)
# Mosyle Business
LOGO_PATH="/Applications/Self-Service.app/Contents/Resources/AppIcon.icns"
;;
mosylem)
# Mosyle Manager (education)
LOGO_PATH="/Applications/Manager.app/Contents/Resources/AppIcon.icns"
;;
addigy)
# Addigy
LOGO_PATH="/Library/Addigy/macmanage/MacManage.app/Contents/Resources/atom.icns"
;;
microsoft)
# Microsoft Endpoint Manager (Intune)
LOGO_PATH="/Library/Intune/Microsoft Intune Agent.app/Contents/Resources/AppIcon.icns"
;;
ws1)
# Workspace ONE (AirWatch)
LOGO="/Applications/Workspace ONE Intelligent Hub.app/Contents/Resources/AppIcon.icns"
;;
esac
if [[ ! -a "${LOGO_PATH}" ]]; then
printlog "ERROR in LOGO_PATH '${LOGO_PATH}', setting Mac App Store."
if [[ $(/usr/bin/sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
fi
printlog "LOGO: $LOGO LOGO_PATH: $LOGO_PATH"
# Mark: Functions
# Notify the user using AppleScript
function displayDialog(){
currentUser="$(stat -f "%Su" /dev/console)"
currentUserID=$(id -u "$currentUser")
if [[ "$currentUser" != "" ]]; then
launchctl asuser $currentUserID sudo -u $currentUser osascript -e "button returned of (display dialog \"$message\" buttons {\"OK\"} default button \"OK\" with icon POSIX file \"$LOGO_PATH\")" || true
fi
}
# Mark: Code
name="Installomator"
printlog "$name check for installation"
# download URL, version and Expected Team ID
# Method for GitHub pkg
gitusername="Installomator"
gitreponame="Installomator"
#printlog "$gitusername $gitreponame"
filetype="pkg"
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
printlog "Trying GitHub API for download URL."
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
fi
#printlog "$downloadURL"
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
#printlog "$appNewVersion"
expectedTeamID="JME5BW3F3R"
destFile="/usr/local/Installomator/Installomator.sh"
currentInstalledVersion="$(${destFile} version 2>/dev/null || true)"
printlog "${destFile} version: $currentInstalledVersion"
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
printlog "$name not found or version not latest."
printlog "${destFile}"
printlog "Installing version ${appNewVersion} ..."
# Create temporary working directory
tmpDir="$(mktemp -d || true)"
printlog "Created working directory '$tmpDir'"
# Download the installer package
printlog "Downloading $name package version $appNewVersion from: $downloadURL"
installationCount=0
exitCode=9
while [[ $installationCount -lt 3 && $exitCode -gt 0 ]]; do
curlDownload=$(curl -Ls "$downloadURL" -o "$tmpDir/$name.pkg" || true)
curlDownloadStatus=$(echo $?)
if [[ $curlDownloadStatus -ne 0 ]]; then
printlog "error downloading $downloadURL, with status $curlDownloadStatus"
printlog "${curlDownload}"
exitCode=1
else
printlog "Download $name succes."
# Verify the download
teamID=$(spctl -a -vv -t install "$tmpDir/$name.pkg" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' || true)
printlog "Team ID for downloaded package: $teamID"
# Install the package if Team ID validates
if [ "$expectedTeamID" = "$teamID" ] || [ "$expectedTeamID" = "" ]; then
printlog "$name package verified. Installing package '$tmpDir/$name.pkg'."
pkgInstall=$(installer -verbose -dumplog -pkg "$tmpDir/$name.pkg" -target "/" 2>&1)
pkgInstallStatus=$(echo $?)
if [[ $pkgInstallStatus -ne 0 ]]; then
printlog "ERROR. $name package installation failed."
printlog "${pkgInstall}"
exitCode=2
else
printlog "Installing $name package succes."
exitCode=0
fi
else
printlog "ERROR. Package verification failed for $name before package installation could start. Download link may be invalid."
exitCode=3
fi
fi
((installationCount++))
printlog "$installationCount time(s), exitCode $exitCode"
if [[ $installationCount -lt 3 ]]; then
if [[ $exitCode -gt 0 ]]; then
printlog "Sleep a bit before trying download and install again. $installationCount time(s)."
printlog "Remove $(rm -fv "$tmpDir/$name.pkg" || true)"
sleep 2
fi
else
printlog "Download and install of $name succes."
fi
done
# Remove the temporary working directory
printlog "Deleting working directory '$tmpDir' and its contents."
printlog "Remove $(rm -Rfv "${tmpDir}" || true)"
# Handle installation errors
if [[ $exitCode != 0 ]]; then
printlog "ERROR. Installation of $name failed. Aborting."
caffexit $exitCode
else
printlog "$name version $appNewVersion installed!"
fi
else
printlog "$name version $appNewVersion already found. Perfect!"
fi
errorLabels=""
((countLabels++))
((countLabels--))
printlog "$countLabels labels to install"
for item in "${items[@]}"; do
printlog "$item"
cmdOutput="$( ${destFile} ${item} LOGO=$LOGO ${installomatorOptions} || true )"
exitStatus="$( echo "${cmdOutput}" | grep --binary-files=text -i "exit" | tail -1 | sed -E 's/.*exit code ([0-9]).*/\1/g' || true )"
if [[ ${exitStatus} -eq 0 ]] ; then
printlog "${item} succesfully installed."
warnOutput="$( echo "${cmdOutput}" | grep --binary-files=text "WARN" || true )"
printlog "$warnOutput"
else
printlog "Error installing ${item}. Exit code ${exitStatus}"
#printlog "$cmdOutput"
errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )"
printlog "$errorOutput"
((errorCount++))
errorLabels="$errorLabels ${item}"
fi
((countLabels--))
itemName=""
done
# Mark: Finishing
# Prevent re-run of script if conditionFile is set
if [[ ! -z "$conditionFile" ]]; then
printlog "Touching condition file so script will not run again"
touch "$conditionFile" || true
printlog "$(ls -al "$conditionFile" || true)"
fi
# Show error to user if any
printlog "Errors: $errorCount"
if [[ $errorCount -ne 0 ]]; then
printlog "ERROR: Display error dialog to user!"
errorMessage="${errorMessage} Total errors: $errorCount"
if [[ $showError -eq 1 ]]; then
message="$errorMessage"
displayDialog &
fi
printlog "errorLabels: $errorLabels"
fi
printlog "Ending"
caffexit $errorCount

View File

@@ -1,13 +0,0 @@
#!/bin/sh
# Mark: Addigy Condition on condition file
# Install on success
conditionFile="/var/db/.Installomator1stDone"
if [ -e "$conditionFile" ]; then
echo "$conditionFile exists. Exiting."
exit 1
else
echo "$conditionFile not found. Continue…"
exit 0
fi

View File

@@ -1,11 +0,0 @@
#!/bin/sh
# PREVENT Installomator 1st Auto-install from running
# DESCRIPTION
# Will create the file to prevent Installomator 1st Auto-install from running.
# Only for MDM solutions (like Addigy and Microsoft) that have conditions for runnning scripts and do not offer an enrollment event for runnning the script.
# By runninng this script, the file will be created on the client, that will prevent Installomator 1st Auto-install from runnning.
# This is a great help for implementing Installomator 1st Auto-install in a running solution, where the command below have to be run on currently enrolled devices, and then Installomator 1st Auto-install can be assigned to all machines, and will run only on newly enrolled devices.
/usr/bin/touch "/var/db/.Installomator1stDone"

44
MDM/Installomator update.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/bash
# Updating Installomator
# Usefull to push out after deployment if earlier version was deployed in DEP profile
# Currently script uses valuesfromarguments as a label is not included before next release, so this can be used to install to version 0.7
what="installomator" # enter the software to install
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
caffexit 99
fi
${destFile} valuesfromarguments\
name=Installomator \
type=pkg \
packageID=com.scriptingosx.Installomator \
downloadURL=https://github.com/Installomator/Installomator/releases/download/v0.7release/Installomator-0.7.0.pkg \
appNewVersion=0.7 \
expectedTeamID=JME5BW3F3R \
BLOCKING_PROCESS_ACTION=ignore \
NOTIFY=silent
# ${destFile} ${what} BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent
if [ $? != 0 ]; then
# This is currently not working in Mosyle, that will ignore script errors. Please request support for this from Mosyle!
echo "Error installing ${what}. Exit code $?"
caffexit $?
fi
echo "[$(DATE)][LOG-END]"
caffexit 0

View File

@@ -1,160 +0,0 @@
#!/bin/zsh
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# MARK: Arguments/Parameters
# Parameter 4: path to the swiftDialog command file
dialog_command_file=${4:-"/var/tmp/dialog.log"}
# Parameter 5: message displayed over the progress bar
message=${5:-"Self Service Progress"}
# Parameter 6: path or URL to an icon
icon=${6:-"/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"}
# see Dan Snelson's advice on how to get a URL to an icon in Self Service
# https://rumble.com/v119x6y-harvesting-self-service-icons.html
# MARK: Constants
dialogApp="/Library/Application Support/Dialog/Dialog.app"
# MARK: Functions
dialogUpdate() {
# $1: dialog command
local dcommand="$1"
if [[ -n $dialog_command_file ]]; then
echo "$dcommand" >> "$dialog_command_file"
echo "Dialog: $dcommand"
fi
}
# MARK: sanity checks
# check minimal macOS requirement
if [[ $(sw_vers -buildVersion ) < "20A" ]]; then
echo "This script requires at least macOS 11 Big Sur."
exit 98
fi
# check we are running as root
if [[ $DEBUG -eq 0 && $(id -u) -ne 0 ]]; then
echo "This script should be run as root"
exit 97
fi
# swiftDialog installation
name="Dialog"
echo "$name check for installation"
# download URL, version and Expected Team ID
# Method for GitHub pkg w. app version check
gitusername="bartreardon"
gitreponame="swiftDialog"
#echo "$gitusername $gitreponame"
filetype="pkg"
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
echo "Trying GitHub API for download URL."
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
fi
#echo "$downloadURL"
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
#echo "$appNewVersion"
expectedTeamID="PWA5E9TQ59"
destFile="/Library/Application Support/Dialog/Dialog.app"
versionKey="CFBundleShortVersionString" #CFBundleVersion
currentInstalledVersion="$(defaults read "${destFile}/Contents/Info.plist" $versionKey || true)"
echo "${name} version: $currentInstalledVersion"
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
echo "$name not found or version not latest."
echo "${destFile}"
echo "Installing version ${appNewVersion}"
# Create temporary working directory
tmpDir="$(mktemp -d || true)"
echo "Created working directory '$tmpDir'"
# Download the installer package
echo "Downloading $name package version $appNewVersion from: $downloadURL"
installationCount=0
exitCode=9
while [[ $installationCount -lt 3 && $exitCode -gt 0 ]]; do
curlDownload=$(curl -Ls "$downloadURL" -o "$tmpDir/$name.pkg" || true)
curlDownloadStatus=$(echo $?)
if [[ $curlDownloadStatus -ne 0 ]]; then
echo "error downloading $downloadURL, with status $curlDownloadStatus"
echo "${curlDownload}"
exitCode=1
else
echo "Download $name succes."
# Verify the download
teamID=$(spctl -a -vv -t install "$tmpDir/$name.pkg" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' || true)
echo "Team ID for downloaded package: $teamID"
# Install the package if Team ID validates
if [ "$expectedTeamID" = "$teamID" ] || [ "$expectedTeamID" = "" ]; then
echo "$name package verified. Installing package '$tmpDir/$name.pkg'."
pkgInstall=$(installer -verbose -dumplog -pkg "$tmpDir/$name.pkg" -target "/" 2>&1)
pkgInstallStatus=$(echo $?)
if [[ $pkgInstallStatus -ne 0 ]]; then
echo "ERROR. $name package installation failed."
echo "${pkgInstall}"
exitCode=2
else
echo "Installing $name package succes."
exitCode=0
fi
else
echo "ERROR. Package verification failed for $name before package installation could start. Download link may be invalid."
exitCode=3
fi
fi
((installationCount++))
echo "$installationCount time(s), exitCode $exitCode"
if [[ $installationCount -lt 3 ]]; then
if [[ $exitCode -gt 0 ]]; then
echo "Sleep a bit before trying download and install again. $installationCount time(s)."
echo "Remove $(rm -fv "$tmpDir/$name.pkg" || true)"
sleep 2
fi
else
echo "Download and install of $name succes."
fi
done
# Remove the temporary working directory
echo "Deleting working directory '$tmpDir' and its contents."
echo "Remove $(rm -Rfv "${tmpDir}" || true)"
# Handle installation errors
if [[ $exitCode != 0 ]]; then
echo "ERROR. Installation of $name failed. Aborting."
caffexit $exitCode
else
echo "$name version $appNewVersion installed!"
fi
else
echo "$name version $appNewVersion already found. Perfect!"
fi
# check for Swift Dialog
if [[ ! -d $dialogApp ]]; then
echo "Cannot find dialog at $dialogApp"
exit 95
fi
# MARK: Configure and display swiftDialog
# display first screen
open -a "$dialogApp" --args \
--title none \
--icon "$icon" \
--message "$message" \
--mini \
--progress 100 \
--position bottomright \
--movable \
--commandfile "$dialog_command_file"
# give everything a moment to catch up
sleep 0.1

View File

@@ -1,69 +0,0 @@
#!/bin/zsh
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# MARK: Arguments/Parameters
# Parameter 4: path to the swiftDialog command file
dialog_command_file=${4:-"/var/tmp/dialog.log"}
# Parameter 5: message displayed over the progress bar
message=${5:-"Self Service Progress"}
# Parameter 6: path or URL to an icon
icon=${6:-"/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"}
# see Dan Snelson's advice on how to get a URL to an icon in Self Service
# https://rumble.com/v119x6y-harvesting-self-service-icons.html
# MARK: Constants
dialogApp="/Library/Application Support/Dialog/Dialog.app"
# MARK: Functions
dialogUpdate() {
# $1: dialog command
local dcommand="$1"
if [[ -n $dialog_command_file ]]; then
echo "$dcommand" >> "$dialog_command_file"
echo "Dialog: $dcommand"
fi
}
# MARK: sanity checks
# check minimal macOS requirement
if [[ $(sw_vers -buildVersion ) < "20A" ]]; then
echo "This script requires at least macOS 11 Big Sur."
exit 98
fi
# check we are running as root
if [[ $DEBUG -eq 0 && $(id -u) -ne 0 ]]; then
echo "This script should be run as root"
exit 97
fi
# check for Swift Dialog
if [[ ! -d $dialogApp ]]; then
echo "Cannot find dialog at $dialogApp"
exit 95
fi
# MARK: Configure and display swiftDialog
# display first screen
open -a "$dialogApp" --args \
--title none \
--icon "$icon" \
--message "$message" \
--mini \
--progress 100 \
--position bottomright \
--movable \
--commandfile "$dialog_command_file"
# give everything a moment to catch up
sleep 0.1

View File

@@ -1,48 +0,0 @@
# Display Installomator Progress with SwiftDialog in Jamf
Installomator 10 has functionality to communicate with [Bart Reardon's swiftDialog](https://github.com/bartreardon/swiftDialog). When you set the `DIALOG_CMD_FILE` variable Installomator will write progress for downloads and installation (with pkgs) to the command file which allows swiftDialog to display the progress.
However, you have to launch and setup swiftDialog to display a window with a progress bar before Installomator launches and also make sure swiftDialog quits after Installomator has run. This may seem complex at first but allows to configure swiftDialog just for your case without needing to modify the Installomator script.
Here are some example script that would run before and after Installomator to display a swiftDialog window and quit the process after. Since Jamf Pro executes scripts in alphanumerical order, the names are chosen accordingly, to ensure proper order.
## Setup in Jamf Pro
To show Installomator progress with swiftDialog from a Jamf Policy, you require three scripts:
- `00_Prepare_SwiftDialog.sh`: Configures and displays the swiftDialog window
- `Installomator.sh`: (v10 or higher)
- `zz_Quit_SwiftDialog.sh`: quits swiftDialog
Add these three scripts to your Jamf Pro and create a policy with these three scripts. The names are chosen that the script appear in the correct order. If you rename the scripts in Jamf Pro, this may disrupt the order and the workflow will not work anymore. The "Priority" of the scripts in the policy should all be the same value.
The different scripts require a set of parameters. We will use the `googlechromepkg` label as an example.
`00_Prepare_SwiftDialog.sh`
Parameter 4: `/var/tmp/dialog.log` (Path to the swiftDialog command file)
Parameter 5: `Installing Google Chrome...` (text shown in the swiftDialog window above the progress bar)
Parameter 6: Path to or URL for an icon in swiftDialog. This can be a path on the client or a URL. See Dan Snelson's advice on how to get icon URLs for Self Service icons: https://rumble.com/v119x6y-harvesting-self-service-icons.html
`Installomator.sh`
Parameter 4: `googlechromepkg` (the label to install)
Parameter 5: `DIALOG_CMD_FILE=/var/tmp/dialog.log` (the swiftDialog command file, this has to be the same value as parameter 4 in the previous script)
Parameter 6: `NOTIFY=silent` (disable Installomator notifications, optional)
You can add more configurations to the Installomator script when needed.
`zz_Quit_SwiftDialog`
Parameter 4: `/var/tmp/dialog.log` (the swiftDialog command file, this has to be the same value as parameter 4 in the first script)
Then setup the remainder of the Jamf Policy to your needs. This works best with Self Service policies.
When you run the policy, the first script will configure and display swiftDialog. Installomator.sh will download and install the app while writing the proper update commands to the file set in `DIALOG_CMD_FILE`. The final script will quit swiftDialog.
![](SelfServiceProgress.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 KiB

View File

@@ -1,57 +0,0 @@
#!/bin/zsh
# MARK: Arguments/Parameters
# Parameter 4: path to the swiftDialog command file
dialog_command_file=${4:-"/var/tmp/dialog.log"}
# MARK: Constants
dialogApp="/Library/Application Support/Dialog/Dialog.app"
dialogUpdate() {
# $1: dialog command
local dcommand="$1"
if [[ -n $dialog_command_file ]]; then
echo "$dcommand" >> "$dialog_command_file"
echo "Dialog: $dcommand"
fi
}
# check minimal macOS requirement
if [[ $(sw_vers -buildVersion ) < "20A" ]]; then
echo "This script requires at least macOS 11 Big Sur."
exit 98
fi
# check we are running as root
if [[ $DEBUG -eq 0 && $(id -u) -ne 0 ]]; then
echo "This script should be run as root"
exit 97
fi
# check for Swift Dialog
if [[ ! -d $dialogApp ]]; then
echo "Cannot find dialog at $dialogApp"
exit 95
fi
# close and quit dialog
dialogUpdate "progress: complete"
dialogUpdate "progresstext: Done"
# pause a moment
sleep 0.5
dialogUpdate "quit:"
# let everything catch up
sleep 0.5
# just to be safe
killall "Dialog"
# the killall command above will return error when Dialog is already quit
# but we don't want that to register as a failure in Jamf, so always exit 0
exit 0

100
MDM/MDMAddigy CustomSoftware.sh Executable file
View File

@@ -0,0 +1,100 @@
#!/bin/zsh
# Specific settings in Addigy to configure Custom Software for installomator.
# Addigy has 3 parts to fill out for this, Installation script, Condition, and Removal steps (see RemoveInstallomator.sh).
# Mark: Installation script
# Just click “Add” to autogenerate the installer script line by clicking the “Add”-button next to the Installer PKG, replace with first line below
/usr/sbin/installer -pkg "/Library/Addigy/ansible/packages/Installomator (0.7.0)/Installomator-0.7.0.pkg" -target /
# Installation using Installomator
what="supportapp xink textmate microsoftedge wwdc keka vlc " # enter the software to installed separated with spaces
# To be used as a script sent out from a MDM.
# Fill the variable "what" above with labels separated by space " ".
# Script will loop through these labels and exit with number of errors.
######################################################################
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Count errors
errorCount=0
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
caffexit 99
fi
for item in $what; do
#echo $item
${destFile} ${item} LOGO=addigy NOTIFY=silent BLOCKING_PROCESS_ACTION=quit_kill #INSTALL=force
if [ $? != 0 ]; then
# Error handling
echo "[$(DATE)] Error installing ${item}. Exit code $?"
let errorCount++
fi
done
echo
echo "Errors: $errorCount"
echo "[$(DATE)][LOG-END]"
caffexit $errorCount
# Mark: Conditions
# Install on success
# Remember to fill out the correct “TARGET_VERSION” and “PKG_ID”, and click "Install on succes".
PKG_ID="com.scriptingosx.Installomator"
TARGET_VERSION="8.0"
vercomp () {
if [[ $1 == $2 ]]; then
return 0
fi
local IFS=.
local i ver1=($1) ver2=($2)
# fill empty fields in ver1 with zeros
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do
ver1[i]=0
done
for ((i=0; i<${#ver1[@]}; i++)); do
if [[ -z ${ver2[i]} ]]; then
# fill empty fields in ver2 with zeros
ver2[i]=0
fi
if ((10#${ver1[i]} > 10#${ver2[i]})); then
return 1
fi
if ((10#${ver1[i]} < 10#${ver2[i]})); then
return 2
fi
done
return 0
}
INSTALLED_VERSION="$(pkgutil --pkg-info $PKG_ID | grep -i "^version" | awk '{print $2}')"
echo "Current Version: ${INSTALLED_VERSION}"
vercomp ${TARGET_VERSION} ${INSTALLED_VERSION}
COMP=$? # 0 means the same, 1 means TARGET is newer, 2 means INSTALLED is newer
echo "COMPARISON: ${COMP}"
if [ "${COMP}" -eq 1 ]; then
echo "Installed version is older than ${TARGET_VERSION}."
exit 0
else
echo "Installed version is the same or newer than ${TARGET_VERSION}."
exit 1
fi

73
MDM/MDMMosyle install.sh Normal file
View File

@@ -0,0 +1,73 @@
PKG_ID="com.scriptingosx.Installomator"
TARGET_VERSION="8.0"
URLDOWNLOAD="%MosyleCDNFile:blah-blah-blah%"
######################################################################
# Installation using Installomator (enter the software to install separated with spaces in the "what"-variable)
what="handbrake theunarchiver microsoftoffice365"
# Covered by Mosyle Catalog: "brave firefox googlechrome microsoftedge microsoftteams signal sublimetext vlc webex zoom" among others
######################################################################
## Mark: Code here
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Mark: Condition for Installomator installation
INSTALLED_VERSION="$(pkgutil --pkg-info $PKG_ID 2>/dev/null | grep -i "^version" | awk '{print $2}')"
echo "Current Version: ${INSTALLED_VERSION}"
if [[ "$TARGET_VERSION" != "$INSTALLED_VERSION" ]]; then
TMPDIR=$(mktemp -d )
if ! cd "$TMPDIR"; then
echo "error changing directory $TMPDIR"
caffexit 98
fi
NAME=$TMPDIR/$(date +%s).pkg
if ! curl -fsL "$URLDOWNLOAD" -o "$NAME"; then
echo "error downloading $URLDOWNLOAD to $NAME."
caffexit 97
fi
installer -pkg "$NAME" -target /
rm -rf "$TMPDIR"
else
echo "Installomator version $INSTALLED_VERSION already installed!"
fi
# Mark: Start Installomator label(s) installation
# Count errors
errorCount=0
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
caffexit 99
fi
for item in $what; do
#echo $item
${destFile} ${item} LOGO=mosyle NOTIFY=all BLOCKING_PROCESS_ACTION=tell_user #NOTIFY=silent BLOCKING_PROCESS_ACTION=quit_kill #INSTALL=force
if [ $? != 0 ]; then
# Error handling
echo "[$(DATE)] Error installing ${item}. Exit code $?"
let errorCount++
fi
done
echo
echo "Errors: $errorCount"
echo "[$(DATE)][LOG-END]"
caffexit $errorCount

View File

@@ -0,0 +1,42 @@
#!/bin/bash
# Installation using Installomator
# Example of installing software using valuesfromarguments to install a custom software
what="valuesfromarguments" # enter the software to install
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid"
pkill caffeinate
exit $1
}
# Verify that Installomator has been installed
destFile="/usr/local/Installomator/Installomator.sh"
if [ ! -e "${destFile}" ]; then
echo "Installomator not found here:"
echo "${destFile}"
echo "Exiting."
caffexit 99
fi
${destFile} valuesfromarguments \
name=\"Zoho\ WorkDrive\" \
type=dmg \
downloadURL=https://files-accl.zohopublic.com/public/wdbin/download/46f971e4fc4a32b68ad5d7dade38a7d2 \
appNewVersion=2.6.25 \
expectedTeamID=TZ824L8Y37 \
BLOCKING_PROCESS_ACTION=quit \
NOTIFY=all
# ${destFile} ${what} BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent
if [ $? != 0 ]; then
# This is currently not working in Mosyle, that will ignore script errors. Please request support for this from Mosyle!
echo "Error installing ${what}. Exit code $?"
caffexit $?
fi
echo "[$(DATE)][LOG-END]"
caffexit 0

View File

@@ -1,13 +0,0 @@
#!/bin/sh
# Mark: Addigy Condition on condition file
# Install on success
conditionFile="/var/db/.Progress1stDone"
if [ -e "$conditionFile" ]; then
echo "$conditionFile exists. Exiting."
exit 1
else
echo "$conditionFile not found. Continue…"
exit 0
fi

View File

@@ -1,11 +0,0 @@
#!/bin/sh
# PREVENT Progress 1st swiftDialog from running
# DESCRIPTION
# Will create the file to prevent Progress 1st swiftDialog from running.
# Only for MDM solutions (like Addigy and Microsoft) that have conditions for runnning scripts and do not offer an enrollment event for runnning the script.
# By runninng this script, the file will be created on the client, that will prevent Progress 1st swiftDialog from runnning.
# This is a great help for implementing Progress 1st swiftDialog in a running solution, where the command below have to be run on currently enrolled devices, and then Progress 1st swiftDialog can be assigned to all machines, and will run only on newly enrolled devices.
/usr/bin/touch "/var/db/.Progress1stDone"

View File

@@ -1,397 +0,0 @@
#!/bin/sh
# Progress 1st with swiftDialog (auto installation at enrollment)
instance="" # Name of used instance
LOGO="" # "appstore", "jamf", "mosyleb", "mosylem", "addigy", "microsoft", "ws1"
apps=(
"swiftDialog,/usr/local/bin/dialog"
"dockutil,/usr/local/bin/dockutil"
"desktoppr,/usr/local/bin/desktoppr"
"SupportApp,/Applications/Support.app"
"Xink,/Applications/Xink.app"
"Apple NewYork Font,/Library/Fonts/NewYork.ttf"
"Apple SF Pro Font,/Library/Fonts/SF-Pro.ttf"
"Apple SF Mono Font,/Library/Fonts/SF-Mono-Bold.otf"
"Apple SF Compact Font,/Library/Fonts/SF-Compact.ttf"
"Zoho WorkDrive TrueSync,/Applications/Zoho WorkDrive TrueSync.app"
"TextMate,/Applications/TextMate.app"
"Sublime Text,/Applications/Sublime Text.app"
"1Password,/Applications/1Password 7.app"
"Mactracker,/Applications/Mactracker.app"
"WWDC,/Applications/WWDC.app"
"The Unarchiver,/Applications/The Unarchiver.app"
"Keka,/Applications/Keka.app"
"Brave,/Applications/Brave Browser.app"
"Firefox,/Applications/Firefox.app"
"Microsoft AutoUpdate,/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app"
"Microsoft Edge,/Applications/Microsoft Edge.app"
"Microsoft Teams,/Applications/Microsoft Teams.app"
"Microsoft Excel,/Applications/Microsoft Excel.app"
"Microsoft OneNote,/Applications/Microsoft OneNote.app"
"Microsoft Outlook,/Applications/Microsoft Outlook.app"
"Microsoft PowerPoint,/Applications/Microsoft PowerPoint.app"
"Microsoft Word,/Applications/Microsoft Word.app"
"Microsoft OneDrive,/Applications/OneDrive.app"
)
# Dialog display settings, change as desired
title="Installing Apps and other software"
message="Please wait while we download and install the needed software."
endMessage="Installation complete! Please reboot to activate FileVault."
displayEndMessageDialog=1 # Should endMessage be shown as a dialog? (0|1)
errorMessage="A problem was encountered setting up this Mac. Please contact IT."
######################################################################
# Progress 1st Dialog
#
# Showing installation progress using swiftDialog
# No customization below…
######################################################################
# Complete script meant for running via MDM on device enrollment. This will download
# and install Dialog on the fly before opening Dialog.
#
# Log: /private/var/log/InstallationProgress.log
# This file prevents script from running again on Addigy and Microsoft Endpoint (Intune):
# "/var/db/.Progress1stDone"
#
# Display a Dialog with a list of applications and indicate when theyve been installed
# Useful when apps are deployed at random, perhaps without local logging.
# Applies to Mosyle App Catalog installs, VPP app installs, Installomator installs etc.
# The script watches the existence of files in the file system, so that is used to show progress.
#
# Requires Dialog v1.9.1 or later (will be installed) https://github.com/bartreardon/swiftDialog
#
######################################################################
#
# This script made by Søren Theilgaard
# https://github.com/Theile
# Twitter and MacAdmins Slack: @theilgaard
#
# Based on the work by Adam Codega:
# https://github.com/acodega/dialog-scripts
#
# Some functions and code from Installomator:
# https://github.com/Installomator/Installomator
#
######################################################################
# List of apps/installs to process in “apps” array.
# Provide the display name as you prefer and the path to the app/file. ex:
# "Google Chrome,/Applications/Google Chrome.app"
# A comma separates the display name from the path. Do not use commas in your display name text.
#
# Tip: Check for something like print drivers using the pkg receipt, like:
# "Konica-Minolta drivers,/var/db/receipts/jp.konicaminolta.print.package.C759.plist"
# Or fonts, like:
# "Apple SF Pro Font,/Library/Fonts/SF-Pro.ttf"
######################################################################
scriptVersion="9.5"
# v. 9.5 : 2022-09-21 : change of GitHub download
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API
# v. 9.3 : 2022-08-29 : Logging changed for current version. Improved installation with looping if it fails, so it can try again. Improved GitHub handling.
# v. 9.2.2 : 2022-06-17 : Improved Dialog installation. Check 1.1.1.1 for internet connection.
# v. 9.2 : 2022-05-19 : Not using GitHub api for download of Dialog, show a dialog when finished to make message more important. Now universal script for all supported MDMs based on LOGO variable.
# v. 9.0 : 2022-05-16 : Based on acodegas work, I have added progress bar, changed logging and use another log-location, a bit more error handling for Dialog download, added some "|| true"-endings to some lines to not make them fail in Addigy, and some more.
######################################################################
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Check before running
case $LOGO in
addigy|microsoft)
conditionFile="/var/db/.Progress1stDone"
# Addigy and Microsoft Endpoint Manager (Intune) need a check for a touched file
if [ -e "$conditionFile" ]; then
echo "$LOGO setup detected"
echo "$conditionFile exists, so we exit."
exit 0
else
echo "$conditionFile not found, so we continue…"
fi
;;
esac
# Mark: Constants and logging
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
log_message="$instance: Progress 1st with Dialog, v$scriptVersion"
label="P1st-v$scriptVersion"
log_location="/private/var/log/Installomator.log"
function printlog(){
timestamp=$(date +%F\ %T)
if [[ "$(whoami)" == "root" ]]; then
echo "$timestamp :: $label : $1" | tee -a $log_location
else
echo "$timestamp :: $label : $1"
fi
}
printlog "[LOG-BEGIN] ${log_message}"
# Internet check
if [[ "$(nc -z -v -G 10 1.1.1.1 53 2>&1 | grep -io "succeeded")" != "succeeded" ]]; then
printlog "ERROR. No internet connection, we cannot continue."
exit 90
fi
# Location of dialog and dialog command file
dialogApp="/usr/local/bin/dialog"
dialog_command_file="/var/tmp/dialog.log"
counterFile="/var/tmp/Progress1st.plist"
# Counters
progress_index=0
step_progress=0
defaults write $counterFile step -int 0
progress_total=${#apps[@]}
printlog "Total watched installations: $progress_total"
# Using LOGO variable to specify MDM and shown logo
case $LOGO in
appstore)
# Apple App Store on Mac
if [[ $(sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
;;
jamf)
# Jamf Pro
LOGO_PATH="/Library/Application Support/JAMF/Jamf.app/Contents/Resources/AppIcon.icns"
;;
mosyleb)
# Mosyle Business
LOGO_PATH="/Applications/Self-Service.app/Contents/Resources/AppIcon.icns"
;;
mosylem)
# Mosyle Manager (education)
LOGO_PATH="/Applications/Manager.app/Contents/Resources/AppIcon.icns"
;;
addigy)
# Addigy
LOGO_PATH="/Library/Addigy/macmanage/MacManage.app/Contents/Resources/atom.icns"
;;
microsoft)
# Microsoft Endpoint Manager (Intune)
LOGO_PATH="/Library/Intune/Microsoft Intune Agent.app/Contents/Resources/AppIcon.icns"
;;
ws1)
# Workspace ONE (AirWatch)
LOGO="/Applications/Workspace ONE Intelligent Hub.app/Contents/Resources/AppIcon.icns"
;;
esac
if [[ ! -a "${LOGO_PATH}" ]]; then
printlog "ERROR in LOGO_PATH '${LOGO_PATH}', setting Mac App Store."
if [[ $(/usr/bin/sw_vers -buildVersion) > "19" ]]; then
LOGO_PATH="/System/Applications/App Store.app/Contents/Resources/AppIcon.icns"
else
LOGO_PATH="/Applications/App Store.app/Contents/Resources/AppIcon.icns"
fi
fi
printlog "LOGO: $LOGO LOGO_PATH: $LOGO_PATH"
# Mark: Functions
# execute a dialog command
echo "" > $dialog_command_file || true
function dialog_command(){
printlog "Dialog-command: $1"
echo "$1" >> $dialog_command_file || true
}
function appCheck(){
dialog_command "listitem: $(echo "$app" | cut -d ',' -f1): wait"
while [ ! -e "$(echo "$app" | cut -d ',' -f2)" ]; do
sleep 2
done
dialog_command "progresstext: Install of “$(echo "$app" | cut -d ',' -f1)” complete"
dialog_command "listitem: $(echo "$app" | cut -d ',' -f1): ✅"
progress_index=$(defaults read $counterFile step)
progress_index=$(( progress_index + 1 ))
defaults write $counterFile step -int $progress_index
dialog_command "progress: $progress_index"
printlog "at item number $progress_index"
}
# Notify the user using AppleScript
function displayDialog(){
if [[ "$currentUser" != "" ]]; then
launchctl asuser $currentUserID sudo -u $currentUser osascript -e "button returned of (display dialog \"$message\" buttons {\"OK\"} default button \"OK\" with icon POSIX file \"$LOGO_PATH\")" || true
fi
}
# Mark: Code
name="Dialog"
printlog "$name check for installation"
# download URL, version and Expected Team ID
# Method for GitHub pkg w. app version check
gitusername="bartreardon"
gitreponame="swiftDialog"
#printlog "$gitusername $gitreponame"
filetype="pkg"
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
printlog "Trying GitHub API for download URL."
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
fi
#printlog "$downloadURL"
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
#printlog "$appNewVersion"
expectedTeamID="PWA5E9TQ59"
destFile="/Library/Application Support/Dialog/Dialog.app"
versionKey="CFBundleShortVersionString" #CFBundleVersion
currentInstalledVersion="$(defaults read "${destFile}/Contents/Info.plist" $versionKey || true)"
printlog "${name} version: $currentInstalledVersion"
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
printlog "$name not found or version not latest."
printlog "${destFile}"
printlog "Installing version ${appNewVersion}"
# Create temporary working directory
tmpDir="$(mktemp -d || true)"
printlog "Created working directory '$tmpDir'"
# Download the installer package
printlog "Downloading $name package version $appNewVersion from: $downloadURL"
installationCount=0
exitCode=9
while [[ $installationCount -lt 3 && $exitCode -gt 0 ]]; do
curlDownload=$(curl -Ls "$downloadURL" -o "$tmpDir/$name.pkg" || true)
curlDownloadStatus=$(echo $?)
if [[ $curlDownloadStatus -ne 0 ]]; then
printlog "error downloading $downloadURL, with status $curlDownloadStatus"
printlog "${curlDownload}"
exitCode=1
else
printlog "Download $name succes."
# Verify the download
teamID=$(spctl -a -vv -t install "$tmpDir/$name.pkg" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' || true)
printlog "Team ID for downloaded package: $teamID"
# Install the package if Team ID validates
if [ "$expectedTeamID" = "$teamID" ] || [ "$expectedTeamID" = "" ]; then
printlog "$name package verified. Installing package '$tmpDir/$name.pkg'."
pkgInstall=$(installer -verbose -dumplog -pkg "$tmpDir/$name.pkg" -target "/" 2>&1)
pkgInstallStatus=$(echo $?)
if [[ $pkgInstallStatus -ne 0 ]]; then
printlog "ERROR. $name package installation failed."
printlog "${pkgInstall}"
exitCode=2
else
printlog "Installing $name package succes."
exitCode=0
fi
else
printlog "ERROR. Package verification failed for $name before package installation could start. Download link may be invalid."
exitCode=3
fi
fi
((installationCount++))
printlog "$installationCount time(s), exitCode $exitCode"
if [[ $installationCount -lt 3 ]]; then
if [[ $exitCode -gt 0 ]]; then
printlog "Sleep a bit before trying download and install again. $installationCount time(s)."
printlog "Remove $(rm -fv "$tmpDir/$name.pkg" || true)"
sleep 2
fi
else
printlog "Download and install of $name succes."
fi
done
# Remove the temporary working directory
printlog "Deleting working directory '$tmpDir' and its contents."
printlog "Remove $(rm -Rfv "${tmpDir}" || true)"
# Handle installation errors
if [[ $exitCode != 0 ]]; then
printlog "ERROR. Installation of $name failed. Aborting."
caffexit $exitCode
else
printlog "$name version $appNewVersion installed!"
fi
else
printlog "$name version $appNewVersion already found. Perfect!"
fi
while [ "$(pgrep -l "Setup Assistant")" != "" ]; do
printlog "Setup Assistant Still Running. PID $setupAssistantProcess."
sleep 1
done
printlog "Out of Setup Assistant."
while [ "$(pgrep -l "Finder")" = "" ]; do
printlog "Finder process not found. Assuming device is at login screen. PID $finderProcess"
sleep 1
done
printlog "Finder is running…"
currentUser=$(stat -f "%Su" /dev/console)
currentUserID=$(id -u "$currentUser")
printlog "Logged in user is $currentUser with ID $currentUserID"
# set icon based on whether computer is a desktop or laptop
#hwType=$(system_profiler SPHardwareDataType | grep "Model Identifier" | grep "Book" || true)
#if [ "$hwType" != "" ]; then
# LOGO_PATH="SF=laptopcomputer.and.arrow.down,weight=thin,colour1=#51a3ef,colour2=#5154ef"
#else
# LOGO_PATH="SF=desktopcomputer.and.arrow.down,weight=thin,colour1=#51a3ef,colour2=#5154ef"
#fi
dialogCMD="$dialogApp -p --title \"$title\" \
--message \"$message\" \
--icon \"$LOGO_PATH\" \
--progress $progress_total \
--button1text \"Please Wait\" \
--button1disabled"
# create the list of apps
listitems=""
for app in "${apps[@]}"; do
listitems="$listitems --listitem '$(echo "$app" | cut -d ',' -f1)'"
done
# final command to execute
dialogCMD="$dialogCMD $listitems"
printlog "$dialogCMD"
# Launch dialog and run it in the background sleep for a second to let thing initialise
printlog "About to launch Dialog."
eval "$dialogCMD" &
sleep 2
(for app in "${apps[@]}"; do
#step_progress=$(( 1 + progress_index ))
#dialog_command "progress: $step_progress"
sleep 0.5
appCheck &
done
wait)
# Mark: Finishing
# Prevent re-run of script if conditionFile is set
if [[ ! -z "$conditionFile" ]]; then
printlog "Touching condition file so script will not run again"
touch "$conditionFile" || true
printlog "$(ls -al "$conditionFile" || true)"
fi
# all done. close off processing and enable the "Done" button
printlog "Finalizing."
dialog_command "progresstext: $endMessage"
dialog_command "progress: complete"
dialog_command "button1text: Done"
dialog_command "button1: enable"
if [[ $displayEndMessageDialog -eq 1 ]]; then
message="$endMessage"
displayDialog &
fi
sleep 1
printlog $(rm -fv $dialog_command_file || true)
printlog $(rm -fv $counterFile || true)
printlog "Ending"

View File

@@ -1,83 +0,0 @@
# Scripts for use with MDM
These example scripts are meant for use with MDM to run __Installomator__ and process installs. Examples are also included which use swiftDialog to provide user feedback and dockutil to add app icons to the dock.
There are basically two ways to use Installomator with MDM. The _“Jamf way”_ is where, through the MDM admin interface, your upload the Installomator script to a policy, and you provide additional parameters in the policy configuration like which app to install. The _“other way”_ to use Installomator is by having the MDM install Installomator locally on the computer, just once, and then on subsequent runs the MDM runs a script which calls Installomator and provides the parameters.
Examples of MDMs which use the “other way” are Mosyle Manager/Mosyle Business, Addigy, and Microsoft Endpoint Manager (Intune).
The scripts utilizing __swiftDialog__ require version 10 of __Installomator__. If Installomator version 9 is installed, it will set `NOTIFY=all` and use the traditional __Installomator__ notifications for showing progress, where as on version 10 it will be `NOTIFY=silent` as __swiftDialog__ is used instead.
## Abbreviations used in script names
- SS — Self Service — scripts designed for use through a Self Service catalog
- VFA — valuesfromarguments — a custom label call to Installomator. When using an MDM and the "other way", you can use these scripts to provide the label variables to Installomator for custom labels.
## Condition scripts
Scripts with the `condition` suffix are for use with MDMs like Addigy, where a script is run to determine if the rest of the policy should run.
## Prevention scripts
The `Installomator 1st` and `Progress 1st` scripts are meant to run automatically upon device enrollment. They check for the existance of a file, `/var/db/.Installomator1stDone`, to determine whether the computer has already been deployed. You can run the prevention scripts on existing Macs to ensure the 1st scripts won't inadvertently run on them.
## "Jamf" folder
This folder has Jamf specific examples using __swiftDialog__ as part of the Installomator installation. Perfect for use with Jamf Self Service. Separate [ReadMe-file](Jamf/ReadMe.md) in this folder.
# Scripts to install prerequisites
Use these scripts to handle installing Installomator itself. Additionally, you may want to install swiftDialog manually instead of having Installomator install it.
- `install Installomator direct.sh` — can be run at enrollment and as maintenance at any time to install __Installomator__.
- `install swiftDialog direct.sh` — can be used at enrollment and as maintenance at any time to install __swiftDialog__.
Once Installomator has been installed, __dockutil__ can be installed by Installomator, using this script:
- `App-install/App service Auto-install.sh` — This script uses pre-installed installomator to install __dockutil__.
# Enrollment scripts
For enrollment purposes, some 1st-scripts has been created. One runs silently, another is using __DEPNotify__ to show progress and feedback:
- `Installomator 1st Auto-install DEPNotify.sh` — will install __DEPNotify__ first, start that up, and change progress on the installation bar at each installed label. Very good for Addigy an Microsoft.
- `Installomator 1st Auto-install.sh` — runnning silently installing Installomator labels in the given order. Can be used in combination with the Progress-script.
- `Progress 1st swiftDialog.sh` — It will install __swiftDialog__ and start that up with a list of software it will look for. It will look for an installed file/folder in the file system for each item. This is great if some apps are being installed outside of Installomator, like by Apple Apps & Books, and then this script can show when it has been installed.
There are also Self Service versions of the above.
## “App-install”-folder
- App browser-security Auto-install.sh
- App browser-security SS.sh
- App normal Auto-install.sh
- App normal SS.sh
- App service Auto-install.sh
- App VFA.sh
Here you can use scripts for Self Service (SS) or for Auto-install. There will be a difference in how many notifications will be used and maybe handling of blocking processes.
`browser-security`: For an app like a web browser, youll want the install performed right away, so there isnt a deferral option.
`normal`: The user can defer/skip the update.
`service`: These are apps where we dont need to ask the user to allow the update. Menu bar apps and utilities would fall under this category.
## “App-install SS with swiftDialog and dockutil”-folder
- App browser-security SS.sh
- App normal SS multi-app.sh
- App normal SS.sh
- App service SS.sh
- App VFA SS github.sh
- App VFA SS.sh
These scripts are similar to the App-install folder but also utilize __swiftDialog__ to show user feedback and installation status, and they also have an option to use __dockutil__ to add the installed software to the Dock.
# App-update
A common requested behavior is to only update an app if it is already installed. These script verifies if the app is already installed before runnning Installomator.
- App browser-security Auto-install.sh
- App normal Auto-install.sh

View File

@@ -1,17 +0,0 @@
#!/bin/sh
# Mark: Addigy Condition
# Install on success
gitusername="Installomator"
gitreponame="Installomator"
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
destFile="/usr/local/Installomator/Installomator.sh"
if [[ ! -e "${destFile}" || "$(${destFile} version)" != "$appNewVersion" ]]; then
#echo "Let's install…"
exit 0
else
#echo "No need!"
exit 1
fi

View File

@@ -1,149 +0,0 @@
#!/bin/sh
######################################################################
# Installation of Installomator
#
# No customization below…
######################################################################
# This script can be used to install Installomator directly from GitHub.
######################################################################
#
# This script made by Søren Theilgaard
# https://github.com/Theile
# Twitter and MacAdmins Slack: @theilgaard
#
# Some functions and code from Installomator:
# https://github.com/Installomator/Installomator
#
######################################################################
scriptVersion="9.5"
# v. 9.5 : 2022-09-21 : change of GitHub download
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API
# v. 9.3 : 2022-08-29 : Logging changed for current version. Improved installation with looping if it fails, so it can try again. Improved GitHub handling.
# v. 9.2.2 : 2022-06-17 : Check 1.1.1.1 for internet connection.
# v. 9.2 : 2022-05-19 : Built in installer for Installlomator. Universal script.
######################################################################
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Mark: Constants, logging and caffeinate
log_message="Installomator install, v$scriptVersion"
label="Inst-v$scriptVersion"
log_location="/private/var/log/Installomator.log"
printlog(){
timestamp=$(date +%F\ %T)
if [[ "$(whoami)" == "root" ]]; then
echo "$timestamp :: $label : $1" | tee -a $log_location
else
echo "$timestamp :: $label : $1"
fi
}
printlog "[LOG-BEGIN] ${log_message}"
# Internet check
if [[ "$(nc -z -v -G 10 1.1.1.1 53 2>&1 | grep -io "succeeded")" != "succeeded" ]]; then
printlog "ERROR. No internet connection, we cannot continue."
exit 90
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid" || true
pkill caffeinate || true
printlog "[LOG-END] Status $1"
exit $1
}
name="Installomator"
printlog "$name check for installation"
# download URL, version and Expected Team ID
# Method for GitHub pkg with destFile
gitusername="Installomator"
gitreponame="Installomator"
#printlog "$gitusername $gitreponame"
filetype="pkg"
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
printlog "Trying GitHub API for download URL."
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
fi
#printlog "$downloadURL"
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
#printlog "$appNewVersion"
expectedTeamID="JME5BW3F3R"
destFile="/usr/local/Installomator/Installomator.sh"
currentInstalledVersion="$(${destFile} version 2>/dev/null || true)"
printlog "${destFile} version: $currentInstalledVersion"
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
printlog "$name not found or version not latest."
printlog "${destFile}"
printlog "Installing version ${appNewVersion} ..."
# Create temporary working directory
tmpDir="$(mktemp -d || true)"
printlog "Created working directory '$tmpDir'"
# Download the installer package
printlog "Downloading $name package version $appNewVersion from: $downloadURL"
installationCount=0
exitCode=9
while [[ $installationCount -lt 3 && $exitCode -gt 0 ]]; do
curlDownload=$(curl -Ls "$downloadURL" -o "$tmpDir/$name.pkg" || true)
curlDownloadStatus=$(echo $?)
if [[ $curlDownloadStatus -ne 0 ]]; then
printlog "error downloading $downloadURL, with status $curlDownloadStatus"
printlog "${curlDownload}"
exitCode=1
else
printlog "Download $name succes."
# Verify the download
teamID=$(spctl -a -vv -t install "$tmpDir/$name.pkg" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' || true)
printlog "Team ID for downloaded package: $teamID"
# Install the package if Team ID validates
if [ "$expectedTeamID" = "$teamID" ] || [ "$expectedTeamID" = "" ]; then
printlog "$name package verified. Installing package '$tmpDir/$name.pkg'."
pkgInstall=$(installer -verbose -dumplog -pkg "$tmpDir/$name.pkg" -target "/" 2>&1)
pkgInstallStatus=$(echo $?)
if [[ $pkgInstallStatus -ne 0 ]]; then
printlog "ERROR. $name package installation failed."
printlog "${pkgInstall}"
exitCode=2
else
printlog "Installing $name package succes."
exitCode=0
fi
else
printlog "ERROR. Package verification failed for $name before package installation could start. Download link may be invalid."
exitCode=3
fi
fi
((installationCount++))
printlog "$installationCount time(s), exitCode $exitCode"
if [[ $installationCount -lt 3 ]]; then
if [[ $exitCode -gt 0 ]]; then
printlog "Sleep a bit before trying download and install again. $installationCount time(s)."
printlog "Remove $(rm -fv "$tmpDir/$name.pkg" || true)"
sleep 2
fi
else
printlog "Download and install of $name succes."
fi
done
# Remove the temporary working directory
printlog "Deleting working directory '$tmpDir' and its contents."
printlog "Remove $(rm -Rfv "${tmpDir}" || true)"
# Handle installation errors
if [[ $exitCode != 0 ]]; then
printlog "ERROR. Installation of $name failed. Aborting."
caffexit $exitCode
else
printlog "$name version $appNewVersion installed!"
fi
else
printlog "$name version $appNewVersion already found. Perfect!"
fi
caffexit 0

View File

@@ -1,20 +0,0 @@
#!/bin/sh
# Mark: Addigy Condition
# Install on success
gitusername="bartreardon"
gitreponame="swiftDialog"
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
destFile="/Library/Application Support/Dialog/Dialog.app"
versionKey="CFBundleShortVersionString" #CFBundleVersion
currentInstalledVersion="$(defaults read "${destFile}/Contents/Info.plist" $versionKey || true)"
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
#echo "Let's install…"
exit 0
else
#echo "No need!"
exit 1
fi

View File

@@ -1,150 +0,0 @@
#!/bin/sh
######################################################################
# Installation of swiftDialog
#
# No customization below…
######################################################################
# This script can be used to install swiftDialog directly from GitHub.
######################################################################
#
# This script made by Søren Theilgaard
# https://github.com/Theile
# Twitter and MacAdmins Slack: @theilgaard
#
# Some functions and code from Installomator:
# https://github.com/Installomator/Installomator
#
######################################################################
scriptVersion="9.5"
# v. 9.5 : 2022-09-21 : change of GitHub download
# v. 9.4 : 2022-09-14 : downloadURL can fall back on GitHub API.
# v. 9.3 : 2022-08-29 : Logging changed for current version. Improved installation with looping if it fails, so it can try again. Improved GitHub handling.
# v. 9.2.2 : 2022-06-17 : Check 1.1.1.1 for internet connection.
# v. 9.2 : 2022-05-19 : Built in installer for Installlomator. Universal script.
######################################################################
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Mark: Constants, logging and caffeinate
log_message="Dialog install, v$scriptVersion"
label="Dialog-v$scriptVersion"
log_location="/private/var/log/Installomator.log"
printlog(){
timestamp=$(date +%F\ %T)
if [[ "$(whoami)" == "root" ]]; then
echo "$timestamp :: $label : $1" | tee -a $log_location
else
echo "$timestamp :: $label : $1"
fi
}
printlog "[LOG-BEGIN] ${log_message}"
# Internet check
if [[ "$(nc -z -v -G 10 1.1.1.1 53 2>&1 | grep -io "succeeded")" != "succeeded" ]]; then
printlog "ERROR. No internet connection, we cannot continue."
exit 90
fi
# No sleeping
/usr/bin/caffeinate -d -i -m -u &
caffeinatepid=$!
caffexit () {
kill "$caffeinatepid" || true
pkill caffeinate || true
printlog "[LOG-END] Status $1"
exit $1
}
name="Dialog"
printlog "$name check for installation"
# download URL, version and Expected Team ID
# Method for GitHub pkg w. app version check
gitusername="bartreardon"
gitreponame="swiftDialog"
#printlog "$gitusername $gitreponame"
filetype="pkg"
#downloadURL="https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
printlog "Trying GitHub API for download URL."
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
fi
#printlog "$downloadURL"
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
#printlog "$appNewVersion"
expectedTeamID="PWA5E9TQ59"
destFile="/Library/Application Support/Dialog/Dialog.app"
versionKey="CFBundleShortVersionString" #CFBundleVersion
currentInstalledVersion="$(defaults read "${destFile}/Contents/Info.plist" $versionKey || true)"
printlog "${name} version: $currentInstalledVersion"
if [[ ! -e "${destFile}" || "$currentInstalledVersion" != "$appNewVersion" ]]; then
printlog "$name not found or version not latest."
printlog "${destFile}"
printlog "Installing version ${appNewVersion}"
# Create temporary working directory
tmpDir="$(mktemp -d || true)"
printlog "Created working directory '$tmpDir'"
# Download the installer package
printlog "Downloading $name package version $appNewVersion from: $downloadURL"
installationCount=0
exitCode=9
while [[ $installationCount -lt 3 && $exitCode -gt 0 ]]; do
curlDownload=$(curl -Ls "$downloadURL" -o "$tmpDir/$name.pkg" || true)
curlDownloadStatus=$(echo $?)
if [[ $curlDownloadStatus -ne 0 ]]; then
printlog "error downloading $downloadURL, with status $curlDownloadStatus"
printlog "${curlDownload}"
exitCode=1
else
printlog "Download $name succes."
# Verify the download
teamID=$(spctl -a -vv -t install "$tmpDir/$name.pkg" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' || true)
printlog "Team ID for downloaded package: $teamID"
# Install the package if Team ID validates
if [ "$expectedTeamID" = "$teamID" ] || [ "$expectedTeamID" = "" ]; then
printlog "$name package verified. Installing package '$tmpDir/$name.pkg'."
pkgInstall=$(installer -verbose -dumplog -pkg "$tmpDir/$name.pkg" -target "/" 2>&1)
pkgInstallStatus=$(echo $?)
if [[ $pkgInstallStatus -ne 0 ]]; then
printlog "ERROR. $name package installation failed."
printlog "${pkgInstall}"
exitCode=2
else
printlog "Installing $name package succes."
exitCode=0
fi
else
printlog "ERROR. Package verification failed for $name before package installation could start. Download link may be invalid."
exitCode=3
fi
fi
((installationCount++))
printlog "$installationCount time(s), exitCode $exitCode"
if [[ $installationCount -lt 3 ]]; then
if [[ $exitCode -gt 0 ]]; then
printlog "Sleep a bit before trying download and install again. $installationCount time(s)."
printlog "Remove $(rm -fv "$tmpDir/$name.pkg" || true)"
sleep 2
fi
else
printlog "Download and install of $name succes."
fi
done
# Remove the temporary working directory
printlog "Deleting working directory '$tmpDir' and its contents."
printlog "Remove $(rm -Rfv "${tmpDir}" || true)"
# Handle installation errors
if [[ $exitCode != 0 ]]; then
printlog "ERROR. Installation of $name failed. Aborting."
caffexit $exitCode
else
printlog "$name version $appNewVersion installed!"
fi
else
printlog "$name version $appNewVersion already found. Perfect!"
fi
caffexit 0

View File

@@ -1,151 +0,0 @@
#!/bin/zsh
# runs through a list of Installomator items
# and displays status using Swift Dialog
#
# dependencies:
# - Swift Dialog: https://github.com/bartreardon/swiftDialog
# - Installomator: https://github.com/Installomator/Installomator
# this script will install both if they are not yet present
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# MARK: Variables
# set to 1 to not require root and not actually do any changes
# set to 0 for production
if [[ $1 == "NODEBUG" ]]; then
DEBUG=0
else
DEBUG=1
fi
# the label to install:
label="googlechromepkg"
# MARK: Constants
scriptDir=$(dirname ${0:A})
repoDir=$(dirname $scriptDir)
# if [[ $DEBUG -eq 1 ]]; then
installomator="$repoDir/utils/assemble.sh"
# else
# installomator="/usr/local/Installomator/Installomator.sh"
# fi
dialog="/usr/local/bin/dialog"
if [[ DEBUG -eq 0 ]]; then
dialog_command_file="/var/tmp/dialog.log"
else
dialog_command_file="$HOME/dialog.log"
fi
# MARK: Functions
dialogUpdate() {
# $1: dialog command
local dcommand=$1
if [[ -n $dialog_command_file ]]; then
echo "$dcommand" >> $dialog_command_file
echo "Dialog: $dcommand"
fi
}
progressUpdate() {
# $1: progress text (optional)
local text=$1
itemCounter=$((itemCounter + 1))
dialogUpdate "progress: $itemCounter"
if [[ -n $text ]]; then
dialogUpdate "progresstext: $text"
fi
}
startItem() {
local description=$1
echo "Starting Item: $description"
dialogUpdate "listitem: $description: wait"
progressUpdate $description
}
cleanupAndExit() {
# kill caffeinate process
if [[ -n $caffeinatePID ]]; then
echo "killing caffeinate..."
kill $caffeinatePID
fi
# clean up tmp dir
if [[ -n $tmpDir && -d $tmpDir ]]; then
echo "removing tmpDir $tmpDir"
rm -rf $tmpDir
fi
}
# MARK: sanity checks
# check minimal macOS requirement
if [[ $(sw_vers -buildVersion ) < "20" ]]; then
echo "This script requires at least macOS 11 Big Sur."
exit 98
fi
# check we are running as root
if [[ $DEBUG -eq 0 && $(id -u) -ne 0 ]]; then
echo "This script should be run as root"
exit 97
fi
# check for installomator
if [[ ! -x $installomator ]]; then
echo "Cannot find Installomator at $installomator"
exit 96
fi
# check for Swift Dialog
if [[ ! -x $dialog ]]; then
echo "Cannot find dialog at $dialog"
exit 95
fi
# MARK: Setup
# No sleeping
caffeinate -dimsu & caffeinatePID=$!
# trap exit for cleanup
trap cleanupAndExit EXIT
# display first screen
$dialog --title "Installing $label" \
--message "" \
--hideicon \
--mini \
--progress 100 \
--position bottomright \
--ontop \
--movable \
--commandfile $dialog_command_file & dialogPID=$!
sleep 0.1
$installomator $label \
DIALOG_CMD_FILE="$dialog_command_file" \
DEBUG=$DEBUG
# clean up UI
dialogUpdate "progress: complete"
dialogUpdate "progresstext: Done"
sleep 0.5
dialogUpdate "quit:"

View File

@@ -1,185 +0,0 @@
#!/bin/zsh
# runs through a list of Installomator items
# and displays status using Swift Dialog
#
# dependencies:
# - Swift Dialog: https://github.com/bartreardon/swiftDialog
# - Installomator: https://github.com/Installomator/Installomator
# this script will install both if they are not yet present
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# MARK: Variables
# set to 1 to not require root and not actually do any changes
# set to 0 for production
if [[ $1 == "NODEBUG" ]]; then
DEBUG=0
else
DEBUG=1
fi
# list of Installomator labels
items=(
"firefoxpkg|Firefox"
"error|Expected Error"
"googlechromepkg|Google Chrome"
)
# MARK: Constants
scriptDir=$(dirname ${0:A})
repoDir=$(dirname $scriptDir)
# if [[ $DEBUG -eq 1 ]]; then
installomator="$repoDir/utils/assemble.sh"
# else
# installomator="/usr/local/Installomator/Installomator.sh"
# fi
dialog="/usr/local/bin/dialog"
if [[ DEBUG -eq 0 ]]; then
dialog_command_file="/var/tmp/dialog.log"
else
dialog_command_file="$HOME/dialog.log"
fi
# MARK: Functions
dialogUpdate() {
# $1: dialog command
local dcommand=$1
if [[ -n $dialog_command_file ]]; then
echo "$dcommand" >> $dialog_command_file
echo "Dialog: $dcommand"
fi
}
progressUpdate() {
# $1: progress text (optional)
local text=$1
itemCounter=$((itemCounter + 1))
dialogUpdate "progress: $itemCounter"
if [[ -n $text ]]; then
dialogUpdate "progresstext: $text"
fi
}
startItem() {
local description=$1
echo "Starting Item: $description"
dialogUpdate "listitem: $description: wait"
progressUpdate $description
}
installomator() {
# $1: label
# $2: description
local label=$1
local description=$2
$installomator $label \
DIALOG_CMD_FILE=${(q)dialog_command_file} \
DIALOG_LIST_ITEM_NAME=${(q)description} \
DEBUG=$DEBUG \
LOGGING=DEBUG
}
cleanupAndExit() {
# kill caffeinate process
if [[ -n $caffeinatePID ]]; then
echo "killing caffeinate..."
kill $caffeinatePID
fi
# clean up tmp dir
if [[ -n $tmpDir && -d $tmpDir ]]; then
echo "removing tmpDir $tmpDir"
rm -rf $tmpDir
fi
}
# MARK: sanity checks
# check minimal macOS requirement
if [[ $(sw_vers -buildVersion ) < "20" ]]; then
echo "This script requires at least macOS 11 Big Sur."
exit 98
fi
# check we are running as root
if [[ $DEBUG -eq 0 && $(id -u) -ne 0 ]]; then
echo "This script should be run as root"
exit 97
fi
# check for installomator
if [[ ! -x $installomator ]]; then
echo "Cannot find Installomator at $installomator"
exit 96
fi
# check for Swift Dialog
if [[ ! -x $dialog ]]; then
echo "Cannot find dialog at $dialog"
exit 95
fi
# MARK: Setup
# No sleeping
caffeinate -dimsu & caffeinatePID=$!
# trap exit for cleanup
trap cleanupAndExit EXIT
# setup first list
itemCount=$((${#items} + 1))
listitems=( )
for item in $items; do
label=$(cut -d '|' -f 1 <<< $item)
description=$(cut -d '|' -f 2 <<< $item)
listitems+=( "--listitem" ${description} )
done
# display first screen
$dialog --title "More Software" \
--icon "SF=gear" \
--message "We are downloading and installing some extra Apps..." \
--progress $itemCount \
"${listitems[@]}" \
--button1disabled \
--big \
--ontop \
--liststyle compact \
--width 700 \
--commandfile $dialog_command_file & dialogPID=$!
sleep 0.1
itemCounter=0
for item in $items; do
label=$(cut -d '|' -f 1 <<< $item)
description=$(cut -d '|' -f 2 <<< $item)
startItem $description
installomator $label $description
done
# clean up UI
dialogUpdate "progress: complete"
dialogUpdate "progresstext: Finished"
dialogUpdate "button1: enable"
dialogUpdate "button1text: Done"

View File

@@ -1,12 +1,8 @@
# Note: The main repo is a beta version
Please locate “Releases” on the right, and download the latest 9.2 release (either pkg or zip) for a supported release.
# Installomator
_The one installer script to rule them all._
![](https://img.shields.io/github/v/release/Installomator/Installomator)&nbsp;![](https://img.shields.io/github/downloads/Installomator/Installomator/latest/total)&nbsp;![](https://img.shields.io/badge/macOS-10.14%2B-success)&nbsp;![](https://img.shields.io/github/license/Installomator/Installomator)
![](https://img.shields.io/github/v/release/scriptingosx/Installomator)&nbsp;![](https://img.shields.io/github/downloads/scriptingosx/Installomator/latest/total)&nbsp;![](https://img.shields.io/badge/macOS-10.14%2B-success)&nbsp;![](https://img.shields.io/github/license/scriptingosx/Installomator)
This script is in the “we find it useful, it is working for us” stage.
@@ -17,12 +13,12 @@ We have put a lot of work into making it stable and safe, but we cannot - of cou
## Authors
Intallomator was originally inspired by the download scripts from William Smith and Sander Schram, and created by:
- [Armin Briegel - @scriptingosx](https://github.com/scriptingosx)
Armin Briegel - @scriptingosx
Later on a few more members came on the project:
- Isaac Ordonez - @issacatmann
- [Søren Theilgaard - @Theile](https://github.com/Theile)
- [Adam Codega - @acodega](https://github.com/acodega)
Later on a few more contributers came on the project:
Isaac Ordonez - @issacatmann
Søren Theilgaard - @Theile
Adam Codega - @acodega
And with numerous contributions from many others.

View File

@@ -7,7 +7,6 @@ if ! is-at-least 10.14 $installedOSversion; then
exit 98
fi
# MARK: argument parsing
if [[ $# -eq 0 ]]; then
if [[ -z $label ]]; then # check if label is set inside script
@@ -25,7 +24,7 @@ fi
while [[ -n $1 ]]; do
if [[ $1 =~ ".*\=.*" ]]; then
# if an argument contains an = character, send it to eval
printlog "setting variable from argument $1" INFO
printlog "setting variable from argument $1" WARN
eval $1
else
# assume it's a label
@@ -100,16 +99,6 @@ if [[ "$(whoami)" != "root" && "$DEBUG" -eq 0 ]]; then
cleanupAndExit 6 "not running as root, exiting" ERROR
fi
# check Swift Dialog presence and version
DIALOG_CMD="/usr/local/bin/dialog"
if [[ ! -x $DIALOG_CMD ]]; then
# Swift Dialog is not installed, clear cmd file variable to ignore
printlog "SwiftDialog is not installed, clear cmd file var"
DIALOG_CMD_FILE=""
fi
# MARK: labels in case statement
case $label in
longversion)

View File

@@ -14,18 +14,15 @@ cleanupAndExit() { # $1 = exit code, $2 message, $3 level
printlog "Debugging enabled, Deleting tmpDir output was:\n$deleteTmpOut" DEBUG
fi
# If we closed any processes, reopen the app again
reopenClosedProcess
if [[ -n $2 && $1 -ne 0 ]]; then
printlog "ERROR: $2" $3
updateDialog "fail" "Error ($1; $2)"
else
printlog "$2" $3
updateDialog "success" ""
fi
printlog "################## End Installomator, exit code $1 \n" REQ
# if label is wrong and we wanted name of the label, then return ##################
if [[ $RETURN_LABEL_NAME -eq 1 ]]; then
1=0 # If only label name should be returned we exit without any errors
@@ -64,12 +61,9 @@ displaynotification() { # $1: message $2: title
message=${1:-"Message"}
title=${2:-"Notification"}
manageaction="/Library/Application Support/JAMF/bin/Management Action.app/Contents/MacOS/Management Action"
hubcli="/usr/local/bin/hubcli"
if [[ -x "$manageaction" ]]; then
"$manageaction" -message "$message" -title "$title"
elif [[ -x "$hubcli" ]]; then
"$hubcli" notify -t "$title" -i "$message" -c "Dismiss"
else
runAsUser osascript -e "display notification \"$message\" with title \"$title\""
fi
@@ -162,22 +156,14 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name
fi
if [ -n "$archiveName" ]; then
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }")
if [[ "$(echo $downloadURL | grep -ioE "https.*$archiveName")" == "" ]]; then
printlog "GitHub API not returning URL, trying https://github.com/$gitusername/$gitreponame/releases/latest."
#downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*$archiveName" | head -1)
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*$archiveName" | head -1)"
fi
downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \
| awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }")
else
downloadURL=$(curl -sfL "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
if [[ "$(echo $downloadURL | grep -ioE "https.*.$filetype")" == "" ]]; then
printlog "GitHub API not returning URL, trying https://github.com/$gitusername/$gitreponame/releases/latest."
#downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)
downloadURL="https://github.com$(curl -sfL "$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "expanded_assets" | head -1)" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1)"
fi
downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \
| awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }")
fi
if [ -z "$downloadURL" ]; then
cleanupAndExit 14 "could not retrieve download URL for $gitusername/$gitreponame" ERROR
cleanupAndExit 9 "could not retrieve download URL for $gitusername/$gitreponame" ERROR
else
echo "$downloadURL"
return 0
@@ -190,8 +176,7 @@ versionFromGit() {
gitusername=${1?:"no git user name"}
gitreponame=${2?:"no git repo name"}
#appNewVersion=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | grep tag_name | cut -d '"' -f 4 | sed 's/[^0-9\.]//g')
appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g')
appNewVersion=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | grep tag_name | cut -d '"' -f 4 | sed 's/[^0-9\.]//g')
if [ -z "$appNewVersion" ]; then
printlog "could not retrieve version number for $gitusername/$gitreponame" WARN
appNewVersion=""
@@ -214,16 +199,6 @@ xpath() {
fi
}
# from @Pico: https://macadmins.slack.com/archives/CGXNNJXJ9/p1652222365989229?thread_ts=1651786411.413349&cid=CGXNNJXJ9
getJSONValue() {
# $1: JSON string OR file path to parse (tested to work with up to 1GB string and 2GB file).
# $2: JSON key path to look up (using dot or bracket notation).
printf '%s' "$1" | /usr/bin/osascript -l 'JavaScript' \
-e "let json = $.NSString.alloc.initWithDataEncoding($.NSFileHandle.fileHandleWithStandardInput.readDataToEndOfFile$(/usr/bin/uname -r | /usr/bin/awk -F '.' '($1 > 18) { print "AndReturnError(ObjC.wrap())" }'), $.NSUTF8StringEncoding)" \
-e 'if ($.NSFileManager.defaultManager.fileExistsAtPath(json)) json = $.NSString.stringWithContentsOfFileEncodingError(json, $.NSUTF8StringEncoding, ObjC.wrap())' \
-e "const value = JSON.parse(json.js)$([ -n "${2%%[.[]*}" ] && echo '.')$2" \
-e 'if (typeof value === "object") { JSON.stringify(value, null, 4) } else { value }'
}
getAppVersion() {
# modified by: Søren Theilgaard (@theilgaard) and Isaac Ordonez
@@ -267,8 +242,8 @@ getAppVersion() {
# printlog "App(s) found: ${applist}" DEBUG
# applist=$(mdfind "kind:application AND name:$appName" -0 )
fi
if [[ -z $applist ]]; then
printlog "No previous app found" WARN
if [[ -z applist ]]; then
printlog "No previous app found" INFO
else
printlog "App(s) found: ${applist}" INFO
fi
@@ -290,14 +265,10 @@ getAppVersion() {
if [[ -d "$installedAppPath"/Contents/_MASReceipt ]];then
printlog "Installed $appName is from App Store, use “IGNORE_APP_STORE_APPS=yes” to replace."
if [[ $IGNORE_APP_STORE_APPS == "yes" ]]; then
printlog "Replacing App Store apps, no matter the version" WARN
printlog "Replacing App Store apps, no matter the version"
appversion=0
else
if [[ $DIALOG_CMD_FILE != "" ]]; then
updateDialog "wait" "Already installed from App Store. Not replaced."
sleep 4
fi
cleanupAndExit 23 "App previously installed from App Store, and we respect that" ERROR
cleanupAndExit 1 "App previously installed from App Store, and we respect that" ERROR
fi
fi
else
@@ -446,7 +417,6 @@ installAppWithPath() { # $1: path to app to install in $targetDir
# verify with spctl
printlog "Verifying: $appPath" INFO
updateDialog "wait" "Verifying..."
printlog "App size: $(du -sh "$appPath")" DEBUG
appVerify=$(spctl -a -vv "$appPath" 2>&1 )
appVerifyStatus=$(echo $?)
@@ -455,6 +425,13 @@ installAppWithPath() { # $1: path to app to install in $targetDir
if [[ $appVerifyStatus -ne 0 ]] ; then
#if ! teamID=$(spctl -a -vv "$appPath" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' ); then
if [[ "$(echo $appVerify | head -1 | grep -oi rejected)" = "rejected" ]]; then
if [[ "$(echo $appVerify | tail -1)" = "source=no usable signature" ]]; then
printlog "Gatekeeper check rejected. No usable signature." ERROR
else
printlog "Gatekeeper check rejected. Could be that gatekeeper settings only accept App Store apps." ERROR
fi
fi
cleanupAndExit 4 "Error verifying $appPath error:\n$logoutput" ERROR
fi
printlog "Debugging enabled, App Verification output was:\n$logoutput" DEBUG
@@ -474,10 +451,6 @@ installAppWithPath() { # $1: path to app to install in $targetDir
printlog "notifying"
displaynotification "$message" "No update for $name!"
fi
if [[ $DIALOG_CMD_FILE != "" ]]; then
updateDialog "wait" "Latest version already installed..."
sleep 2
fi
cleanupAndExit 0 "No new version to install" REG
else
printlog "Using force to install anyway."
@@ -499,7 +472,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
printlog "notifying"
displaynotification "$message" "Error updating $name!"
fi
cleanupAndExit 15 "Installed macOS is too old for this app." ERROR
cleanupAndExit 6 "Installed macOS is too old for this app." ERROR
fi
fi
@@ -558,7 +531,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
deduplicatelogs "$CLIoutput"
if [ $CLIstatus -ne 0 ] ; then
cleanupAndExit 16 "Error installing $mountname/$CLIInstaller $CLIArguments error:\n$logoutput" ERROR
cleanupAndExit 3 "Error installing $mountname/$CLIInstaller $CLIArguments error:\n$logoutput" ERROR
else
printlog "Succesfully ran $mountname/$CLIInstaller $CLIArguments" INFO
fi
@@ -596,7 +569,6 @@ installFromDMG() {
installFromPKG() {
# verify with spctl
printlog "Verifying: $archiveName"
updateDialog "wait" "Verifying..."
printlog "File list: $(ls -lh "$archiveName")" DEBUG
printlog "File type: $(file "$archiveName")" DEBUG
spctlOut=$(spctl -a -vv -t install "$archiveName" 2>&1 )
@@ -613,6 +585,13 @@ installFromPKG() {
if [[ $spctlStatus -ne 0 ]] ; then
#if ! spctlout=$(spctl -a -vv -t install "$archiveName" 2>&1 ); then
if [[ "$(echo $spctlOut | head -1 | grep -oi rejected)" = "rejected" ]]; then
if [[ "$(echo $spctlOut | tail -1)" = "source=no usable signature" ]]; then
printlog "Gatekeeper check rejected. No usable signature." ERROR
else
printlog "Gatekeeper check rejected. Could be that gatekeeper settings only accept App Store apps." ERROR
fi
fi
cleanupAndExit 4 "Error verifying $archiveName error:\n$logoutput" ERROR
fi
@@ -644,10 +623,6 @@ installFromPKG() {
printlog "notifying"
displaynotification "$message" "No update for $name!"
fi
if [[ $DIALOG_CMD_FILE != "" ]]; then
updateDialog "wait" "Latest version already installed..."
sleep 2
fi
cleanupAndExit 0 "No new version to install" REQ
else
printlog "Using force to install anyway."
@@ -668,29 +643,8 @@ installFromPKG() {
# install pkg
printlog "Installing $archiveName to $targetDir"
if [[ $DIALOG_CMD_FILE != "" ]]; then
# pipe
pipe="$tmpDir/installpipe"
# initialise named pipe for installer output
initNamedPipe create $pipe
# run the pipe read in the background
readPKGInstallPipe $pipe "$DIALOG_CMD_FILE" & installPipePID=$!
printlog "listening to output of installer with pipe $pipe and command file $DIALOG_CMD_FILE on PID $installPipePID" DEBUG
pkgInstall=$(installer -verboseR -pkg "$archiveName" -tgt "$targetDir" 2>&1 | tee $pipe)
pkgInstallStatus=$pipestatus[1]
# because we are tee-ing the output, we want the pipe status of the first command in the chain, not the most recent one
killProcess $installPipePID
else
pkgInstall=$(installer -verbose -dumplog -pkg "$archiveName" -tgt "$targetDir" 2>&1)
pkgInstallStatus=$(echo $?)
fi
pkgInstall=$(installer -verbose -dumplog -pkg "$archiveName" -tgt "$targetDir" 2>&1)
pkgInstallStatus=$(echo $?)
sleep 1
pkgEndTime=$(date "+$LogDateFormat")
pkgInstall+=$(echo "\nOutput of /var/log/install.log below this line.\n")
@@ -782,7 +736,7 @@ installPkgInZip() {
printlog "Found pkg(s):\n$findfiles" DEBUG
filearray=( ${(f)findfiles} )
if [[ ${#filearray} -eq 0 ]]; then
cleanupAndExit 21 "couldn't find pkg in zip $archiveName" ERROR
cleanupAndExit 20 "couldn't find pkg in zip $archiveName" ERROR
fi
# it is now safe to overwrite archiveName for installFromPKG
archiveName="${filearray[1]}"
@@ -795,7 +749,7 @@ installPkgInZip() {
findfiles=$(find "$tmpDir" -iname "$pkgName")
filearray=( ${(f)findfiles} )
if [[ ${#filearray} -eq 0 ]]; then
cleanupAndExit 21 "couldn't find pkg “$pkgName” in zip $archiveName" ERROR
cleanupAndExit 20 "couldn't find pkg “$pkgName” in zip $archiveName" ERROR
fi
# it is now safe to overwrite archiveName for installFromPKG
archiveName="${filearray[1]}"
@@ -818,7 +772,7 @@ installAppInDmgInZip() {
findfiles=$(find "$tmpDir" -iname "*.dmg" -maxdepth 2 )
filearray=( ${(f)findfiles} )
if [[ ${#filearray} -eq 0 ]]; then
cleanupAndExit 22 "couldn't find dmg in zip $archiveName" ERROR
cleanupAndExit 20 "couldn't find dmg in zip $archiveName" ERROR
fi
archiveName="$(basename ${filearray[1]})"
# it is now safe to overwrite archiveName for installFromDMG
@@ -870,8 +824,7 @@ runUpdateTool() {
finishing() {
printlog "Finishing..."
sleep 3 # wait a moment to let spotlight catch up
sleep 10 # wait a moment to let spotlight catch up
getAppVersion
if [[ -z $appversion ]]; then
@@ -919,113 +872,3 @@ hasDisplaySleepAssertion() {
return 1
}
initNamedPipe() {
# create or delete a named pipe
# commands are "create" or "delete"
local cmd=$1
local pipe=$2
case $cmd in
"create")
if [[ -e $pipe ]]; then
rm $pipe
fi
# make named pipe
mkfifo -m 644 $pipe
;;
"delete")
# clean up
rm $pipe
;;
*)
;;
esac
}
readDownloadPipe() {
# reads from a previously created named pipe
# output from curl with --progress-bar. % downloaded is read in and then sent to the specified log file
local pipe=$1
local log=${2:-$DIALOG_CMD_FILE}
# set up read from pipe
while IFS= read -k 1 -u 0 char; do
if [[ $char =~ [0-9] ]]; then
keep=1
fi
if [[ $char == % ]]; then
updateDialog $progress "Downloading..."
progress=""
keep=0
fi
if [[ $keep == 1 ]]; then
progress="$progress$char"
fi
done < $pipe
}
readPKGInstallPipe() {
# reads from a previously created named pipe
# output from installer with -verboseR. % install status is read in and then sent to the specified log file
local pipe=$1
local log=${2:-$DIALOG_CMD_FILE}
local appname=${3:-$name}
while read -k 1 -u 0 char; do
if [[ $char == % ]]; then
keep=1
fi
if [[ $char =~ [0-9] && $keep == 1 ]]; then
progress="$progress$char"
fi
if [[ $char == . && $keep == 1 ]]; then
updateDialog $progress "Installing..."
progress=""
keep=0
fi
done < $pipe
}
killProcess() {
# will silently kill the specified PID
builtin kill $1 2>/dev/null
}
updateDialog() {
local state=$1
local message=$2
local listitem=${3:-$DIALOG_LIST_ITEM_NAME}
local cmd_file=${4:-$DIALOG_CMD_FILE}
local progress=""
if [[ $state =~ '^[0-9]' \
|| $state == "reset" \
|| $state == "increment" \
|| $state == "complete" \
|| $state == "indeterminate" ]]; then
progress=$state
fi
# when to cmdfile is set, do nothing
if [[ $cmd_file == "" ]]; then
return
fi
if [[ $listitem == "" ]]; then
# no listitem set, update main progress bar and progress text
if [[ $progress != "" ]]; then
echo "progress: $progress" >> $cmd_file
fi
if [[ $message != "" ]]; then
echo "progresstext: $name - $message" >> $cmd_file
fi
else
# list item has a value, so we update the progress and text in the list
if [[ $progress != "" ]]; then
echo "listitem: title: $listitem, statustext: $message, progress: $progress" >> $cmd_file
else
echo "listitem: title: $listitem, statustext: $message, status: $state" >> $cmd_file
fi
fi
}

View File

@@ -7,7 +7,7 @@ label="" # if no label is sent to the script, this will be used
# 2020-2021 Installomator
#
# inspired by the download scripts from William Smith and Sander Schram
#
#
# Contributers:
# Armin Briegel - @scriptingosx
# Isaac Ordonez - @issacatmann
@@ -23,7 +23,7 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# set to 0 for production, 1 or 2 for debugging
# while debugging, items will be downloaded to the parent directory of this script
# also no actual installation will be performed
# debug mode 1 will download to the directory the script is run in, but will not check the version
# debug mode 1 will download to the directory the script is run in, but will not check the version
# debug mode 2 will download to the temp directory, check for blocking processes, check the version, but will not install anything or remove the current version
DEBUG=1
@@ -34,6 +34,7 @@ NOTIFY=success
# - silent no notifications
# - all all notifications (great for Self Service installation)
# behavior when blocking processes are found
BLOCKING_PROCESS_ACTION=tell_user
# options:
@@ -80,7 +81,6 @@ LOGO=appstore
# - mosylem Mosyle Manager (Education)
# - addigy Addigy
# - microsoft Microsoft Endpoint Manager (Intune)
# - ws1 Workspace ONE (AirWatch)
# path can also be set in the command call, and if file exists, it will be used.
# Like 'LOGO="/System/Applications/App\ Store.app/Contents/Resources/AppIcon.icns"'
# (spaces have to be escaped).
@@ -139,26 +139,6 @@ IGNORE_DND_APPS=""
# IGNORE_DND_APPS="firefox,Google Chrome,Safari,Microsoft Edge,Opera,Amphetamine,caffeinate"
# Swift Dialog integration
# These variables will allow Installomator to communicate progress with Swift Dialog
# https://github.com/bartreardon/swiftDialog
# This requires Swift Dialog 2.11.2 or higher.
DIALOG_CMD_FILE=""
# When this variable is set, Installomator will write Swift Dialog commands to this path.
# Installomator will not launch Swift Dialog. The process calling Installomator will have
# launch and configure Swift Dialog to listen to this file.
# See `MDM/swiftdialog_example.sh` for an example.
DIALOG_LIST_ITEM_NAME=""
# When this variable is set, progress for downloads and installs will be sent to this
# listitem.
# When the variable is unset, progress will be sent to Swift Dialog's main progress bar.
# NOTE: How labels work
# Each workflow label needs to be listed in the case statement below.
@@ -204,7 +184,7 @@ DIALOG_LIST_ITEM_NAME=""
# How we get version number from app. Possible values:
# - CFBundleShortVersionString
# - CFBundleVersion
# Not all software titles uses fields the same.
# Not all software titles uses fields the same.
# See Opera label.
#
# - appCustomVersion(){}: (optional function)
@@ -258,7 +238,7 @@ DIALOG_LIST_ITEM_NAME=""
# - updateToolArguments:
# When Installomator detects an existing installation of the application,
# and the updateTool variable is set
# $updateTool $updateArguments
# $updateTool $updateArguments
# Will be run instead of of downloading and installing a complete new version.
# Use this when the updateTool does differential and optimized downloads.
# e.g. msupdate on various Microsoft labels
@@ -273,7 +253,7 @@ DIALOG_LIST_ITEM_NAME=""
# We need to define `name` for the installed app (to be version checked), as well as
# `installerTool` for the installer app (if named differently than `name`. Installomator
# will add the path to the folder/disk image with the binary, and it will be called like this:
# $CLIInstaller $CLIArguments
`$CLIInstaller $CLIArguments`
# For most installations `CLIInstaller` should contain the `installerTool` for the CLI call
# (if its the same).
# We can support a whole range of other software titles by implementing this.

View File

@@ -1,15 +0,0 @@
1password8)
name="1Password 8"
appName="1Password.app"
type="zip"
if [[ $(arch) == "arm64" ]]; then
archiveName="1Password-latest-aarch64.zip"
downloadURL="https://downloads.1password.com/mac/1Password-latest-aarch64.zip"
elif [[ $(arch) == "i386" ]]; then
archiveName="1Password-latest-x86_64.zip"
downloadURL="https://downloads.1password.com/mac/1Password-latest-x86_64.zip"
fi
expectedTeamID="2BUA8C4S2C"
blockingProcesses=( "1Password Extension Helper" "1Password 7" "1Password" "1Password (Safari)" "1PasswordNativeMessageHost" "1PasswordSafariAppExtension" )
#forcefulQuit=YES
;;

View File

@@ -1,7 +0,0 @@
abetterfinderrename11)
name="A Better Finder Rename 11"
type="dmg"
downloadURL="https://www.publicspace.net/download/ABFRX11.dmg"
appNewVersion=$(curl -fs "https://www.publicspace.net/app/signed_abfr11.xml" | xpath '(//rss/channel/item/enclosure/@sparkle:version)' 2>/dev/null | cut -d '"' -f 2)
expectedTeamID="7Y9KW4ND8W"
;;

View File

@@ -1,9 +0,0 @@
acroniscyberprotectconnect|\
remotix)
name="Acronis Cyber Protect Connect"
type="dmg"
downloadURL="https://go.acronis.com/AcronisCyberProtectConnect_ForMac"
versionKey="CFBundleVersion"
appNewVersion=$(curl -fsIL "${downloadURL}" | grep -i "^location" | sed -E 's/.*\/[a-zA-Z]*-[0-9.]*-([0-9.]*)\.dmg/\1/g')
expectedTeamID="ZU2TV78AA6"
;;

View File

@@ -1,11 +0,0 @@
acroniscyberprotectconnectagent|\
remotixagent)
name="Acronis Cyber Protect Connect Agent"
type="pkg"
#packageID="com.nulana.rxagentmac"
downloadURL="https://go.acronis.com/AcronisCyberProtectConnect_AgentForMac"
versionKey="CFBundleVersion"
appNewVersion=$(curl -fsIL "${downloadURL}" | grep -i "^location" | sed -E 's/.*\/[a-zA-Z]*-[0-9.]*-([0-9.]*)\.pkg/\1/g')
expectedTeamID="H629V387SY"
blockingProcesses=( NONE )
;;

View File

@@ -1,8 +0,0 @@
adobeacrobatprodc)
name="Adobe Acrobat Pro DC"
type="pkgInDmg"
downloadURL="https://trials.adobe.com/AdobeProducts/APRO/Acrobat_HelpX/osx10/Acrobat_DC_Web_WWMUI.dmg"
expectedTeamID="JQ525L2MZD"
blockingProcesses=( "Acrobat Pro DC" )
Company="Adobe"
;;

View File

@@ -1,24 +1,17 @@
adobecreativeclouddesktop)
name="Adobe Creative Cloud"
appName="Install.app"
#appName="Install.app"
type="dmg"
if pgrep -q "Adobe Installer"; then
printlog "Adobe Installer is running, not a good time to update." WARN
printlog "################## End $APPLICATION \n\n" INFO
exit 75
if [[ $(arch) == "arm64" ]]; then
downloadURL=$(curl -fs "https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" | grep -o "https*.*macarm64.*dmg" | cut -d '"' -f1 | head -1)
elif [[ $(arch) == "i386" ]]; then
downloadURL=$(curl -fs "https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" | grep -o "https*.*osx10.*dmg" | cut -d '"' -f1 | head -1)
fi
if [[ "$(arch)" == "arm64" ]]; then
downloadURL=$(curl -fs "https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" | grep -o 'https.*macarm64.*dmg' | head -1 | cut -d '"' -f1)
else
downloadURL=$(curl -fs "https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" | grep -o 'https.*osx10.*dmg' | head -1 | cut -d '"' -f1)
fi
#appNewVersion=$(curl -fs "https://helpx.adobe.com/creative-cloud/release-note/cc-release-notes.html" | grep "mandatory" | head -1 | grep -o "Version *.* released" | cut -d " " -f2)
appNewVersion=$(echo $downloadURL | grep -o '[^x]*$' | cut -d '.' -f 1 | sed 's/_/\./g')
targetDir="/Applications/Utilities/Adobe Creative Cloud/ACC/"
#downloadURL=$(curl -fs "https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" | grep -o "https*.*dmg" | head -1)
appNewVersion=$(curl -fs "https://helpx.adobe.com/creative-cloud/release-note/cc-release-notes.html" | grep "mandatory" | head -1 | grep -o "Version *.* released" | cut -d " " -f2)
installerTool="Install.app"
CLIInstaller="Install.app/Contents/MacOS/Install"
CLIArguments=(--mode=silent)
expectedTeamID="JQ525L2MZD"
blockingProcesses=( "Creative Cloud" )
Company="Adobe"
;;

View File

@@ -1,27 +0,0 @@
adobereaderdc-install)
name="Adobe Acrobat Reader DC"
type="pkgInDmg"
printlog "Changing IFS for Adobe Reader" INFO
SAVEIFS=$IFS
IFS=$'\n'
versions=( $( curl -s https://www.adobe.com/devnet-docs/acrobatetk/tools/ReleaseNotesDC/index.html | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+"| head -n 30) )
local version
for version in $versions; do
version="${version//.}"
printlog "trying version: $version" INFO
local httpstatus=$(curl -X HEAD -s "https://ardownload2.adobe.com/pub/adobe/reader/mac/AcrobatDC/${version}/AcroRdrDC_${version}_MUI.dmg" --write-out "%{http_code}")
printlog "HTTP status for Adobe Reader full installer URL https://ardownload2.adobe.com/pub/adobe/reader/mac/AcrobatDC/${version}/AcroRdrDC_${version}_MUI.dmg is $httpstatus" DEBUG
if [[ "${httpstatus}" == "200" ]]; then
downloadURL="https://ardownload2.adobe.com/pub/adobe/reader/mac/AcrobatDC/${version}/AcroRdrDC_${version}_MUI.dmg"
unset httpstatus
break
fi
done
unset version
IFS=$SAVEIFS
appNewVersion=$i
expectedTeamID="JQ525L2MZD"
blockingProcesses=( "AdobeReader" )
Company="Adobe"
PatchName="AcrobatReader"
;;

View File

@@ -1,44 +1,9 @@
adobereaderdc-update)
name="Adobe Acrobat Reader DC"
type="pkgInDmg"
if [[ -d "/Applications/Adobe Acrobat Reader DC.app" ]]; then
printlog "Found /Applications/Adobe Acrobat Reader DC.app"
mkdir -p "/Library/Application Support/Adobe/Acrobat/11.0"
defaults write "/Library/Application Support/Adobe/Acrobat/11.0/com.adobe.Acrobat.InstallerOverrides.plist" ReaderAppPath "/Applications/Adobe Acrobat Reader DC.app"
if ! defaults read "/Applications/Adobe Acrobat Reader DC.app/Contents/Resources/AcroLocale.plist" ; then
printlog "Missing locale data, this will cause the updater to fail. Deleting Adobe Acrobat Reader DC.app and installing fresh." WARN
rm -Rf "/Applications/Adobe Acrobat Reader DC.app"
if [[ $1 == "/" ]]; then
printlog "Running through Jamf: $0." INFO
$0 $1 $2 $3 adobereaderdc-install ${5} ${6} ${7} ${8} ${9} ${10} ${11}
else
printlog "Installomator running locally: $0." INFO
$0 adobereaderdc-install ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11}
fi
fi
fi
adobecurrent=$(curl -sL https://armmf.adobe.com/arm-manifests/mac/AcrobatDC/reader/current_version.txt | tr -d '.')
if [[ "${adobecurrent}" != <-> ]]; then
printlog "Got an invalid response for the Adobe Reader Current Version: ${adobecurrent}" ERROR
printlog "################## End $APPLICATION \n\n" INFO
exit 50
fi
downloadURL=$(echo https://ardownload2.adobe.com/pub/adobe/reader/mac/AcrobatDC/"$adobecurrent"/AcroRdrDCUpd"$adobecurrent"_MUI.dmg)
reader_preinstall() {
if pgrep -a "AdobeReader" >/dev/null 2>&1; then
printlog "AdobeReader is still running, forcefully killing." WARN
killall AdobeReader
fi
}
preinstall="reader_preinstall"
updateTool="/usr/local/bin/RemoteUpdateManager"
updateToolArguments=( --productVersions=RDR )
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)
appNewVersion=$(curl -s https://armmf.adobe.com/arm-manifests/mac/AcrobatDC/reader/current_version.txt)
updateToolLog="/Users/$currentUser/Library/Logs/RemoteUpdateManager.log"
updateToolLogDateFormat="%m/%d/%y %H:%M:%S"
#appNewVersion=$(curl -s -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15)" https://get.adobe.com/reader/ | grep ">Version" | sed -E 's/.*Version 20([0-9.]*)<.*/\1/g') # credit: Søren Theilgaard (@theilgaard)
expectedTeamID="JQ525L2MZD"
blockingProcesses=( "AdobeReader" )
Company=Adobe
PatchName=AcrobatReader
PatchSkip="YES"
;;

View File

@@ -3,8 +3,7 @@ adobereaderdc-install)
name="Adobe Acrobat Reader DC"
type="pkgInDmg"
packageID="com.adobe.acrobat.DC.reader.app.pkg.MUI"
#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)
downloadURL=$(adobecurrent=`curl --fail --silent https://armmf.adobe.com/arm-manifests/mac/AcrobatDC/reader/current_version.txt | tr -d '.'` && echo https://ardownload2.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)
appNewVersion=$(curl -s https://armmf.adobe.com/arm-manifests/mac/AcrobatDC/reader/current_version.txt)
#appNewVersion=$(curl -s -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15)" https://get.adobe.com/reader/ | grep ">Version" | sed -E 's/.*Version 20([0-9.]*)<.*/\1/g') # credit: Søren Theilgaard (@theilgaard)
expectedTeamID="JQ525L2MZD"

View File

@@ -1,12 +1,7 @@
amazoncorretto8jdk)
name="Amazon Corretto 8 JDK"
type="pkg"
if [[ $(arch) == "arm64" ]]; then
downloadURL="https://corretto.aws/downloads/latest/amazon-corretto-8-aarch64-macos-jdk.pkg"
appNewVersion=$(curl -s https://raw.githubusercontent.com/corretto/corretto-8/develop/CHANGELOG.md | grep "## Corretto version" | head -n 1 | awk '{ print $4; exit}')
elif [[ $(arch) == "i386" ]]; then
downloadURL="https://corretto.aws/downloads/latest/amazon-corretto-8-x64-macos-jdk.pkg"
appNewVersion=$(curl -s https://raw.githubusercontent.com/corretto/corretto-8/develop/CHANGELOG.md | grep "## Corretto version" | head -n 1 | awk '{ print $4; exit}')
fi
downloadURL="https://corretto.aws/downloads/latest/amazon-corretto-8-x64-macos-jdk.pkg"
appNewVersion=$(curl -s https://raw.githubusercontent.com/corretto/corretto-8/develop/CHANGELOG.md | grep "## Corretto version" | head -n 1 | awk '{ print $4; exit}')
expectedTeamID="94KV3E626L"
;;

View File

@@ -1,13 +0,0 @@
androidstudio)
name="Android Studio"
type="dmg"
if [[ $(arch) == arm64 ]]; then
downloadURL=$(curl -fsL "https://developer.android.com/studio#downloads" | grep -i arm.dmg | head -2 | grep -o -i -E "https.*" | cut -d '"' -f1)
appNewVersion=$( echo "${downloadURL}" | head -1 | sed 's/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*$/\1/' )
elif [[ $(arch) == i386 ]]; then
downloadURL=$(curl -fsL "https://developer.android.com/studio#downloads" | grep -i mac.dmg | head -2 | grep -o -i -E "https.*" | cut -d '"' -f1)
appNewVersion=$( echo "${downloadURL}" | head -1 | sed 's/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*$/\1/' )
fi
expectedTeamID="EQHXZ8M8AV"
blockingProcesses=( androidstudio )
;;

View File

@@ -1,10 +0,0 @@
archiwareb2go)
name="P5 Workstation"
type="pkgInDmg"
packageID="com.archiware.presstore"
appNewVersion=$(curl -sf https://www.archiware.com/download-p5 | grep -m 1 "ARCHIWARE P5 Version" | sed "s|.*Version \(.*\) -.*|\\1|")
downloadURL=$(appNrVersion=`sed 's/[^0-9]//g' <<< $appNewVersion` && echo https://p5-downloads.s3.amazonaws.com/awpst"$appNrVersion"-darwin.dmg)
pkgName=$(appNrVersion=`sed 's/[^0-9]//g' <<< $appNewVersion` && echo P5-Workstation-"$appNrVersion"-Install.pkg)
expectedTeamID="5H5EU6F965"
# blockingProcesses=( nsd )
;;

View File

@@ -1,10 +0,0 @@
archiwarepst)
name="P5"
type="pkgInDmg"
packageID="com.archiware.presstore"
appNewVersion=$(curl -sf https://www.archiware.com/download-p5 | grep -m 1 "ARCHIWARE P5 Version" | sed "s|.*Version \(.*\) -.*|\\1|")
downloadURL=$(appNrVersion=`sed 's/[^0-9]//g' <<< $appNewVersion` && echo https://p5-downloads.s3.amazonaws.com/awpst"$appNrVersion"-darwin.dmg)
pkgName=$(appNrVersion=`sed 's/[^0-9]//g' <<< $appNewVersion` && echo P5-"$appNrVersion"-Install.pkg)
expectedTeamID="5H5EU6F965"
# blockingProcesses=( nsd )
;;

View File

@@ -1,7 +0,0 @@
atextlegacy)
# credit: Gabe Marchan (gabemarchan.com - @darklink87)
name="aText"
type="dmg"
downloadURL="https://trankynam.com/atext/downloads/aTextLegacy.dmg"
expectedTeamID="KHEMQ2FD9E"
;;

View File

@@ -1,13 +1,7 @@
audacity)
name="Audacity"
type="dmg"
if [[ $(arch) == "arm64" ]]; then
archiveName="audacity-macOS-[0-9.]*-arm64.dmg"
downloadURL=$(downloadURLFromGit audacity audacity)
elif [[ $(arch) == "i386" ]]; then
archiveName="audacity-macOS-[0-9.]*-x86_64.dmg"
downloadURL=$(downloadURLFromGit audacity audacity)
fi
downloadURL=$(downloadURLFromGit audacity audacity)
appNewVersion=$(versionFromGit audacity audacity)
expectedTeamID="AWEYX923UX"
;;

View File

@@ -3,5 +3,5 @@ awsvpnclient)
type="pkg"
downloadURL="https://d20adtppz83p9s.cloudfront.net/OSX/latest/AWS_VPN_Client.pkg"
expectedTeamID="94KV3E626L"
#appNewVersion=$(curl -is "https://beta2.communitypatch.com/jamf/v1/ba1efae22ae74a9eb4e915c31fef5dd2/patch/AWSVPNClient" | grep currentVersion | tr ',' '\n' | grep currentVersion | cut -d '"' -f 4)
appNewVersion=$(curl -is "https://beta2.communitypatch.com/jamf/v1/ba1efae22ae74a9eb4e915c31fef5dd2/patch/AWSVPNClient" | grep currentVersion | tr ',' '\n' | grep currentVersion | cut -d '"' -f 4)
;;

View File

@@ -1,8 +0,0 @@
bitrix24)
name="Bitrix24"
type="dmg"
archiveName="bitrix24_desktop.dmg"
downloadURL="https://dl.bitrix24.com/b24/bitrix24_desktop.dmg"
expectedTeamID="5B3T3A994N"
blockingProcesses=( "Bitrix24" )
;;

View File

@@ -1,11 +1,7 @@
blender)
name="blender"
type="dmg"
if [[ $(arch) == "arm64" ]]; then
downloadURL=$(curl -sfL "https://www.blender.org/download/" | xmllint --html --format - 2>/dev/null | grep -o "https://.*blender.*arm64.*.dmg" | sed '2p;d' | sed 's/www.blender.org\/download/download.blender.org/g')
elif [[ $(arch) == "i386" ]]; then
downloadURL=$(curl -sfL "https://www.blender.org/download/" | xmllint --html --format - 2>/dev/null | grep -o "https://.*blender.*x64.*.dmg" | sed '2p;d' | sed 's/www.blender.org\/download/download.blender.org/g')
fi
downloadURL=$(redirect=$(curl -sfL https://www.blender.org/download/ | sed 's/.*href="//' | sed 's/".*//' | grep .dmg) && curl -sfL "$redirect" | sed 's/.*href="//' | sed 's/".*//' | grep -m1 .dmg)
appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)-.*/\1/g' )
expectedTeamID="68UA947AUU"
;;

View File

@@ -1,12 +0,0 @@
bluejeanswithaudiodriver)
name="BlueJeans"
type="pkg"
if [[ $(arch) == "arm64" ]]; then
downloadURL=$(curl -fs "https://www.bluejeans.com/downloads" | xmllint --html --format - 2>/dev/null | grep -o "https://.*BlueJeans.*Installer.*arm.*.pkg" )
elif [[ $(arch) == "i386" ]]; then
downloadURL=$(curl -fs "https://www.bluejeans.com/downloads" | xmllint --html --format - 2>/dev/null | grep -o "https://.*BlueJeansInstaller.*x86.*.dmg" | sed 's/dmg/pkg/g')
fi
appNewVersion=$(echo $downloadURL | cut -d '/' -f6)
choiceChangesXML='<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><array><dict><key>attributeSetting</key><integer>1</integer><key>choiceAttribute</key><string>selected</string><key>choiceIdentifier</key><string>com.tatvikmohit.BlueJeans-Audio</string></dict></array></plist>'
expectedTeamID="HE4P42JBGN"
;;

View File

@@ -2,6 +2,5 @@ boxtools)
name="Box Tools"
type="pkg"
downloadURL="https://box-installers.s3.amazonaws.com/boxedit/mac/currentrelease/BoxToolsInstaller.pkg"
packageID="com.box.boxtools.installer.boxedit"
expectedTeamID="M683GB7CPW"
;;

View File

@@ -1,8 +1,6 @@
camtasia|\
camtasia2021)
name="Camtasia 2021"
camtasia)
name="Camtasia 2020"
type="dmg"
downloadURL=$(curl -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" -fs "https://support.techsmith.com/hc/en-us/articles/360004908652-Desktop-Product-Download-Links" | grep -A 3 "Camtasia (Mac) 2021" | sed 's/.*href="//' | sed 's/".*//' | grep .dmg)
appNewVersion=$(curl -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" -fs "https://support.techsmith.com/hc/en-us/articles/360004908652-Desktop-Product-Download-Links" | grep "Camtasia (Mac) 2021" | sed -e 's/.*Camtasia (Mac) //' -e 's/<\/td>.*//')
downloadURL=https://download.techsmith.com/camtasiamac/releases/Camtasia.dmg
expectedTeamID="7TQL462TU8"
;;

View File

@@ -1,7 +0,0 @@
camtasia2019)
name="Camtasia 2019"
type="dmg"
downloadURL=$(curl -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" -fs "https://support.techsmith.com/hc/en-us/articles/360004908652-Desktop-Product-Download-Links" | grep -A 3 "Camtasia (Mac) 2019" | sed 's/.*href="//' | sed 's/".*//' | grep .dmg)
appNewVersion=$(curl -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" -fs "https://support.techsmith.com/hc/en-us/articles/360004908652-Desktop-Product-Download-Links" | grep "Camtasia (Mac) 2019" | sed -e 's/.*Camtasia (Mac) //' -e 's/<\/td>.*//')
expectedTeamID="7TQL462TU8"
;;

View File

@@ -1,7 +0,0 @@
camtasia2020)
name="Camtasia 2020"
type="dmg"
downloadURL=$(curl -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" -fs "https://support.techsmith.com/hc/en-us/articles/360004908652-Desktop-Product-Download-Links" | grep -A 3 "Camtasia (Mac) 2020" | sed 's/.*href="//' | sed 's/".*//' | grep .dmg)
appNewVersion=$(curl -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" -fs "https://support.techsmith.com/hc/en-us/articles/360004908652-Desktop-Product-Download-Links" | grep "Camtasia (Mac) 2020" | sed -e 's/.*Camtasia (Mac) //' -e 's/<\/td>.*//')
expectedTeamID="7TQL462TU8"
;;

View File

@@ -1,7 +0,0 @@
carboncopycloner)
name="Carbon Copy Cloner"
type="zip"
downloadURL=$(curl -fsIL "https://bombich.com/software/download_ccc.php?v=latest" | grep -i ^location | sed -E 's/.*(https.*\.zip).*/\1/g')
appNewVersion=$(sed -E 's/.*-([0-9.]*)\.zip/\1/g' <<< $downloadURL | sed 's/\.[^.]*$//')
expectedTeamID="L4F2DED5Q7"
;;

View File

@@ -1,7 +0,0 @@
charles)
name="Charles"
type="dmg"
appNewVersion=$(curl -fs https://www.charlesproxy.com/download/latest-release/ | sed -nE 's/.*version.*value="([^"]*).*/\1/p')
downloadURL="https://www.charlesproxy.com/assets/release/$appNewVersion/charles-proxy-$appNewVersion.dmg"
expectedTeamID="9A5PCU4FSD"
;;

View File

@@ -1,11 +0,0 @@
chronoagent)
name="ChronoAgent"
type="pkgInDmg"
# packageID="com.econtechnologies.preference.chronoagent"
# versionKey="CFBundleVersion"
# None of the above can read out the installed version
releaseURL="https://www.econtechnologies.com/UC/updatecheck.php?prod=ChronoAgent&lang=en&plat=mac&os=10.14.1&hw=i64&req=1&vers=#"
appNewVersion=$(curl -sf $releaseURL | sed -r 's/.*VERSION=([^<]+).*/\1/')
downloadURL="https://downloads.econtechnologies.com/CA_Mac_Download.dmg"
expectedTeamID="9U697UM7YX"
;;

View File

@@ -1,8 +0,0 @@
chronosync)
name="ChronoSync"
type="pkgInDmg"
releaseURL="https://www.econtechnologies.com/UC/updatecheck.php?prod=ChronoSync&lang=en&plat=mac&os=10.14.1&hw=i64&req=1&vers=#"
appNewVersion=$(curl -sf $releaseURL | sed -r 's/.*VERSION=([^<]+).*/\1/')
downloadURL="https://downloads.econtechnologies.com/CS4_Download.dmg"
expectedTeamID="9U697UM7YX"
;;

View File

@@ -3,6 +3,6 @@ citrixworkspace)
name="Citrix Workspace"
type="pkgInDmg"
downloadURL="https:"$(curl -s -L "https://www.citrix.com/downloads/workspace-app/mac/workspace-app-for-mac-latest.html#ctx-dl-eula-external" | grep "dmg?" | sed "s/.*rel=.\(.*\)..id=.*/\1/") # http://downloads.citrix.com/18823/CitrixWorkspaceApp.dmg?__gda__=1605791892_edc6786a90eb5197fb226861a8e27aa8
appNewVersion=$(curl -fs https://www.citrix.com/downloads/workspace-app/mac/workspace-app-for-mac-latest.html | grep "<p>Version" | head -1 | awk '{print $2}' | cut -d "." -f 1-3)
appNewVersion=$(curl -fs https://www.citrix.com/downloads/workspace-app/mac/workspace-app-for-mac-latest.html | grep "<p>Version" | head -1 | cut -d " " -f1 | cut -d ";" -f2 | cut -d "." -f 1-3)
expectedTeamID="S272Y5R93J"
;;

View File

@@ -1,8 +1,7 @@
clevershare2)
name="Clevershare"
type="dmg"
printlog "Label for $name broken in test" ERROR
downloadURL=$(curl -fs https://www.clevertouch.com/eu/clevershare2g | grep -i -o -E "https.*notarized.*\.dmg")
appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/([0-9.]*)\/[0-9]*\/.*\.dmg$/\1/')
downloadURL=$(curl -fs https://www.clevertouch.com/eu/clevershare2g | grep -i -o -E "https.*Mac.*\.dmg")
appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z-]*_Mac\.([0-9.]*)\.[0-9]*\.dmg$/\1/g' )
expectedTeamID="P76M9BE8DQ"
;;

View File

@@ -1,7 +1,7 @@
clickshare)
# credit: Søren Theilgaard (@theilgaard)
name="ClickShare"
type="appInDmgInZip"
downloadURL="https://www.barco.com$( curl -fs "https://www.barco.com/en/clickshare/app" | grep -A6 -i "macos" | grep -i "FileNumber" | tr '"' "\n" | grep -i "FileNumber" )"
appNewVersion="$(eval "$( echo $downloadURL | sed -E 's/.*(MajorVersion.*BuildVersion=[0-9]*).*/\1/' | sed 's/&amp//g' )" ; ((MajorVersion++)) ; ((MajorVersion--)); ((MinorVersion++)) ; ((MinorVersion--)); ((PatchVersion++)) ; ((PatchVersion--)); ((BuildVersion++)) ; ((BuildVersion--)); echo "${MajorVersion}.${MinorVersion}.${PatchVersion}-b${BuildVersion}")"
downloadURL=https://www.barco.com$(curl -fs "https://www.barco.com/en/clickshare/app" | grep -E -o '(\/\S*Download\?FileNumber=R3306192\S*ShowDownloadPage=False)' | tail -1)
expectedTeamID="P6CDJZR997"
;;

View File

@@ -1,9 +0,0 @@
clue)
#For personal use and students
name="Clue"
type="dmg"
downloadURL=$(curl -fsL https://clue.no/en/download | grep "For personal use and students:" | sed 's/.*href="//' | sed 's/".*//')
appNewVersion="$(echo "${downloadURL}" | sed -E 's/.*Clue*([0-9.]*)\..*/\1/g')"
versionKey="CFBundleVersion"
expectedTeamID="3NX6B9TB2F"
;;

View File

@@ -1,9 +0,0 @@
cluefull)
#For companies and schools
name="Clue"
type="dmg"
downloadURL=$(curl -fsL https://clue.no/en/download | grep "For companies and schools:" | sed 's/.*href="//' | sed 's/".*//')
appNewVersion="$(echo "${downloadURL}" | sed -E 's/.*Clue*([0-9.]*)\F.*/\1/g')"
versionKey="CFBundleVersion"
expectedTeamID="3NX6B9TB2F"
;;

View File

@@ -1,7 +0,0 @@
cocoapods)
name="CocoaPods"
type="bz2"
downloadURL="$(downloadURLFromGit CocoaPods CocoaPods-app)"
appNewVersion="$(versionFromGit CocoaPods CocoaPods-app)"
expectedTeamID="AX2Q2BH2XR"
;;

View File

@@ -1,7 +0,0 @@
coconutbattery)
name="coconutBattery"
type="zip"
downloadURL="https://coconut-flavour.com/downloads/coconutBattery_latest.zip"
appNewVersion=$(curl -fs https://www.coconut-flavour.com/coconutbattery/ | grep "<title>" | sed -e 's/.*coconutBattery \(.*\) - by coconut-flavour.co.*/\1/')
expectedTeamID="R5SC3K86L5"
;;

View File

@@ -1,7 +1,7 @@
coderunner)
# credit: Erik Stam (@erikstam)
name="CodeRunner"
type="zip"
downloadURL="https://coderunnerapp.com/download"
appNewVersion=$(curl -fsIL ${downloadURL} | grep -i "^location" | cut -d " " -f2 | sed -E 's/.*CodeRunner-([0-9.]*).zip/\1/')
expectedTeamID="R4GD98AJF9"
;;

View File

@@ -1,5 +1,5 @@
colourcontrastanalyser)
name="Colour Contrast Analyser"
name="Colour Contrast Analyser (CCA)"
type="dmg"
downloadURL=$(downloadURLFromGit ThePacielloGroup CCAe)
appNewVersion=$(versionFromGit ThePacielloGroup CCAe)

View File

@@ -1,7 +0,0 @@
craftmanagerforsketch)
name="CraftManager"
type="zip"
downloadURL="https://craft-assets.invisionapp.com/CraftManager/production/CraftManager.zip"
appNewVersion=$(curl -fs https://craft-assets.invisionapp.com/CraftManager/production/appcast.xml | xpath '//rss/channel/item[1]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f2)
expectedTeamID="VRXQSNCL5W"
;;

View File

@@ -1,7 +0,0 @@
cricutdesignspace)
name="Cricut Design Space"
type="dmg"
appNewVersion=$(getJSONValue "$(curl -fsL https://s3-us-west-2.amazonaws.com/staticcontent.cricut.com/a/software/osx-native/latest.json)" "rolloutVersion")
downloadURL=$(getJSONValue $(curl -fsL "https://apis.cricut.com/desktopdownload/InstallerFile?shard=a&operatingSystem=osxnative&fileName=CricutDesignSpace-Install-v${appNewVersion}.dmg") "result")
expectedTeamID="25627ZFVT7"
;;

View File

@@ -1,12 +1,6 @@
cryptomator)
name="Cryptomator"
type="dmg"
if [[ $(arch) == "arm64" ]]; then
archiveName="Cryptomator-[0-9.]*-arm64.dmg"
elif [[ $(arch) == "i386" ]]; then
archiveName="Cryptomator-[0-9.]*.dmg"
fi
downloadURL=$(downloadURLFromGit cryptomator cryptomator)
appNewVersion=$(versionFromGit cryptomator cryptomator)
expectedTeamID="YZQJQUHA3L"

View File

@@ -1,11 +0,0 @@
cytoscape)
name="Cytoscape"
#appName="Cytoscape Installer.app"
type="dmg"
downloadURL="$(downloadURLFromGit cytoscape cytoscape)"
appNewVersion="$(versionFromGit cytoscape cytoscape)"
installerTool="Cytoscape Installer.app"
CLIInstaller="Cytoscape Installer.app/Contents/MacOS/JavaApplicationStub"
CLIArguments=(-q)
expectedTeamID="35LDCJ33QT"
;;

View File

@@ -1,7 +1,7 @@
dangerzone)
name="Dangerzone"
type="dmg"
downloadURL="$(downloadURLFromGit freedomofpress dangerzone)"
appNewVersion="$(versionFromGit freedomofpress dangerzone)"
downloadURL="$(downloadURLFromGit firstlookmedia dangerzone)"
appNewVersion="$(versionFromGit firstlookmedia dangerzone)"
expectedTeamID="N9B95FDWH4"
;;

View File

@@ -1,13 +1,7 @@
dbeaverce)
name="DBeaver"
type="dmg"
if [[ $(arch) == "arm64" ]]; then
downloadURL="https://dbeaver.io/files/dbeaver-ce-latest-macos-aarch64.dmg"
appNewVersion="$(curl -fsIL "${downloadURL}" | grep -i ^location | sed 's/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/' | head -1)"
elif [[ $(arch) == "i386" ]]; then
downloadURL="https://dbeaver.io/files/dbeaver-ce-latest-macos.dmg"
appNewVersion="$(curl -fsIL "${downloadURL}" | grep -i ^location | sed 's/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/' | head -1)"
fi
downloadURL="https://dbeaver.io/files/dbeaver-ce-latest-macos.dmg"
expectedTeamID="42B6MDKMW8"
blockingProcesses=( dbeaver )
;;

View File

@@ -1,8 +0,0 @@
displaylinkmanager)
name="DisplayLink Manager"
type="pkg"
#packageID="com.displaylink.displaylinkmanagerapp"
downloadURL=https://www.synaptics.com$(redirect=$(curl -sfL https://www.synaptics.com/products/displaylink-graphics/downloads/macos | grep 'class="download-link">Download' | head -n 1 | sed 's/.*href="//' | sed 's/".*//') && curl -sfL "https://www.synaptics.com$redirect" | grep Accept | head -n 1 | sed 's/.*href="//' | sed 's/".*//')
appNewVersion=$(curl -sfL https://www.synaptics.com/products/displaylink-graphics/downloads/macos | grep "Release:" | head -n 1 | cut -d ' ' -f2)
expectedTeamID="73YQY62QM3"
;;

View File

@@ -1,9 +0,0 @@
drawio)
name="draw.io"
type="dmg"
archiveName="draw.io-universal-[0-9.]*.dmg$"
downloadURL="$(downloadURLFromGit jgraph drawio-desktop)"
appNewVersion="$(versionFromGit jgraph drawio-desktop)"
expectedTeamID="UZEUFB4N53"
blockingProcesses=( draw.io )
;;

View File

@@ -2,6 +2,5 @@ dropbox)
name="Dropbox"
type="dmg"
downloadURL="https://www.dropbox.com/download?plat=mac&full=1"
appNewVersion=$(curl -fsIL "$downloadURL" | grep -i "^location" | sed -E 's/.*%20([0-9.]*)\.dmg/\1/g')
expectedTeamID="G7HH3F8CAK"
;;

View File

@@ -1,10 +0,0 @@
duckduckgo)
name="DuckDuckGo"
type="dmg"
#downloadURL="https://staticcdn.duckduckgo.com/macos-desktop-browser/duckduckgo.dmg"
downloadURL=$(curl -fs https://staticcdn.duckduckgo.com/macos-desktop-browser/appcast.xml | xpath '(//rss/channel/item/enclosure/@url)[last()]' 2>/dev/null | cut -d '"' -f2)
#downloadURL=$(curl -fs https://staticcdn.duckduckgo.com/macos-desktop-browser/appcast.xml | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | cut -d '"' -f2)
appNewVersion=$(curl -fs https://staticcdn.duckduckgo.com/macos-desktop-browser/appcast.xml | xpath '(//rss/channel/item/enclosure/@sparkle:version)[last()]' 2>/dev/null | cut -d '"' -f2)
#appNewVersion=$(curl -fs https://staticcdn.duckduckgo.com/macos-desktop-browser/appcast.xml | xpath '(//rss/channel/item/sparkle:shortVersionString)[1]' 2>/dev/null | cut -d ">" -f2 | cut -d "<" -f1)
expectedTeamID="HKE973VLUW"
;;

View File

@@ -1,9 +0,0 @@
duodevicehealth)
name="Duo Device Health"
type="pkgInDmg"
downloadURL="https://dl.duosecurity.com/DuoDeviceHealth-latest.dmg"
appNewVersion=$(curl -fsLIXGET "https://dl.duosecurity.com/DuoDeviceHealth-latest.dmg" | grep -i "^content-disposition" | sed -e 's/.*filename\=\"DuoDeviceHealth\-\(.*\)\.dmg\".*/\1/')
appName="Duo Device Health.app"
expectedTeamID="FNN8Z5JMFP"
;;

View File

@@ -1,7 +0,0 @@
dynalist)
name="Dynalist"
type="dmg"
downloadURL="https://dynalist.io/standalone/download?file=Dynalist.dmg"
appNewVersion=""
expectedTeamID="6JSW4SJWN9"
;;

View File

@@ -3,7 +3,6 @@ egnyte)
name="Egnyte Connect"
type="pkg"
downloadURL="https://egnyte-cdn.egnyte.com/egnytedrive/mac/en-us/latest/EgnyteConnectMac.pkg"
appNewVersion=$(curl -fs "https://egnyte-cdn.egnyte.com/egnytedrive/mac/en-us/versions/default.xml" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' | cut -d '"' -f 2)
expectedTeamID="FELUD555VC"
blockingProcesses=( NONE )
;;

Some files were not shown because too many files have changed in this diff Show More