diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bc345c..28868c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,63 @@ +## 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 diff --git a/Installomator.sh b/Installomator.sh index 53f45f3..7d99648 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -322,8 +322,8 @@ if [[ $(/usr/bin/arch) == "arm64" ]]; then rosetta2=no fi fi -VERSION="10.0beta2" -VERSIONDATE="2022-09-02" +VERSION="10.0beta3" +VERSIONDATE="2022-10-03" # MARK: Functions @@ -489,11 +489,19 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name fi if [ -n "$archiveName" ]; then - #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }") - downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*$archiveName" | head -1) + 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 else - #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") - downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1) + 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 fi if [ -z "$downloadURL" ]; then cleanupAndExit 14 "could not retrieve download URL for $gitusername/$gitreponame" ERROR @@ -612,6 +620,10 @@ getAppVersion() { printlog "Replacing App Store apps, no matter the version" WARN 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 fi fi @@ -789,6 +801,10 @@ 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." @@ -955,6 +971,10 @@ 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." @@ -1557,6 +1577,15 @@ remotixagent) 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 ) + ;; +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" ;; adobebrackets) name="Brackets" @@ -1577,30 +1606,98 @@ adobeconnect) ;; adobecreativeclouddesktop) name="Adobe Creative Cloud" - #appName="Install.app" + appName="Install.app" type="dmg" - adobeurl="https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" - if [[ $(arch) == "arm64" ]]; then - downloadURL=$(curl -fs "$adobeurl" | xmllint -html -xpath "string(//a[contains(@href,'osx10')][contains(text(),'Download')]/@href)" - 2> /dev/null) - elif [[ $(arch) == "i386" ]]; then - downloadURL=$(curl -fs "$adobeurl" | xmllint -html -xpath "string(//a[contains(@href,'macarm64')][contains(text(),'Download')]/@href)" - 2> /dev/null) + 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 fi - #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) + 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/" installerTool="Install.app" CLIInstaller="Install.app/Contents/MacOS/Install" CLIArguments=(--mode=silent) expectedTeamID="JQ525L2MZD" + blockingProcesses=( "Creative Cloud" ) Company="Adobe" ;; +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" + ;; adobereaderdc-update) name="Adobe Acrobat Reader DC" type="pkgInDmg" - downloadURL=$(adobecurrent=`curl --fail --silent https://armmf.adobe.com/arm-manifests/mac/AcrobatDC/reader/current_version.txt | tr -d '.'` && echo https://ardownload2.adobe.com/pub/adobe/reader/mac/AcrobatDC/"$adobecurrent"/AcroRdrDC_"$adobecurrent"_MUI.dmg) + 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 ) 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) + updateToolLog="/Users/$currentUser/Library/Logs/RemoteUpdateManager.log" + updateToolLogDateFormat="%m/%d/%y %H:%M:%S" expectedTeamID="JQ525L2MZD" blockingProcesses=( "AdobeReader" ) + Company=Adobe + PatchName=AcrobatReader + PatchSkip="YES" ;; adobereaderdc|\ adobereaderdc-install) @@ -1785,6 +1882,26 @@ aquaskk) appNewVersion=$(versionFromGit codefirst aquaskk) expectedTeamID="FPZK4WRGW7" ;; +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 ) + ;; +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 ) + ;; arq7) name="Arq7" type="pkg" @@ -1825,7 +1942,13 @@ atom) audacity) name="Audacity" type="dmg" - downloadURL=$(downloadURLFromGit audacity audacity) + 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 appNewVersion=$(versionFromGit audacity audacity) expectedTeamID="AWEYX923UX" ;; @@ -1942,6 +2065,14 @@ bettertouchtool) appNewVersion=$(curl -fs https://updates.folivora.ai/bettertouchtool_release_notes.html | grep BetterTouchTool | head -n 2 | tail -n 1 | sed -E 's/.* ([0-9\.]*) .*/\1/g') expectedTeamID="DAFVSXZ82P" ;; +bitrix24) + name="Bitrix24" + type="dmg" + archiveName="bitrix24_desktop.dmg" + downloadURL="https://dl.bitrix24.com/b24/bitrix24_desktop.dmg" + expectedTeamID="5B3T3A994N" + blockingProcesses=( "Bitrix24" ) + ;; bitwarden) name="Bitwarden" type="dmg" @@ -2111,12 +2242,38 @@ carboncopycloner) appNewVersion=$(sed -E 's/.*-([0-9.]*)\.zip/\1/g' <<< $downloadURL | sed 's/\.[^.]*$//') expectedTeamID="L4F2DED5Q7" ;; +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" + ;; chatwork) name="Chatwork" type="dmg" downloadURL="https://desktop-app.chatwork.com/installer/Chatwork.dmg" expectedTeamID="H34A3H2Y54" ;; +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" + ;; +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" + ;; cisdem-documentreader) name="cisdem-documentreader" type="dmg" @@ -2276,6 +2433,17 @@ cyberduck) appNewVersion=$(curl -fs https://version.cyberduck.io/changelog.rss | xpath '//rss/channel/item/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 ) expectedTeamID="G69SCX94XU" ;; +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" + ;; daisydisk) name="DaisyDisk" type="zip" @@ -2444,10 +2612,10 @@ 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) + 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" ;; duodevicehealth) @@ -2490,6 +2658,15 @@ egnyte) expectedTeamID="FELUD555VC" blockingProcesses=( NONE ) ;; +egnytecore) + name="Egnyte Core" + appName="Egnyte.app" + type="dmg" + downloadURL=$(curl -fs "https://egnyte-cdn.egnyte.com/desktopapp/mac/en-us/versions/default.xml" | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | cut -d '"' -f 2) + appNewVersion=$(curl -fs "https://egnyte-cdn.egnyte.com/desktopapp/mac/en-us/versions/default.xml" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | cut -d '"' -f 2) + expectedTeamID="FELUD555VC" + blockingProcesses=( NONE ) + ;; egnytewebedit) name="EgnyteWebEdit" type="pkg" @@ -2603,6 +2780,14 @@ figma) appNewVersion="$(curl -fsL https://desktop.figma.com/mac/RELEASE.json | awk -F '"' '{ print $8 }')" expectedTeamID="T8RA8NE3B7" ;; +filemakerpro) + name="FileMaker Pro" + type="dmg" + versionKey="BuildVersion" + downloadURL=$(curl -fs https://www.filemaker.com/redirects/ss.txt | grep '\"PRO..MAC\"' | tail -1 | sed "s|.*url\":\"\(.*\)\".*|\\1|") + appNewVersion=$(curl -fs https://www.filemaker.com/redirects/ss.txt | grep '\"PRO..MAC\"' | tail -1 | sed "s|.*fmp_\(.*\).dmg.*|\\1|") + expectedTeamID="J6K4T76U7W" + ;; filezilla) name="FileZilla" type="tbz" @@ -2796,6 +2981,20 @@ fsmonitor) downloadURL=$(curl --location --fail --silent "https://fsmonitor.com/FSMonitor/Archives/appcast2.xml" | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2) expectedTeamID="V85GBYB7B9" ;; +fujifilmwebcam) + name="FUJIFILM X Webcam 2" + type="pkg" + downloadURL=$(curl -fs "https://fujifilm-x.com/en-us/support/download/software/x-webcam/" | grep "https.*pkg" | sed -E 's/.*(https:\/\/dl.fujifilm-x\.com\/support\/software\/.*\.pkg[^\<]).*/\1/g' | sed -e 's/^"//' -e 's/"$//') + appNewVersion=$( echo “${downloadURL}” | sed -E 's/.*XWebcamIns([0-9]*).*/\1/g' | sed -E 's/([0-9])([0-9]).*/\1\.\2/g') + expectedTeamID="34LRP8AV2M" + ;; +gfxcardstatus) + name="gfxCardStatus" + type="zip" + downloadURL="$(downloadURLFromGit codykrieger gfxCardStatus)" + appNewVersion="$(versionFromGit codykrieger gfxCardStatus)" + expectedTeamID="LF22FTQC25" + ;; gimp) name="GIMP-2.10" type="dmg" @@ -2999,6 +3198,20 @@ hazel) appNewVersion=$(curl -fsI https://www.noodlesoft.com/Products/Hazel/download | grep -i "^location" | awk '{print $2}' | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') expectedTeamID="86Z3GCJ4MF" ;; +horos) + name="Horos" + type="dmg" + versionKey="CFBundleGetInfoString" + appNewVersion=$(curl -fs https://github.com/horosproject/horos/blob/horos/Horos/Info.plist | grep -A 4 "CFBundleGetInfoString" | tail -1 | sed -r 's/.*Horos v([^<]+).*/\1/' | sed 's/ //g') + if [[ $(arch) == "arm64" ]]; then + downloadURL="https://horosproject.org/horos-content/Horos"$appNewVersion"_Apple.dmg" + TeamID="8NDFEW7285" + elif [[ $(arch) == "i386" ]]; then + downloadURL="https://horosproject.org/horos-content/Horos"$appNewVersion".dmg" + TeamID="TPT6TVH8UY" + fi + expectedTeamID=$TeamID + ;; houdahspot) name="HoudahSpot" type="zip" @@ -3096,6 +3309,15 @@ imazingprofileeditor) downloadURL="https://downloads.imazing.com/mac/iMazing-Profile-Editor/iMazingProfileEditorMac.dmg" expectedTeamID="J5PR93692Y" ;; +inetclearreportsdesigner) + name="i-Net Clear Reports Designer" + type="appindmg" + appNewVersion=$(curl -s https://www.inetsoftware.de/products/clear-reports/designer | grep "Latest release:" | cut -d ">" -f 4 | cut -d \ -f 2) + downloadURL=$(curl -s https://www.inetsoftware.de/products/clear-reports/designer | grep $appNewVersion | grep dmg | cut -d ">" -f 12 | cut -d \" -f 2) + expectedTeamID="9S2Y97K3D9" + blockingProcesses=( "clear-reports-designer" ) + #forcefulQuit=YES + ;; inkscape) # credit: Søren Theilgaard (@theilgaard) name="Inkscape" @@ -3201,6 +3423,19 @@ jamfreenroller) #appNewVersion=$(versionFromGit jamf ReEnroller) expectedTeamID="PS2F6S478M" ;; +jdk18) + name="Java SE Development Kit 18" + type="pkgInDmg" + versionKey="CFBundleShortVersionString" + if [[ $(arch) == "arm64" ]]; then + downloadURL="https://download.oracle.com/java/18/latest/jdk-18_macos-aarch64_bin.dmg" + elif [[ $(arch) == "i386" ]]; then + downloadURL="https://download.oracle.com/java/18/latest/jdk-18_macos-x64_bin.dmg" + fi + appCustomVersion(){ java --version | grep java | awk '{print $2}' } + appNewVersion=$(curl -sf "https://www.oracle.com/java/technologies/downloads/#jdk18-mac" | grep -m 1 "Java SE Development Kit" | sed "s|.*Kit \(.*\) downloads.*|\\1|") + expectedTeamID="VB5E2TV963" + ;; jetbrainsclion) name="CLion" type="dmg" @@ -3430,6 +3665,13 @@ lastpass) expectedTeamID="N24REP3BMN" Company="Marvasol, Inc DBA LastPass" ;; +latexit) + name="LaTeXiT" + type="dmg" + downloadURL="$(curl -fs "https://pierre.chachatelier.fr/latexit/downloads/latexit-sparkle-en.rss" | xpath '(//rss/channel/item/enclosure/@url)[last()]' 2>/dev/null | cut -d '"' -f 2)" + appNewVersion="$(curl -fs "https://pierre.chachatelier.fr/latexit/downloads/latexit-sparkle-en.rss" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[last()]' 2>/dev/null | cut -d '"' -f 2)" + expectedTeamID="7SFX84GNR7" + ;; launchbar) name="LaunchBar" type="dmg" @@ -3454,11 +3696,14 @@ libreoffice) name="LibreOffice" type="dmg" if [[ $(arch) == "arm64" ]]; then - arch_type="aarch64" + releaseURL="https://downloadarchive.documentfoundation.org/libreoffice/old/latest/mac/aarch64/" + appNewVersion=$(curl -sf $releaseURL | grep -m 1 "_MacOS_aarch64.dmg" | sed "s|.*LibreOffice_\(.*\)_MacOS.*|\\1|") + downloadURL="https://downloadarchive.documentfoundation.org/libreoffice/old/latest/mac/aarch64/LibreOffice_"$appNewVersion"_MacOS_aarch64.dmg" + elif [[ $(arch) == "i386" ]]; then + releaseURL="https://downloadarchive.documentfoundation.org/libreoffice/old/latest/mac/x86_64/" + appNewVersion=$(curl -sf $releaseURL | grep -m 1 "_MacOS_x86-64.dmg" | sed "s|.*LibreOffice_\(.*\)_MacOS.*|\\1|") + downloadURL="https://downloadarchive.documentfoundation.org/libreoffice/old/latest/mac/x86_64/LibreOffice_"$appNewVersion"_MacOS_x86-64.dmg" fi - libreoffice_latest_version="$(curl -Ls https://www.libreoffice.org/download/download-libreoffice/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)" - downloadURL="https://download.documentfoundation.org/libreoffice/stable/${libreoffice_latest_version}/mac/${arch_type:-x86_64}/LibreOffice_${libreoffice_latest_version}_MacOS_${arch_type:-x86-64}.dmg" - appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*_([0-9.]*)_.*/\1/g') expectedTeamID="7P5S3ZLCN7" blockingProcesses=( soffice ) ;; @@ -4147,10 +4392,21 @@ notion) nudge) name="Nudge" type="pkg" + archiveName="Nudge-[0-9.]*.pkg" downloadURL=$(downloadURLFromGit macadmins Nudge ) appNewVersion=$(versionFromGit macadmins Nudge ) expectedTeamID="9GQZ7KUFR6" - archiveName="Nudge-[0-9.]*.pkg" + + ;; +nudgesuite) + name="Nudge Suite" + appName="Nudge.app" + type="pkg" + archiveName="Nudge_Suite-[0-9.]*.pkg" + downloadURL=$(downloadURLFromGit macadmins Nudge ) + appNewVersion=$(versionFromGit macadmins Nudge ) + expectedTeamID="9GQZ7KUFR6" + blockingProcesses=( "Nudge" ) ;; nvivo) name="NVivo" @@ -4161,10 +4417,15 @@ nvivo) blockingProcesses=( NVivo NVivoHelper ) ;; obs) - # credit: Gabe Marchan (gabemarchan.com - @darklink87) name="OBS" type="dmg" - downloadURL=$(curl -fs "https://obsproject.com/download" | awk -F '"' "/dmg/ {print \$10}") + if [[ $(arch) == "arm64" ]]; then + archiveName="obs-studio-[0-9.]*-macos-arm64.dmg" + elif [[ $(arch) == "i386" ]]; then + archiveName="obs-studio-[0-9.]*-macos-x86_64.dmg" + fi + downloadURL=$(downloadURLFromGit obsproject obs-studio ) + appNewVersion=$(versionFromGit obsproject obs-studio ) expectedTeamID="2MMRE5MTB8" ;; obsidian) @@ -4282,6 +4543,13 @@ opera) versionKey="CFBundleVersion" expectedTeamID="A2P9LX4JPN" ;; +origin) + name="Origin" + type="dmg" + downloadURL="https://www.dm.origin.com/mac/download/Origin.dmg" + expectedTeamID="TSTV75T6Q5" + blockingProcesses=( "Origin" ) + ;; ottomatic) name="Otto Matic" type="dmg" @@ -4321,6 +4589,13 @@ pandoc) archiveName="mac.pkg" expectedTeamID="5U2WKE6DES" ;; +parallelsrasclient) + name="Parallels Client" + type="pkg" + appNewVersion=$(curl -sf "https://download.parallels.com/ras/v18/RAS%20Client%20for%20Mac%20Changelog.txt" | grep -m 1 "Parallels Client for Mac Version" | sed "s|.*Version \(.*\) -.*|\\1|" | sed 's/ /./g' | sed 's/[^0-9.]//g') + downloadURL=$(appMajorVersion=`sed 's/\..*//' <<< $appNewVersion` && appHyphenVersion=`curl -sf "https://download.parallels.com/ras/v18/RAS%20Client%20for%20Mac%20Changelog.txt" | grep -m 1 "Parallels Client for Mac Version" | sed "s|.*Version \(.*\) -.*|\\1|" | sed 's/ /-/g' | sed 's/[^0-9.-]//g'` && echo https://download.parallels.com/ras/v"$appMajorVersion"/"$appNewVersion"/RasClient-Mac-Notarized-"$appHyphenVersion".pkg) + expectedTeamID="4C6364ACXT" + ;; paretosecurity) name="Pareto Security" type="dmg" @@ -4383,6 +4658,13 @@ plisteditpro) downloadURL="https://www.fatcatsoftware.com/plisteditpro/PlistEditPro.zip" expectedTeamID="8NQ43ND65V" ;; +polylens) + name="Poly Lens" + type="dmg" + appNewVersion=$(curl -fs "https://info.lens.poly.com/lens-dt-rn/atom.xml" | grep "Version" | head -1 | cut -d "[" -f3 | sed 's/Version //g' | sed 's/]]\>\<\/title\>//g') + downloadURL="https://swupdate.lens.poly.com/lens-desktop-mac/$appNewVersion/$appNewVersion/PolyLens-$appNewVersion.dmg" + expectedTeamID="SKWK2Q7JJV" + ;; postman) name="Postman" type="zip" @@ -4484,8 +4766,13 @@ qgis-pr) r) name="R" type="pkg" - downloadURL="https://cloud.r-project.org/bin/macosx/$( curl -fsL https://cloud.r-project.org/bin/macosx/ | grep -m 1 -o '' | sed -E 's/.+"(.+)".+/\1/g' )" - appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') + if [[ $(arch) == "arm64" ]]; then + downloadURL="https://cloud.r-project.org/bin/macosx/$( curl -fsL https://cloud.r-project.org/bin/macosx/ | grep -m 1 -o '' | sed -E 's/.+"(.+)".+/\1/g' )" + appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)-.*\..*/\1/g') + elif [[ $(arch) == "i386" ]]; then + downloadURL="https://cloud.r-project.org/bin/macosx/$( curl -fsL https://cloud.r-project.org/bin/macosx/ | grep -o '' | grep -m 1 -v "arm64" | sed -E 's/.+"(.+)".+/\1/g' )" + appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') + fi expectedTeamID="VZLD955F6P" ;; ramboxce) @@ -4635,7 +4922,7 @@ rstudio) name="RStudio" type="dmg" downloadURL=$(curl -s -L "https://rstudio.com/products/rstudio/download/" | grep -m 1 -Eio 'href="https://download1.rstudio.org/desktop/macos/RStudio-(.*).dmg"' | cut -c7- | sed -e 's/"$//') - appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g' ) + appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.-]*)\..*/\1/g' | sed 's/-/+/' ) expectedTeamID="FYF2F5GFX4" ;; santa) @@ -4658,7 +4945,12 @@ scaleft) screamingfrogseospider) name="Screaming Frog SEO Spider" type="dmg" - downloadURL=$(curl -fs "https://www.screamingfrog.co.uk/wp-content/themes/screamingfrog/inc/download-modal.php" | grep -i -o "https.*\.dmg" | head -1) + if [[ $(arch) == i386 ]]; then + platform="Mac - (intel)" + elif [[ $(arch) == arm64 ]]; then + platform="Mac - (apple silicon)" + fi + downloadURL=$(curl -fs "https://www.screamingfrog.co.uk/wp-content/themes/screamingfrog/inc/download-modal.php" | grep "${platform}" | grep -i -o "https.*\.dmg" | head -1) appNewVersion=$(print "$downloadURL" | sed -E 's/https.*\/[a-zA-Z]*-([0-9.]*)\.dmg/\1/g')".0" expectedTeamID="CAHEVC3HZC" ;; @@ -4875,6 +5167,14 @@ sourcetree) appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/Sourcetree_([0-9.]*)_[0-9]*\.zip/\1/g') expectedTeamID="UPXU4CQZ5P" ;; +splashtopbusiness) + name="Splashtop Business" + type="pkgInDmg" + splashtopbusinessVersions=$(curl -fsL "https://www.splashtop.com/wp-content/themes/responsive/downloadx.php?product=stb&platform=mac-client") + downloadURL=$(getJSONValue "$splashtopbusinessVersions" "url") + appNewVersion="${${downloadURL#*INSTALLER_v}%*.dmg}" + expectedTeamID="CPQQ3AW49Y" + ;; splashtopsos) name="Splashtop SOS" type="dmg" @@ -5026,6 +5326,14 @@ tageditor) appNewVersion=$(curl -sf "https://amvidia.com/tag-editor" | grep -o -E '"softwareVersion":.'"{8}" | sed -E 's/.*"([0-9.]*).*/\1/g') expectedTeamID="F2TH9XX9CJ" ;; +tailscale) + name="Tailscale" + type="zip" + appNewVersion="$(curl -s https://pkgs.tailscale.com/stable/ | awk -F- '/Tailscale.*macos.zip/ {print $2}')" + downloadURL="https://pkgs.tailscale.com/stable/Tailscale-${appNewVersion}-macos.zip" + expectedTeamID="W5364U7YZB" + versionKey="CFBundleShortVersionString" + ;; talkdeskcallbar) name="Callbar" type="dmg" @@ -5341,11 +5649,12 @@ vlc) type="dmg" if [[ $(arch) == "arm64" ]]; then downloadURL=$(curl -fs http://update.videolan.org/vlc/sparkle/vlc-arm64.xml | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2 ) - appNewVersion=$(curl -fs http://update.videolan.org/vlc/sparkle/vlc-arm64.xml | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2 ) + #appNewVersion=$(curl -fs http://update.videolan.org/vlc/sparkle/vlc-arm64.xml | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2 ) elif [[ $(arch) == "i386" ]]; then downloadURL=$(curl -fs http://update.videolan.org/vlc/sparkle/vlc-intel64.xml | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2 ) - appNewVersion=$(curl -fs http://update.videolan.org/vlc/sparkle/vlc-intel64.xml | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2 ) + #appNewVersion=$(curl -fs http://update.videolan.org/vlc/sparkle/vlc-intel64.xml | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2 ) fi + appNewVersion=$(echo ${downloadURL} | sed -E 's/.*\/vlc-([0-9.]*).*\.dmg/\1/' ) expectedTeamID="75GAHG3SZQ" ;; vmwarehorizonclient) @@ -5451,13 +5760,16 @@ wwdc) ;; xcreds) name="XCreds" - #type="pkgInZip" + # Downloading from twocanoes homepage + #type="pkgInDmg" #packageID="com.twocanoes.pkg.secureremoteaccess" #downloadURL=$(curl -fs "https://twocanoes.com/products/mac/xcreds/" | grep -ioE "https://.*\.zip" | head -1) #appNewVersion=$(curl -fs "https://twocanoes.com/products/mac/xcreds/" | grep -io "Current Version:.*" | sed -E 's/.*XCreds *([0-9.]*)<.*/\1/g') + # GitHub download type="pkg" downloadURL="$(downloadURLFromGit twocanoes xcreds)" - appNewVersion="$(versionFromGit twocanoes xcreds)" + #appNewVersion="$(versionFromGit twocanoes xcreds)" # GitHub tag contain “_” and not “.” so our function fails to get the right version + appNewVersion=$(echo "$downloadURL" | sed -E 's/.*XCreds_.*-([0-9.]*)\.pkg/\1/') expectedTeamID="UXP6YEHSPW" ;; xeroxphaser7800) @@ -5588,6 +5900,16 @@ zoomgov) expectedTeamID="BJ4HAAB9B3" versionKey="CFBundleVersion" ;; +zoomoutlookplugin) + name="Zoom Outlook Plugin" + appName="PluginLauncher.app" + targetDir="/Applications/ZoomOutlookPlugin" + type="pkg" + downloadURL="https://zoom.us/client/latest/ZoomMacOutlookPlugin.pkg" + appNewVersion="$(curl -fsIL ${downloadURL} | grep -i ^location | cut -d "/" -f5 | cut -d "." -f1-3)" + expectedTeamID="BJ4HAAB9B3" + blockingProcesses=( "PluginLauncher" ) + ;; zoomrooms) name="ZoomRooms" type="pkg" @@ -5597,6 +5919,14 @@ zoomrooms) expectedTeamID="BJ4HAAB9B3" blockingProcesses=( "ZoomPresence" ) ;; +zotero) + name="Zotero" + type="dmg" + downloadURL="https://www.zotero.org/download/client/dl?channel=release&platform=mac&version=$(curl -fs "https://www.zotero.org/download/" | grep -Eio '"mac":"(.*)' | cut -d '"' -f 4)" + expectedTeamID="8LAYR367YV" + appNewVersion=$(curl -fs "https://www.zotero.org/download/" | grep -Eio '"mac":"(.*)' | cut -d '"' -f 4) + #Company="Corporation for Digital Scholarship" + ;; zulujdk11) name="Zulu JDK 11" type="pkgInDmg" @@ -5649,6 +5979,19 @@ zulujdk17) appCustomVersion(){ java -version 2>&1 | grep Runtime | awk '{print $4}' | sed -e "s/.*Zulu//" | cut -d '-' -f 1 | sed -e "s/+/\./" } appNewVersion=$(echo "$downloadURL" | cut -d "-" -f 1 | sed -e "s/.*zulu//") # Cannot be compared to anything ;; +zulujdk18) + name="Zulu JDK 18" + type="pkgInDmg" + packageID="com.azulsystems.zulu.18" + if [[ $(arch) == i386 ]]; then + downloadURL=https://cdn.azul.com/zulu/bin/$(curl -fs "https://cdn.azul.com/zulu/bin/" | grep -Eio '">zulu18.*ca-jdk18.*x64.dmg(.*)' | cut -c3- | sed 's/<\/a>//' | sed -E 's/([0-9.]*)M//' | awk '{print $2 $1}' | sort | cut -c11- | tail -1) + elif [[ $(arch) == arm64 ]]; then + downloadURL=https://cdn.azul.com/zulu/bin/$(curl -fs "https://cdn.azul.com/zulu/bin/" | grep -Eio '">zulu18.*ca-jdk18.*aarch64.dmg(.*)' | cut -c3- | sed 's/<\/a>//' | sed -E 's/([0-9.]*)M//' | awk '{print $2 $1}' | sort | cut -c11- | tail -1) + fi + expectedTeamID="TDTHCUPYFR" + appCustomVersion(){ java -version 2>&1 | grep Runtime | awk '{print $4}' | sed -e "s/.*Zulu//" | cut -d '-' -f 1 | sed -e "s/+/\./" } + appNewVersion=$(echo "$downloadURL" | cut -d "-" -f 1 | sed -e "s/.*zulu//") # Cannot be compared to anything + ;; zulujdk8) name="Zulu JDK 8" type="pkgInDmg" @@ -5847,6 +6190,10 @@ if [[ -n $appNewVersion ]]; then printlog "notifying" displaynotification "$message" "No update for $name!" fi + if [[ $DIALOG_CMD_FILE != "" ]]; then + updateDialog "complete" "Latest version already installed..." + sleep 2 + fi cleanupAndExit 0 "No newer version." REQ fi else diff --git a/Labels.txt b/Labels.txt index c0de3d3..c8bad36 100644 --- a/Labels.txt +++ b/Labels.txt @@ -7,11 +7,13 @@ abetterfinderrename11 abstract acroniscyberprotectconnect acroniscyberprotectconnectagent +adobeacrobatprodc adobebrackets adobeconnect adobecreativeclouddesktop adobereaderdc adobereaderdc-install +adobereaderdc-install adobereaderdc-update aircall airserver @@ -35,6 +37,8 @@ applesfmono applesfpro applesfsymbols aquaskk +archiwareb2go +archiwarepst arq7 asana atext @@ -56,6 +60,7 @@ bartender basecamp3 bbedit bettertouchtool +bitrix24 bitwarden blender bluejeans @@ -76,7 +81,10 @@ camtasia2020 camtasia2021 canva carboncopycloner +charles chatwork +chronoagent +chronosync cisdem-documentreader citrixworkspace clevershare2 @@ -97,6 +105,7 @@ craftmanagerforsketch cricutdesignspace cryptomator cyberduck +cytoscape daisydisk dangerzone darktable @@ -123,6 +132,7 @@ dynalist easeusdatarecoverywizard easyfind egnyte +egnytecore egnytewebedit element eraseinstall @@ -137,6 +147,7 @@ favro fellow ferdi figma +filemakerpro filezilla findanyfile firefox @@ -154,6 +165,8 @@ flycut fontexplorer front fsmonitor +fujifilmwebcam +gfxcardstatus gimp githubdesktop golang @@ -178,6 +191,7 @@ gyazogif hancock handbrake hazel +horos houdahspot hpeasyadmin hpeasystart @@ -190,6 +204,7 @@ idrivethin iina imageoptim imazingprofileeditor +inetclearreportsdesigner inkscape insomnia installomator @@ -205,6 +220,7 @@ jamfconnectconfiguration jamfmigrator jamfpppcutility jamfreenroller +jdk18 jetbrainsclion jetbrainsdatagrip jetbrainsintellijidea @@ -227,6 +243,7 @@ knockknock krisp krita lastpass +latexit launchbar lcadvancedvpnclient lexarrecoverytool @@ -299,6 +316,7 @@ nomadlogin nordlayer notion nudge +nudgesuite nvivo obs obsidian @@ -316,11 +334,13 @@ onlyofficedesktop openvpnconnect openvpnconnectv3 opera +origin ottomatic overflow pacifist packages pandoc +parallelsrasclient paretosecurity parsec pdfsam @@ -330,6 +350,7 @@ pitch plantronicshub platypus plisteditpro +polylens postman prism9 pritunl @@ -400,6 +421,7 @@ sonos sonoss1 sonoss2 sourcetree +splashtopbusiness splashtopsos spotify sqlpropostgres @@ -420,6 +442,7 @@ tableaudesktop tableaupublic tableaureader tageditor +tailscale talkdeskcallbar talkdeskcxcloud taskpaper @@ -489,9 +512,12 @@ zohoworkdrivetruesync zoom zoomclient zoomgov +zoomoutlookplugin zoomrooms +zotero zulujdk11 zulujdk13 zulujdk15 zulujdk17 +zulujdk18 zulujdk8 diff --git a/MDM/App script.sh b/MDM/App script.sh deleted file mode 100755 index c7b4a10..0000000 --- a/MDM/App script.sh +++ /dev/null @@ -1,185 +0,0 @@ -#!/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. -LOGO="appstore" # or "addigy", "microsoft", "mosyleb", "mosylem" -###################################################################### -# Parameters for reinstall/initial install (owner root:wheel): -# "BLOCKING_PROCESS_ACTION=quit_kill INSTALL=force IGNORE_APP_STORE_APPS=yes SYSTEMOWNER=1" -# Parameters for Self Service installed app: -# "BLOCKING_PROCESS_ACTION=prompt_user NOTIFY=all" -# Parameters for security important apps, like browsers (run automaticaly every day): -# "BLOCKING_PROCESS_ACTION=tell_user_then_kill" -# Update of service apps (run automatically): -# "BLOCKING_PROCESS_ACTION=quit_kill NOTIFY=silent" -parameters="BLOCKING_PROCESS_ACTION=tell_user_then_kill NOTIFY=all" -############################################### - -# 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 -} - -cmdOutput="$(${destFile} ${what} LOGO=$LOGO $parameters LOGGING=WARN || 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} -ne 0 ]] ; then - echo -e "Error installing ${what}. Exit code ${exitStatus}" - #echo "$cmdOutput" - errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )" - echo "$errorOutput" - 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. -# Shouldn’t 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 it’s 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 diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh new file mode 100755 index 0000000..a235945 --- /dev/null +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS github.sh @@ -0,0 +1,346 @@ +#!/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 diff --git a/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh new file mode 100755 index 0000000..2089f9b --- /dev/null +++ b/MDM/App-install SS with swiftDialog and dockutil/App VFA SS.sh @@ -0,0 +1,293 @@ +#!/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/&//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 diff --git a/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh new file mode 100755 index 0000000..8e59aba --- /dev/null +++ b/MDM/App-install SS with swiftDialog and dockutil/App browser-security SS.sh @@ -0,0 +1,275 @@ +#!/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 diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh new file mode 100644 index 0000000..0cc2af9 --- /dev/null +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS multi-app.sh @@ -0,0 +1,278 @@ +#!/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 diff --git a/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh new file mode 100644 index 0000000..77f7add --- /dev/null +++ b/MDM/App-install SS with swiftDialog and dockutil/App normal SS.sh @@ -0,0 +1,272 @@ +#!/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 diff --git a/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh new file mode 100644 index 0000000..67d1f56 --- /dev/null +++ b/MDM/App-install SS with swiftDialog and dockutil/App service SS.sh @@ -0,0 +1,275 @@ +#!/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 diff --git a/MDM/App-install/App VFA.sh b/MDM/App-install/App VFA.sh new file mode 100755 index 0000000..3162a67 --- /dev/null +++ b/MDM/App-install/App VFA.sh @@ -0,0 +1,98 @@ +#!/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/&//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 diff --git a/MDM/App-install/App browser-security Auto-install.sh b/MDM/App-install/App browser-security Auto-install.sh new file mode 100644 index 0000000..c45b568 --- /dev/null +++ b/MDM/App-install/App browser-security Auto-install.sh @@ -0,0 +1,79 @@ +#!/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 diff --git a/MDM/App-install/App browser-security SS.sh b/MDM/App-install/App browser-security SS.sh new file mode 100644 index 0000000..83c8b12 --- /dev/null +++ b/MDM/App-install/App browser-security SS.sh @@ -0,0 +1,79 @@ +#!/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 diff --git a/MDM/App-install/App normal Auto-install.sh b/MDM/App-install/App normal Auto-install.sh new file mode 100644 index 0000000..986b054 --- /dev/null +++ b/MDM/App-install/App normal Auto-install.sh @@ -0,0 +1,79 @@ +#!/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 diff --git a/MDM/App-install/App normal SS.sh b/MDM/App-install/App normal SS.sh new file mode 100644 index 0000000..06f7c04 --- /dev/null +++ b/MDM/App-install/App normal SS.sh @@ -0,0 +1,80 @@ +#!/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 diff --git a/MDM/App-install/App service Auto-install.sh b/MDM/App-install/App service Auto-install.sh new file mode 100644 index 0000000..aa7165e --- /dev/null +++ b/MDM/App-install/App service Auto-install.sh @@ -0,0 +1,79 @@ +#!/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 diff --git a/MDM/App-loop script.sh b/MDM/App-loop script.sh deleted file mode 100755 index 8fb33e7..0000000 --- a/MDM/App-loop script.sh +++ /dev/null @@ -1,193 +0,0 @@ -#!/bin/zsh -# Installation using Installomator -whatList="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 "whatList" above with labels separated by space " ". -# Script will loop through these labels. -LOGO="appstore" # or "addigy", "microsoft", "mosyleb", "mosylem" -###################################################################### -# Parameters for reinstall/initial install (owner root:wheel): -# "BLOCKING_PROCESS_ACTION=quit_kill INSTALL=force IGNORE_APP_STORE_APPS=yes SYSTEMOWNER=1" -# Parameters for Self Service installed app: -# "BLOCKING_PROCESS_ACTION=prompt_user NOTIFY=all" -# Parameters for security important apps, like browsers (run automaticaly every day): -# "BLOCKING_PROCESS_ACTION=tell_user_then_kill" -# Update of service apps (run automatically): -# "BLOCKING_PROCESS_ACTION=quit_kill NOTIFY=silent" -parameters="BLOCKING_PROCESS_ACTION=tell_user NOTIFY=all" -###################################################################### - -# 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 -} - -# Count errors -errorCount=0 - -for what in $whatList; do - #echo $what - # Install software using Installomator - cmdOutput="$(${destFile} ${what} LOGO=$LOGO $parameters LOGGING=WARN || 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} -ne 0 ]] ; then - echo -e "Error installing ${what}. Exit code ${exitStatus}" - #echo "$cmdOutput" - errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )" - echo "$errorOutput" - 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. -# Shouldn’t 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 it’s 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 diff --git a/MDM/App-update/App browser-security Auto-install.sh b/MDM/App-update/App browser-security Auto-install.sh new file mode 100644 index 0000000..211e564 --- /dev/null +++ b/MDM/App-update/App browser-security Auto-install.sh @@ -0,0 +1,92 @@ +#!/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 + diff --git a/MDM/App-update/App normal Auto-install.sh b/MDM/App-update/App normal Auto-install.sh new file mode 100644 index 0000000..c2ac671 --- /dev/null +++ b/MDM/App-update/App normal Auto-install.sh @@ -0,0 +1,92 @@ +#!/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 + diff --git a/MDM/InstallInstallomator.sh b/MDM/InstallInstallomator.sh deleted file mode 100644 index 9bb131f..0000000 --- a/MDM/InstallInstallomator.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -# This script is meant to povide the simplest MDM/management platform agnostic way to install Installomator -# The only requirement is an Internet connection - -export PATH=/usr/bin:/bin:/usr/sbin:/sbin - -# Get the URL of the latest PKG From the Installomator GitHub repo -url=$(curl --silent --fail "https://api.github.com/repos/Installomator/Installomator/releases/latest" | awk -F '"' "/browser_download_url/ && /pkg\"/ { print \$4; exit }") -# Expected Team ID of the downloaded PKG -expectedTeamID="JME5BW3F3R" -exitCode=0 - -# Check for Installomator and install if not found -if [ ! -e "/usr/local/Installomator/Installomator.sh" ]; then - echo "Installomator not found. Installing." - # Create temporary working directory - tempDirectory=$( mktemp -d ) - echo "Created working directory '$tempDirectory'" - # Download the installer package - echo "Downloading Installomator package" - curl --location --silent "$url" -o "$tempDirectory/Installomator.pkg" - # Verify the download - teamID=$(spctl -a -vv -t install "$tempDirectory/Installomator.pkg" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()') - echo "Team ID for downloaded package: $teamID" - # Install the package if Team ID validates - if [ "$expectedTeamID" = "$teamID" ] || [ "$expectedTeamID" = "" ]; then - echo "Package verified. Installing package Installomator.pkg" - installer -pkg "$tempDirectory/Installomator.pkg" -target / -verbose - exitCode=$? - else - echo "Package verification failed before package installation could start. Download link may be invalid. Aborting." - exitCode=1 - exit $exitCode - fi - # Remove the temporary working directory when done - echo "Deleting working directory '$tempDirectory' and its contents" - rm -Rf "$tempDirectory" -else - echo "Installomator already installed." -fi - -exit $exitCode diff --git a/MDM/Installomator 1st Auto-install DEPNotify.sh b/MDM/Installomator 1st Auto-install DEPNotify.sh new file mode 100755 index 0000000..7baa737 --- /dev/null +++ b/MDM/Installomator 1st Auto-install DEPNotify.sh @@ -0,0 +1,360 @@ +#!/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 diff --git a/MDM/Installomator 1st Auto-install.sh b/MDM/Installomator 1st Auto-install.sh new file mode 100755 index 0000000..6dd9353 --- /dev/null +++ b/MDM/Installomator 1st Auto-install.sh @@ -0,0 +1,308 @@ +#!/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 diff --git a/MDM/Installomator 1st SS DEPNotify.sh b/MDM/Installomator 1st SS DEPNotify.sh new file mode 100755 index 0000000..b911f79 --- /dev/null +++ b/MDM/Installomator 1st SS DEPNotify.sh @@ -0,0 +1,360 @@ +#!/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 diff --git a/MDM/Installomator 1st SS.sh b/MDM/Installomator 1st SS.sh new file mode 100755 index 0000000..e017831 --- /dev/null +++ b/MDM/Installomator 1st SS.sh @@ -0,0 +1,307 @@ +#!/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 diff --git a/MDM/Installomator 1st condition.sh b/MDM/Installomator 1st condition.sh new file mode 100644 index 0000000..95b9806 --- /dev/null +++ b/MDM/Installomator 1st condition.sh @@ -0,0 +1,13 @@ +#!/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 diff --git a/MDM/Installomator 1st prevention.sh b/MDM/Installomator 1st prevention.sh new file mode 100644 index 0000000..b4658d9 --- /dev/null +++ b/MDM/Installomator 1st prevention.sh @@ -0,0 +1,11 @@ +#!/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" diff --git a/MDM/Installomator update.sh b/MDM/Installomator update.sh deleted file mode 100755 index 5b6bb67..0000000 --- a/MDM/Installomator update.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# Updating Installomator -# Usefull to push out after deployment if earlier version was deployed in DEP profile - -what="installomator" # enter the software to install -LOGO="appstore" # or "addigy", "microsoft", "mosyleb", "mosylem" - -# 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 BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent LOGGING=req || 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 -e "${what} succesfully installed.\n" -else - echo -e "Error installing ${what}. Exit code ${exitStatus}\n" - #echo "$cmdOutput" - errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )" - echo "$errorOutput" - caffexit $exitStatus -fi - -echo "[$(DATE)][LOG-END]" -caffexit 0 diff --git a/MDM/Jamf/00_PrepareInstall_SwiftDialog.sh b/MDM/Jamf/00_PrepareInstall_SwiftDialog.sh new file mode 100755 index 0000000..84a1212 --- /dev/null +++ b/MDM/Jamf/00_PrepareInstall_SwiftDialog.sh @@ -0,0 +1,160 @@ +#!/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 diff --git a/MDM/Jamf/ReadMe.md b/MDM/Jamf/ReadMe.md index db3d35d..e9cf769 100644 --- a/MDM/Jamf/ReadMe.md +++ b/MDM/Jamf/ReadMe.md @@ -20,7 +20,7 @@ The different scripts require a set of parameters. We will use the `googlechrome `00_Prepare_SwiftDialog.sh` -Parameter 4: `/var/tmp/dialog` (Path to the swiftDialog command file) +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) @@ -30,7 +30,7 @@ Parameter 6: Path to or URL for an icon in swiftDialog. This can be a path on th Parameter 4: `googlechromepkg` (the label to install) -Parameter 5: `DIALOG_CMD_FILE=\var\log\dialog.log` (the swiftDialog command file, this has to be the same value as parameter 4 in the previous script) +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) @@ -38,7 +38,7 @@ You can add more configurations to the Installomator script when needed. `zz_Quit_SwiftDialog` -Parameter 4: `/var/log/dialog.log` (the swiftDialog command file, this has to be the same value as parameter 4 in the first script) +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. diff --git a/MDM/MDMAddigy CustomSoftware.sh b/MDM/MDMAddigy CustomSoftware.sh deleted file mode 100755 index e7918fd..0000000 --- a/MDM/MDMAddigy CustomSoftware.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/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 (9.1.0)/Installomator-9.1.pkg" -target / - -# Installation using Installomator -whatList="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 "whatList" above with labels separated by space " ". -# Script will loop through these labels and exit with number of errors. -###################################################################### -# Parameters for reinstall/initial install (owner root:wheel): -# "BLOCKING_PROCESS_ACTION=quit_kill INSTALL=force IGNORE_APP_STORE_APPS=yes SYSTEMOWNER=1" -# Parameters for Self Service installed app: -# "BLOCKING_PROCESS_ACTION=prompt_user NOTIFY=all" -# Parameters for security important apps, like browsers (run automaticaly every day): -# "BLOCKING_PROCESS_ACTION=tell_user_then_kill" -# Update of service apps (run automatically): -# "BLOCKING_PROCESS_ACTION=quit_kill NOTIFY=silent" -parameters="BLOCKING_PROCESS_ACTION=quit_kill INSTALL=force IGNORE_APP_STORE_APPS=yes" -###################################################################### - -# 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 -} - -# Count errors -errorCount=0 - -for what in $whatList; do - #echo $what - # Install software using Installomator - cmdOutput="$(${destFile} ${what} LOGO=addigy $parameters || 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} -ne 0 ]] ; then - echo -e "Error installing ${what}. Exit code ${exitStatus}" - #echo "$cmdOutput" - errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )" - echo "$errorOutput" - 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="9.1" - -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 diff --git a/MDM/MDMMosyle install.sh b/MDM/MDMMosyle install.sh deleted file mode 100644 index 27f9d8d..0000000 --- a/MDM/MDMMosyle install.sh +++ /dev/null @@ -1,79 +0,0 @@ -PKG_ID="com.scriptingosx.Installomator" -TARGET_VERSION="9.1" -URLDOWNLOAD="%MosyleCDNFile:blah-blah-blah%" -###################################################################### -# Installation using Installomator (enter the software to install separated with spaces in the "whatList"-variable) -whatList="handbrake theunarchiver microsoftoffice365" -# Covered by Mosyle Catalog: "brave firefox googlechrome microsoftedge microsoftteams signal sublimetext vlc webex zoom" among others -LOGO="mosyleb" # or "mosylem" -###################################################################### - -## 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 what in $whatList; do - #echo $item - # Install software using Installomator - cmdOutput="$(${destFile} ${what} LOGO=$LOGO NOTIFY=all BLOCKING_PROCESS_ACTION=tell_user || true)" # NOTIFY=silent BLOCKING_PROCESS_ACTION=quit_kill INSTALL=force - # 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} -ne 0 ]] ; then - echo "Error installing ${what}. Exit code ${exitStatus}" - #echo "$cmdOutput" - errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )" - echo "$errorOutput" - let errorCount++ - fi -done - -echo -echo "Errors: $errorCount" -echo "[$(DATE)][LOG-END]" - -caffexit $errorCount diff --git a/MDM/Manual valuesfromarguments.sh b/MDM/Manual valuesfromarguments.sh deleted file mode 100755 index ee80291..0000000 --- a/MDM/Manual valuesfromarguments.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# Software - -# Installation using Installomator -# Example of installing software using valuesfromarguments to install a custom software - -LOGO="appstore" # or "addigy", "microsoft", "mosyleb", "mosylem" -############################################### - -# 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 -} - -# Variables to calculate -downloadURL="https://craft-assets.invisionapp.com/CraftManager/production/CraftManager.zip" -appNewVersion=$(curl -fs https://craft-assets.invisionapp.com/CraftManager/production/appcast.xml | xpath -e '//rss/channel/item[1]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f2) - -# Install software using Installomator -cmdOutput="$(${destFile} valuesfromarguments LOGO=$LOGO \ - name=CraftManager \ - type=zip \ - downloadURL=$downloadURL \ - appNewVersion=$appNewVersion \ - expectedTeamID=VRXQSNCL5W \ - BLOCKING_PROCESS_ACTION=prompt_user \ - LOGGING=REQ \ - NOTIFY=all || 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 -e "${what} succesfully installed.\n" -else - echo -e "Error installing ${what}. Exit code ${exitStatus}\n" - #printlog "$cmdOutput" - errorOutput="$( echo "${cmdOutput}" | grep --binary-files=text -i "error" || true )" - echo "$errorOutput" - caffexit $exitStatus -fi - -echo "[$(DATE)][LOG-END]" -caffexit 0 diff --git a/MDM/Progress 1st swiftDialog condition.sh b/MDM/Progress 1st swiftDialog condition.sh new file mode 100644 index 0000000..63d0055 --- /dev/null +++ b/MDM/Progress 1st swiftDialog condition.sh @@ -0,0 +1,13 @@ +#!/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 diff --git a/MDM/Progress 1st swiftDialog prevention.sh b/MDM/Progress 1st swiftDialog prevention.sh new file mode 100644 index 0000000..bd43e56 --- /dev/null +++ b/MDM/Progress 1st swiftDialog prevention.sh @@ -0,0 +1,11 @@ +#!/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" diff --git a/MDM/Progress 1st swiftDialog.sh b/MDM/Progress 1st swiftDialog.sh new file mode 100755 index 0000000..f279d3d --- /dev/null +++ b/MDM/Progress 1st swiftDialog.sh @@ -0,0 +1,397 @@ +#!/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 they’ve 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 acodega’s 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" diff --git a/MDM/README.md b/MDM/README.md new file mode 100644 index 0000000..15d7fca --- /dev/null +++ b/MDM/README.md @@ -0,0 +1,83 @@ +# 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, you’ll want the install performed right away, so there isn’t a deferral option. +`normal`: The user can defer/skip the update. +`service`: These are apps where we don’t 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 diff --git a/MDM/RemoveInstallomator.sh b/MDM/Remove Installomator.sh similarity index 100% rename from MDM/RemoveInstallomator.sh rename to MDM/Remove Installomator.sh diff --git a/MDM/install Installomator direct condition.sh b/MDM/install Installomator direct condition.sh new file mode 100755 index 0000000..342e72d --- /dev/null +++ b/MDM/install Installomator direct condition.sh @@ -0,0 +1,17 @@ +#!/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 diff --git a/MDM/install Installomator direct.sh b/MDM/install Installomator direct.sh new file mode 100755 index 0000000..352275e --- /dev/null +++ b/MDM/install Installomator direct.sh @@ -0,0 +1,149 @@ +#!/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 diff --git a/MDM/install swiftDialog direct condition.sh b/MDM/install swiftDialog direct condition.sh new file mode 100755 index 0000000..79adc19 --- /dev/null +++ b/MDM/install swiftDialog direct condition.sh @@ -0,0 +1,20 @@ +#!/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 diff --git a/MDM/install swiftDialog direct.sh b/MDM/install swiftDialog direct.sh new file mode 100755 index 0000000..c29d299 --- /dev/null +++ b/MDM/install swiftDialog direct.sh @@ -0,0 +1,150 @@ +#!/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 diff --git a/README.md b/README.md index 0002ba3..f84962c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# 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._ diff --git a/fragments/functions.sh b/fragments/functions.sh index 0da3726..bbd6bed 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -162,11 +162,19 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name fi if [ -n "$archiveName" ]; then - #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }") - downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*$archiveName" | head -1) + 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 else - #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") - downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1) + 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 fi if [ -z "$downloadURL" ]; then cleanupAndExit 14 "could not retrieve download URL for $gitusername/$gitreponame" ERROR @@ -285,6 +293,10 @@ getAppVersion() { printlog "Replacing App Store apps, no matter the version" WARN 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 fi fi @@ -462,6 +474,10 @@ 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." @@ -628,6 +644,10 @@ 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." diff --git a/fragments/labels/acroniscyberprotectconnectagent.sh b/fragments/labels/acroniscyberprotectconnectagent.sh index 7155b6a..8310357 100644 --- a/fragments/labels/acroniscyberprotectconnectagent.sh +++ b/fragments/labels/acroniscyberprotectconnectagent.sh @@ -7,4 +7,5 @@ remotixagent) 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 ) ;; diff --git a/fragments/labels/adobeacrobatprodc.sh b/fragments/labels/adobeacrobatprodc.sh new file mode 100644 index 0000000..308648f --- /dev/null +++ b/fragments/labels/adobeacrobatprodc.sh @@ -0,0 +1,8 @@ +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" + ;; diff --git a/fragments/labels/adobecreativeclouddesktop.sh b/fragments/labels/adobecreativeclouddesktop.sh index 95582db..e12b911 100644 --- a/fragments/labels/adobecreativeclouddesktop.sh +++ b/fragments/labels/adobecreativeclouddesktop.sh @@ -1,18 +1,24 @@ adobecreativeclouddesktop) name="Adobe Creative Cloud" - #appName="Install.app" + appName="Install.app" type="dmg" - adobeurl="https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" - if [[ $(arch) == "arm64" ]]; then - downloadURL=$(curl -fs "$adobeurl" | xmllint -html -xpath "string(//a[contains(@href,'osx10')][contains(text(),'Download')]/@href)" - 2> /dev/null) - elif [[ $(arch) == "i386" ]]; then - downloadURL=$(curl -fs "$adobeurl" | xmllint -html -xpath "string(//a[contains(@href,'macarm64')][contains(text(),'Download')]/@href)" - 2> /dev/null) + 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 fi - #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) + 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/" installerTool="Install.app" CLIInstaller="Install.app/Contents/MacOS/Install" CLIArguments=(--mode=silent) expectedTeamID="JQ525L2MZD" + blockingProcesses=( "Creative Cloud" ) Company="Adobe" ;; diff --git a/fragments/labels/adobereaderdc-install.sh b/fragments/labels/adobereaderdc-install.sh new file mode 100644 index 0000000..060e3cc --- /dev/null +++ b/fragments/labels/adobereaderdc-install.sh @@ -0,0 +1,27 @@ +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" + ;; diff --git a/fragments/labels/adobereaderdc-update.sh b/fragments/labels/adobereaderdc-update.sh index a409cf5..7a81c57 100644 --- a/fragments/labels/adobereaderdc-update.sh +++ b/fragments/labels/adobereaderdc-update.sh @@ -1,9 +1,44 @@ adobereaderdc-update) name="Adobe Acrobat Reader DC" type="pkgInDmg" - downloadURL=$(adobecurrent=`curl --fail --silent https://armmf.adobe.com/arm-manifests/mac/AcrobatDC/reader/current_version.txt | tr -d '.'` && echo https://ardownload2.adobe.com/pub/adobe/reader/mac/AcrobatDC/"$adobecurrent"/AcroRdrDC_"$adobecurrent"_MUI.dmg) + 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 ) 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) + updateToolLog="/Users/$currentUser/Library/Logs/RemoteUpdateManager.log" + updateToolLogDateFormat="%m/%d/%y %H:%M:%S" expectedTeamID="JQ525L2MZD" blockingProcesses=( "AdobeReader" ) + Company=Adobe + PatchName=AcrobatReader + PatchSkip="YES" ;; diff --git a/fragments/labels/archiwareb2go.sh b/fragments/labels/archiwareb2go.sh new file mode 100644 index 0000000..85f30a8 --- /dev/null +++ b/fragments/labels/archiwareb2go.sh @@ -0,0 +1,10 @@ +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 ) + ;; diff --git a/fragments/labels/archiwarepst.sh b/fragments/labels/archiwarepst.sh new file mode 100644 index 0000000..9ce9b29 --- /dev/null +++ b/fragments/labels/archiwarepst.sh @@ -0,0 +1,10 @@ +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 ) + ;; diff --git a/fragments/labels/audacity.sh b/fragments/labels/audacity.sh index a5868d3..3a49708 100644 --- a/fragments/labels/audacity.sh +++ b/fragments/labels/audacity.sh @@ -1,7 +1,13 @@ audacity) name="Audacity" type="dmg" - downloadURL=$(downloadURLFromGit audacity audacity) + 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 appNewVersion=$(versionFromGit audacity audacity) expectedTeamID="AWEYX923UX" ;; diff --git a/fragments/labels/bitrix24.sh b/fragments/labels/bitrix24.sh new file mode 100644 index 0000000..c5b6a6d --- /dev/null +++ b/fragments/labels/bitrix24.sh @@ -0,0 +1,8 @@ +bitrix24) + name="Bitrix24" + type="dmg" + archiveName="bitrix24_desktop.dmg" + downloadURL="https://dl.bitrix24.com/b24/bitrix24_desktop.dmg" + expectedTeamID="5B3T3A994N" + blockingProcesses=( "Bitrix24" ) + ;; diff --git a/fragments/labels/charles.sh b/fragments/labels/charles.sh new file mode 100644 index 0000000..9f4c086 --- /dev/null +++ b/fragments/labels/charles.sh @@ -0,0 +1,7 @@ +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" + ;; diff --git a/fragments/labels/chronoagent.sh b/fragments/labels/chronoagent.sh new file mode 100644 index 0000000..124238d --- /dev/null +++ b/fragments/labels/chronoagent.sh @@ -0,0 +1,11 @@ +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" + ;; diff --git a/fragments/labels/chronosync.sh b/fragments/labels/chronosync.sh new file mode 100644 index 0000000..dcec55a --- /dev/null +++ b/fragments/labels/chronosync.sh @@ -0,0 +1,8 @@ +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" + ;; diff --git a/fragments/labels/cytoscape.sh b/fragments/labels/cytoscape.sh new file mode 100644 index 0000000..7b722ef --- /dev/null +++ b/fragments/labels/cytoscape.sh @@ -0,0 +1,11 @@ +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" + ;; diff --git a/fragments/labels/duckduckgo.sh b/fragments/labels/duckduckgo.sh index a5cb4e0..e2a0768 100644 --- a/fragments/labels/duckduckgo.sh +++ b/fragments/labels/duckduckgo.sh @@ -2,9 +2,9 @@ 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) + 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" ;; diff --git a/fragments/labels/egnytecore.sh b/fragments/labels/egnytecore.sh new file mode 100644 index 0000000..b7565fa --- /dev/null +++ b/fragments/labels/egnytecore.sh @@ -0,0 +1,9 @@ +egnytecore) + name="Egnyte Core" + appName="Egnyte.app" + type="dmg" + downloadURL=$(curl -fs "https://egnyte-cdn.egnyte.com/desktopapp/mac/en-us/versions/default.xml" | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | cut -d '"' -f 2) + appNewVersion=$(curl -fs "https://egnyte-cdn.egnyte.com/desktopapp/mac/en-us/versions/default.xml" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | cut -d '"' -f 2) + expectedTeamID="FELUD555VC" + blockingProcesses=( NONE ) + ;; diff --git a/fragments/labels/filemakerpro.sh b/fragments/labels/filemakerpro.sh new file mode 100644 index 0000000..f6c7a80 --- /dev/null +++ b/fragments/labels/filemakerpro.sh @@ -0,0 +1,8 @@ +filemakerpro) + name="FileMaker Pro" + type="dmg" + versionKey="BuildVersion" + downloadURL=$(curl -fs https://www.filemaker.com/redirects/ss.txt | grep '\"PRO..MAC\"' | tail -1 | sed "s|.*url\":\"\(.*\)\".*|\\1|") + appNewVersion=$(curl -fs https://www.filemaker.com/redirects/ss.txt | grep '\"PRO..MAC\"' | tail -1 | sed "s|.*fmp_\(.*\).dmg.*|\\1|") + expectedTeamID="J6K4T76U7W" + ;; diff --git a/fragments/labels/fujifilmwebcam.sh b/fragments/labels/fujifilmwebcam.sh new file mode 100644 index 0000000..26d29a2 --- /dev/null +++ b/fragments/labels/fujifilmwebcam.sh @@ -0,0 +1,7 @@ +fujifilmwebcam) + name="FUJIFILM X Webcam 2" + type="pkg" + downloadURL=$(curl -fs "https://fujifilm-x.com/en-us/support/download/software/x-webcam/" | grep "https.*pkg" | sed -E 's/.*(https:\/\/dl.fujifilm-x\.com\/support\/software\/.*\.pkg[^\<]).*/\1/g' | sed -e 's/^"//' -e 's/"$//') + appNewVersion=$( echo “${downloadURL}” | sed -E 's/.*XWebcamIns([0-9]*).*/\1/g' | sed -E 's/([0-9])([0-9]).*/\1\.\2/g') + expectedTeamID="34LRP8AV2M" + ;; diff --git a/fragments/labels/gfxcardstatus.sh b/fragments/labels/gfxcardstatus.sh new file mode 100644 index 0000000..84a3422 --- /dev/null +++ b/fragments/labels/gfxcardstatus.sh @@ -0,0 +1,7 @@ +gfxcardstatus) + name="gfxCardStatus" + type="zip" + downloadURL="$(downloadURLFromGit codykrieger gfxCardStatus)" + appNewVersion="$(versionFromGit codykrieger gfxCardStatus)" + expectedTeamID="LF22FTQC25" + ;; diff --git a/fragments/labels/horos.sh b/fragments/labels/horos.sh new file mode 100644 index 0000000..96b70b0 --- /dev/null +++ b/fragments/labels/horos.sh @@ -0,0 +1,14 @@ +horos) + name="Horos" + type="dmg" + versionKey="CFBundleGetInfoString" + appNewVersion=$(curl -fs https://github.com/horosproject/horos/blob/horos/Horos/Info.plist | grep -A 4 "CFBundleGetInfoString" | tail -1 | sed -r 's/.*Horos v([^<]+).*/\1/' | sed 's/ //g') + if [[ $(arch) == "arm64" ]]; then + downloadURL="https://horosproject.org/horos-content/Horos"$appNewVersion"_Apple.dmg" + TeamID="8NDFEW7285" + elif [[ $(arch) == "i386" ]]; then + downloadURL="https://horosproject.org/horos-content/Horos"$appNewVersion".dmg" + TeamID="TPT6TVH8UY" + fi + expectedTeamID=$TeamID + ;; diff --git a/fragments/labels/jdk18.sh b/fragments/labels/jdk18.sh new file mode 100644 index 0000000..0369e36 --- /dev/null +++ b/fragments/labels/jdk18.sh @@ -0,0 +1,13 @@ +jdk18) + name="Java SE Development Kit 18" + type="pkgInDmg" + versionKey="CFBundleShortVersionString" + if [[ $(arch) == "arm64" ]]; then + downloadURL="https://download.oracle.com/java/18/latest/jdk-18_macos-aarch64_bin.dmg" + elif [[ $(arch) == "i386" ]]; then + downloadURL="https://download.oracle.com/java/18/latest/jdk-18_macos-x64_bin.dmg" + fi + appCustomVersion(){ java --version | grep java | awk '{print $2}' } + appNewVersion=$(curl -sf "https://www.oracle.com/java/technologies/downloads/#jdk18-mac" | grep -m 1 "Java SE Development Kit" | sed "s|.*Kit \(.*\) downloads.*|\\1|") + expectedTeamID="VB5E2TV963" + ;; diff --git a/fragments/labels/latexit.sh b/fragments/labels/latexit.sh new file mode 100644 index 0000000..c6a91f9 --- /dev/null +++ b/fragments/labels/latexit.sh @@ -0,0 +1,7 @@ +latexit) + name="LaTeXiT" + type="dmg" + downloadURL="$(curl -fs "https://pierre.chachatelier.fr/latexit/downloads/latexit-sparkle-en.rss" | xpath '(//rss/channel/item/enclosure/@url)[last()]' 2>/dev/null | cut -d '"' -f 2)" + appNewVersion="$(curl -fs "https://pierre.chachatelier.fr/latexit/downloads/latexit-sparkle-en.rss" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[last()]' 2>/dev/null | cut -d '"' -f 2)" + expectedTeamID="7SFX84GNR7" + ;; diff --git a/fragments/labels/libreoffice.sh b/fragments/labels/libreoffice.sh index c8fab45..8f43339 100644 --- a/fragments/labels/libreoffice.sh +++ b/fragments/labels/libreoffice.sh @@ -2,11 +2,14 @@ libreoffice) name="LibreOffice" type="dmg" if [[ $(arch) == "arm64" ]]; then - arch_type="aarch64" + releaseURL="https://downloadarchive.documentfoundation.org/libreoffice/old/latest/mac/aarch64/" + appNewVersion=$(curl -sf $releaseURL | grep -m 1 "_MacOS_aarch64.dmg" | sed "s|.*LibreOffice_\(.*\)_MacOS.*|\\1|") + downloadURL="https://downloadarchive.documentfoundation.org/libreoffice/old/latest/mac/aarch64/LibreOffice_"$appNewVersion"_MacOS_aarch64.dmg" + elif [[ $(arch) == "i386" ]]; then + releaseURL="https://downloadarchive.documentfoundation.org/libreoffice/old/latest/mac/x86_64/" + appNewVersion=$(curl -sf $releaseURL | grep -m 1 "_MacOS_x86-64.dmg" | sed "s|.*LibreOffice_\(.*\)_MacOS.*|\\1|") + downloadURL="https://downloadarchive.documentfoundation.org/libreoffice/old/latest/mac/x86_64/LibreOffice_"$appNewVersion"_MacOS_x86-64.dmg" fi - libreoffice_latest_version="$(curl -Ls https://www.libreoffice.org/download/download-libreoffice/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)" - downloadURL="https://download.documentfoundation.org/libreoffice/stable/${libreoffice_latest_version}/mac/${arch_type:-x86_64}/LibreOffice_${libreoffice_latest_version}_MacOS_${arch_type:-x86-64}.dmg" - appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*_([0-9.]*)_.*/\1/g') expectedTeamID="7P5S3ZLCN7" blockingProcesses=( soffice ) ;; diff --git a/fragments/labels/nudge.sh b/fragments/labels/nudge.sh index 804872d..aafacad 100644 --- a/fragments/labels/nudge.sh +++ b/fragments/labels/nudge.sh @@ -1,8 +1,9 @@ nudge) name="Nudge" type="pkg" + archiveName="Nudge-[0-9.]*.pkg" downloadURL=$(downloadURLFromGit macadmins Nudge ) appNewVersion=$(versionFromGit macadmins Nudge ) expectedTeamID="9GQZ7KUFR6" - archiveName="Nudge-[0-9.]*.pkg" + ;; diff --git a/fragments/labels/nudgesuite.sh b/fragments/labels/nudgesuite.sh new file mode 100644 index 0000000..698cf2e --- /dev/null +++ b/fragments/labels/nudgesuite.sh @@ -0,0 +1,10 @@ +nudgesuite) + name="Nudge Suite" + appName="Nudge.app" + type="pkg" + archiveName="Nudge_Suite-[0-9.]*.pkg" + downloadURL=$(downloadURLFromGit macadmins Nudge ) + appNewVersion=$(versionFromGit macadmins Nudge ) + expectedTeamID="9GQZ7KUFR6" + blockingProcesses=( "Nudge" ) + ;; diff --git a/fragments/labels/obs.sh b/fragments/labels/obs.sh index 4685446..d932046 100644 --- a/fragments/labels/obs.sh +++ b/fragments/labels/obs.sh @@ -1,7 +1,12 @@ obs) - # credit: Gabe Marchan (gabemarchan.com - @darklink87) name="OBS" type="dmg" - downloadURL=$(curl -fs "https://obsproject.com/download" | awk -F '"' "/dmg/ {print \$10}") + if [[ $(arch) == "arm64" ]]; then + archiveName="obs-studio-[0-9.]*-macos-arm64.dmg" + elif [[ $(arch) == "i386" ]]; then + archiveName="obs-studio-[0-9.]*-macos-x86_64.dmg" + fi + downloadURL=$(downloadURLFromGit obsproject obs-studio ) + appNewVersion=$(versionFromGit obsproject obs-studio ) expectedTeamID="2MMRE5MTB8" ;; diff --git a/fragments/labels/origin.sh b/fragments/labels/origin.sh new file mode 100644 index 0000000..2262b79 --- /dev/null +++ b/fragments/labels/origin.sh @@ -0,0 +1,7 @@ +origin) + name="Origin" + type="dmg" + downloadURL="https://www.dm.origin.com/mac/download/Origin.dmg" + expectedTeamID="TSTV75T6Q5" + blockingProcesses=( "Origin" ) + ;; diff --git a/fragments/labels/parallelsrasclient.sh b/fragments/labels/parallelsrasclient.sh new file mode 100644 index 0000000..0aa5306 --- /dev/null +++ b/fragments/labels/parallelsrasclient.sh @@ -0,0 +1,7 @@ +parallelsrasclient) + name="Parallels Client" + type="pkg" + appNewVersion=$(curl -sf "https://download.parallels.com/ras/v18/RAS%20Client%20for%20Mac%20Changelog.txt" | grep -m 1 "Parallels Client for Mac Version" | sed "s|.*Version \(.*\) -.*|\\1|" | sed 's/ /./g' | sed 's/[^0-9.]//g') + downloadURL=$(appMajorVersion=`sed 's/\..*//' <<< $appNewVersion` && appHyphenVersion=`curl -sf "https://download.parallels.com/ras/v18/RAS%20Client%20for%20Mac%20Changelog.txt" | grep -m 1 "Parallels Client for Mac Version" | sed "s|.*Version \(.*\) -.*|\\1|" | sed 's/ /-/g' | sed 's/[^0-9.-]//g'` && echo https://download.parallels.com/ras/v"$appMajorVersion"/"$appNewVersion"/RasClient-Mac-Notarized-"$appHyphenVersion".pkg) + expectedTeamID="4C6364ACXT" + ;; diff --git a/fragments/labels/polylens.sh b/fragments/labels/polylens.sh new file mode 100644 index 0000000..54cd0b3 --- /dev/null +++ b/fragments/labels/polylens.sh @@ -0,0 +1,7 @@ +polylens) + name="Poly Lens" + type="dmg" + appNewVersion=$(curl -fs "https://info.lens.poly.com/lens-dt-rn/atom.xml" | grep "Version" | head -1 | cut -d "[" -f3 | sed 's/Version //g' | sed 's/]]\>\<\/title\>//g') + downloadURL="https://swupdate.lens.poly.com/lens-desktop-mac/$appNewVersion/$appNewVersion/PolyLens-$appNewVersion.dmg" + expectedTeamID="SKWK2Q7JJV" + ;; diff --git a/fragments/labels/r.sh b/fragments/labels/r.sh index 1c98852..fd9e6b4 100644 --- a/fragments/labels/r.sh +++ b/fragments/labels/r.sh @@ -1,7 +1,12 @@ r) name="R" type="pkg" - downloadURL="https://cloud.r-project.org/bin/macosx/$( curl -fsL https://cloud.r-project.org/bin/macosx/ | grep -m 1 -o '' | sed -E 's/.+"(.+)".+/\1/g' )" - appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') + if [[ $(arch) == "arm64" ]]; then + downloadURL="https://cloud.r-project.org/bin/macosx/$( curl -fsL https://cloud.r-project.org/bin/macosx/ | grep -m 1 -o '' | sed -E 's/.+"(.+)".+/\1/g' )" + appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)-.*\..*/\1/g') + elif [[ $(arch) == "i386" ]]; then + downloadURL="https://cloud.r-project.org/bin/macosx/$( curl -fsL https://cloud.r-project.org/bin/macosx/ | grep -o '' | grep -m 1 -v "arm64" | sed -E 's/.+"(.+)".+/\1/g' )" + appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') + fi expectedTeamID="VZLD955F6P" ;; diff --git a/fragments/labels/rstudio.sh b/fragments/labels/rstudio.sh index 22f735e..6ff3755 100644 --- a/fragments/labels/rstudio.sh +++ b/fragments/labels/rstudio.sh @@ -2,6 +2,6 @@ rstudio) name="RStudio" type="dmg" downloadURL=$(curl -s -L "https://rstudio.com/products/rstudio/download/" | grep -m 1 -Eio 'href="https://download1.rstudio.org/desktop/macos/RStudio-(.*).dmg"' | cut -c7- | sed -e 's/"$//') - appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g' ) + appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.-]*)\..*/\1/g' | sed 's/-/+/' ) expectedTeamID="FYF2F5GFX4" ;; diff --git a/fragments/labels/screamingfrogseospider.sh b/fragments/labels/screamingfrogseospider.sh index 1a2aaf6..39ab342 100644 --- a/fragments/labels/screamingfrogseospider.sh +++ b/fragments/labels/screamingfrogseospider.sh @@ -1,7 +1,12 @@ screamingfrogseospider) name="Screaming Frog SEO Spider" type="dmg" - downloadURL=$(curl -fs "https://www.screamingfrog.co.uk/wp-content/themes/screamingfrog/inc/download-modal.php" | grep -i -o "https.*\.dmg" | head -1) + if [[ $(arch) == i386 ]]; then + platform="Mac - (intel)" + elif [[ $(arch) == arm64 ]]; then + platform="Mac - (apple silicon)" + fi + downloadURL=$(curl -fs "https://www.screamingfrog.co.uk/wp-content/themes/screamingfrog/inc/download-modal.php" | grep "${platform}" | grep -i -o "https.*\.dmg" | head -1) appNewVersion=$(print "$downloadURL" | sed -E 's/https.*\/[a-zA-Z]*-([0-9.]*)\.dmg/\1/g')".0" expectedTeamID="CAHEVC3HZC" ;; diff --git a/fragments/labels/splashtopbusiness.sh b/fragments/labels/splashtopbusiness.sh new file mode 100644 index 0000000..e9da7fd --- /dev/null +++ b/fragments/labels/splashtopbusiness.sh @@ -0,0 +1,8 @@ +splashtopbusiness) + name="Splashtop Business" + type="pkgInDmg" + splashtopbusinessVersions=$(curl -fsL "https://www.splashtop.com/wp-content/themes/responsive/downloadx.php?product=stb&platform=mac-client") + downloadURL=$(getJSONValue "$splashtopbusinessVersions" "url") + appNewVersion="${${downloadURL#*INSTALLER_v}%*.dmg}" + expectedTeamID="CPQQ3AW49Y" + ;; diff --git a/fragments/labels/tailscale.sh b/fragments/labels/tailscale.sh new file mode 100644 index 0000000..02852f5 --- /dev/null +++ b/fragments/labels/tailscale.sh @@ -0,0 +1,8 @@ +tailscale) + name="Tailscale" + type="zip" + appNewVersion="$(curl -s https://pkgs.tailscale.com/stable/ | awk -F- '/Tailscale.*macos.zip/ {print $2}')" + downloadURL="https://pkgs.tailscale.com/stable/Tailscale-${appNewVersion}-macos.zip" + expectedTeamID="W5364U7YZB" + versionKey="CFBundleShortVersionString" + ;; diff --git a/fragments/labels/vlc.sh b/fragments/labels/vlc.sh index 8fe2487..dae2c67 100644 --- a/fragments/labels/vlc.sh +++ b/fragments/labels/vlc.sh @@ -3,10 +3,11 @@ vlc) type="dmg" if [[ $(arch) == "arm64" ]]; then downloadURL=$(curl -fs http://update.videolan.org/vlc/sparkle/vlc-arm64.xml | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2 ) - appNewVersion=$(curl -fs http://update.videolan.org/vlc/sparkle/vlc-arm64.xml | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2 ) + #appNewVersion=$(curl -fs http://update.videolan.org/vlc/sparkle/vlc-arm64.xml | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2 ) elif [[ $(arch) == "i386" ]]; then downloadURL=$(curl -fs http://update.videolan.org/vlc/sparkle/vlc-intel64.xml | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2 ) - appNewVersion=$(curl -fs http://update.videolan.org/vlc/sparkle/vlc-intel64.xml | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2 ) + #appNewVersion=$(curl -fs http://update.videolan.org/vlc/sparkle/vlc-intel64.xml | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2 ) fi + appNewVersion=$(echo ${downloadURL} | sed -E 's/.*\/vlc-([0-9.]*).*\.dmg/\1/' ) expectedTeamID="75GAHG3SZQ" ;; diff --git a/fragments/labels/xcreds.sh b/fragments/labels/xcreds.sh index 4035dd4..8a71fd0 100644 --- a/fragments/labels/xcreds.sh +++ b/fragments/labels/xcreds.sh @@ -1,11 +1,14 @@ xcreds) name="XCreds" - #type="pkgInZip" + # Downloading from twocanoes homepage + #type="pkgInDmg" #packageID="com.twocanoes.pkg.secureremoteaccess" #downloadURL=$(curl -fs "https://twocanoes.com/products/mac/xcreds/" | grep -ioE "https://.*\.zip" | head -1) #appNewVersion=$(curl -fs "https://twocanoes.com/products/mac/xcreds/" | grep -io "Current Version:.*" | sed -E 's/.*XCreds *([0-9.]*)<.*/\1/g') + # GitHub download type="pkg" downloadURL="$(downloadURLFromGit twocanoes xcreds)" - appNewVersion="$(versionFromGit twocanoes xcreds)" + #appNewVersion="$(versionFromGit twocanoes xcreds)" # GitHub tag contain “_” and not “.” so our function fails to get the right version + appNewVersion=$(echo "$downloadURL" | sed -E 's/.*XCreds_.*-([0-9.]*)\.pkg/\1/') expectedTeamID="UXP6YEHSPW" ;; diff --git a/fragments/labels/zoomoutlookplugin.sh b/fragments/labels/zoomoutlookplugin.sh new file mode 100644 index 0000000..15d45d5 --- /dev/null +++ b/fragments/labels/zoomoutlookplugin.sh @@ -0,0 +1,10 @@ +zoomoutlookplugin) + name="Zoom Outlook Plugin" + appName="PluginLauncher.app" + targetDir="/Applications/ZoomOutlookPlugin" + type="pkg" + downloadURL="https://zoom.us/client/latest/ZoomMacOutlookPlugin.pkg" + appNewVersion="$(curl -fsIL ${downloadURL} | grep -i ^location | cut -d "/" -f5 | cut -d "." -f1-3)" + expectedTeamID="BJ4HAAB9B3" + blockingProcesses=( "PluginLauncher" ) + ;; diff --git a/fragments/labels/zotero.sh b/fragments/labels/zotero.sh new file mode 100644 index 0000000..ef54e67 --- /dev/null +++ b/fragments/labels/zotero.sh @@ -0,0 +1,8 @@ +zotero) + name="Zotero" + type="dmg" + downloadURL="https://www.zotero.org/download/client/dl?channel=release&platform=mac&version=$(curl -fs "https://www.zotero.org/download/" | grep -Eio '"mac":"(.*)' | cut -d '"' -f 4)" + expectedTeamID="8LAYR367YV" + appNewVersion=$(curl -fs "https://www.zotero.org/download/" | grep -Eio '"mac":"(.*)' | cut -d '"' -f 4) + #Company="Corporation for Digital Scholarship" + ;; diff --git a/fragments/main.sh b/fragments/main.sh index 516c8c4..daf6b78 100644 --- a/fragments/main.sh +++ b/fragments/main.sh @@ -183,6 +183,10 @@ if [[ -n $appNewVersion ]]; then printlog "notifying" displaynotification "$message" "No update for $name!" fi + if [[ $DIALOG_CMD_FILE != "" ]]; then + updateDialog "complete" "Latest version already installed..." + sleep 2 + fi cleanupAndExit 0 "No newer version." REQ fi else diff --git a/fragments/version.sh b/fragments/version.sh index 0525adb..a243768 100644 --- a/fragments/version.sh +++ b/fragments/version.sh @@ -1 +1 @@ -10.0beta2 +10.0beta3