Merge pull request #189 from Installomator/Labels

Evernote
This commit is contained in:
Armin Briegel
2021-07-14 14:04:08 +02:00
committed by GitHub
4 changed files with 55 additions and 79 deletions

View File

@@ -1,3 +1,8 @@
- Change in finding installed apps. We now look in /Applications and /Applications/Utilities first. If not found there, we use spotligt to find it. (We discovered a problem when a user has Parallels Windows installed with Microsoft Edge in it. Then Installomator wanted to update the app all the time, becaus spotligt found that Windows version of the app that Parallels created.)
- Added bunch of new labels
- Improved `buildCaseStatement.sh` a lot. It is a great start when figuring out how to create a new label for an app, or a piece of software.
- Mosyle changed their app name from Business to Self-Service
## v0.5 - 2021-04-13 ## v0.5 - 2021-04-13
- Major update and now with help from @Theile and @Isaac - Major update and now with help from @Theile and @Isaac

View File

@@ -865,6 +865,14 @@ longversion)
blockingProcesses=( "1Password Extension Helper" "1Password 7" "1Password (Safari)" "1PasswordNativeMessageHost" "1PasswordSafariAppExtension" ) blockingProcesses=( "1Password Extension Helper" "1Password 7" "1Password (Safari)" "1PasswordNativeMessageHost" "1PasswordSafariAppExtension" )
#forcefulQuit=YES #forcefulQuit=YES
;; ;;
4kvideodownloader)
name="4K Video Downloader"
type="dmg"
downloadURL="$(curl -fsL "https://www.4kdownload.com/products/product-videodownloader" | grep -E -o "https:\/\/dl\.4kdownload\.com\/app\/4kvideodownloader_.*?.dmg\?source=website" | head -1)"
appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/[0-9a-zA-Z]*_([0-9.]*)\.dmg.*/\1/g')
versionKey="CFBundleVersion"
expectedTeamID="GHQ37VJF83"
;;
8x8) 8x8)
# credit: #D-A-James from MacAdmins Slack and Isaac Ordonez, Mann consulting (@mannconsulting) # credit: #D-A-James from MacAdmins Slack and Isaac Ordonez, Mann consulting (@mannconsulting)
name="8x8 Work" name="8x8 Work"
@@ -979,6 +987,13 @@ androidfiletransfer)
downloadURL="https://dl.google.com/dl/androidjumper/mtp/current/AndroidFileTransfer.dmg" downloadURL="https://dl.google.com/dl/androidjumper/mtp/current/AndroidFileTransfer.dmg"
expectedTeamID="EQHXZ8M8AV" expectedTeamID="EQHXZ8M8AV"
;; ;;
anydesk)
name="AnyDesk"
type="dmg"
downloadURL="https://download.anydesk.com/anydesk.dmg"
appNewVersion="$(curl -fs https://anydesk.com/da/downloads/mac-os | grep -i "d-block" | grep -E -o ">v[0-9.]* .*MB" | sed -E 's/.*v([0-9.]*) .*/\1/g')"
expectedTeamID="KU6W3B6JMZ"
;;
apparency) apparency)
name="Apparency" name="Apparency"
type="dmg" type="dmg"
@@ -1427,6 +1442,14 @@ etrecheck)
downloadURL="https://cdn.etrecheck.com/EtreCheckPro.zip" downloadURL="https://cdn.etrecheck.com/EtreCheckPro.zip"
expectedTeamID="U87NE528LC" expectedTeamID="U87NE528LC"
;; ;;
evernote)
name="Evernote"
type="dmg"
downloadURL=$(curl -fs -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15)" "https://evernote.com/download" | grep -i ".dmg" | cut -d '"' -f2)
appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)-.*/\1/g' )
expectedTeamID="Q79WDW8YH9"
appName="Evernote.app"
;;
exelbanstats) exelbanstats)
# credit: Søren Theilgaard (@theilgaard) # credit: Søren Theilgaard (@theilgaard)
name="Stats" name="Stats"
@@ -1443,6 +1466,13 @@ fantastical)
appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "^location" | awk '{print $2}' | sed -E 's/.*\/[a-zA-Z]*_([0-9.]*)\..*/\1/g' ) appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "^location" | awk '{print $2}' | sed -E 's/.*\/[a-zA-Z]*_([0-9.]*)\..*/\1/g' )
expectedTeamID="85C27NK92C" expectedTeamID="85C27NK92C"
;; ;;
favro)
name="Favro"
type="dmg"
downloadURL="https://download.favro.com/FavroDesktop/macOS/x64/$(curl -fs https://download.favro.com/FavroDesktop/macOS/x64/Latest.html | cut -d ">" -f1 | cut -d "=" -f 4 | cut -d '"' -f1)"
appNewVersion="$(curl -fs https://download.favro.com/FavroDesktop/macOS/x64/Latest.html | cut -d ">" -f1 | cut -d "=" -f 4 | cut -d '"' -f1 | sed -E 's/.*-([0-9.]*)\.dmg/\1/g')"
expectedTeamID="PUA8Q354ZF"
;;
ferdi) ferdi)
name="Ferdi" name="Ferdi"
type="dmg" type="dmg"
@@ -2485,6 +2515,13 @@ silnite)
expectedTeamID="QWY4LRW926" expectedTeamID="QWY4LRW926"
blockingProcesses=( NONE ) blockingProcesses=( NONE )
;; ;;
sirimote)
name="SiriMote"
type="zip"
downloadURL="http://bit.ly/sirimotezip"
#appNewVersion="" # Not found on web page
expectedTeamID="G78RJ6NLJU"
;;
sizeup) sizeup)
# credit: AP Orlebeke (@apizz) # credit: AP Orlebeke (@apizz)
name="SizeUp" name="SizeUp"
@@ -2552,10 +2589,8 @@ sonoss2)
sourcetree) sourcetree)
name="Sourcetree" name="Sourcetree"
type="zip" type="zip"
downloadURL=$(curl -fs https://product-downloads.atlassian.com/software/sourcetree/Appcast/SparkleAppcastAlpha.xml \ downloadURL=$(curl -fs "https://www.sourcetreeapp.com" | grep -i "macURL" | tr '"' '\n' | grep -io "https://.*/Sourcetree.*\.zip" | tail -1)
| xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null \ appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/Sourcetree_([0-9.]*)_[0-9]*\.zip/\1/g')
| cut -d '"' -f 2 )
appNewVersion=$(curl -fs https://product-downloads.atlassian.com/software/sourcetree/Appcast/SparkleAppcastAlpha.xml | xpath '//rss/channel/item[last()]/title' 2>/dev/null | sed -n -e 's/^.*Version //p' | sed 's/\<\/title\>//' | sed $'s/[^[:print:]\t]//g')
expectedTeamID="UPXU4CQZ5P" expectedTeamID="UPXU4CQZ5P"
;; ;;
spotify) spotify)
@@ -2678,7 +2713,7 @@ theunarchiver)
name="The Unarchiver" name="The Unarchiver"
type="dmg" type="dmg"
downloadURL="https://dl.devmate.com/com.macpaw.site.theunarchiver/TheUnarchiver.dmg" downloadURL="https://dl.devmate.com/com.macpaw.site.theunarchiver/TheUnarchiver.dmg"
#appNewVersion="" appNewVersion="$(curl -fs "https://theunarchiver.com" | grep -i "Latest version" | head -1 | sed -E 's/.*> ([0-9.]*) .*/\1/g')"
expectedTeamID="S8EX82NJP6" expectedTeamID="S8EX82NJP6"
appName="The Unarchiver.app" appName="The Unarchiver.app"
;; ;;
@@ -3269,7 +3304,7 @@ visualstudiocode)
appNewVersion=$(curl -fsL "https://code.visualstudio.com/Updates" | grep "/darwin" | grep -oiE ".com/([^>]+)([^<]+)/darwin" | cut -d "/" -f 2 | sed $'s/[^[:print:]\t]//g' | head -1 ) appNewVersion=$(curl -fsL "https://code.visualstudio.com/Updates" | grep "/darwin" | grep -oiE ".com/([^>]+)([^<]+)/darwin" | cut -d "/" -f 2 | sed $'s/[^[:print:]\t]//g' | head -1 )
expectedTeamID="UBF8T346G9" expectedTeamID="UBF8T346G9"
appName="Visual Studio Code.app" appName="Visual Studio Code.app"
blockingProcesses=( Electron ) blockingProcesses=( Code )
;; ;;
microsoftword) microsoftword)
name="Microsoft Word" name="Microsoft Word"

View File

@@ -1,4 +1,5 @@
1password7 1password7
4kvideodownloader
8x8 8x8
abstract abstract
adobebrackets adobebrackets
@@ -13,6 +14,7 @@ alfred
amazonchime amazonchime
amazonworkspaces amazonworkspaces
androidfiletransfer androidfiletransfer
anydesk
apparency apparency
appcleaner appcleaner
applenyfonts applenyfonts
@@ -65,8 +67,10 @@ egnyte
element element
eraseinstall eraseinstall
etrecheck etrecheck
evernote
exelbanstats exelbanstats
fantastical fantastical
favro
ferdi ferdi
figma figma
firefox firefox
@@ -217,6 +221,7 @@ shield
sidekick sidekick
signal signal
silnite silnite
sirimote
sizeup sizeup
sketch sketch
skype skype

View File

@@ -5,6 +5,10 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
downloadURL=${1?:"need to provide a download URL"} downloadURL=${1?:"need to provide a download URL"}
# Note: this tool _very_ experimental and does not work in many cases # Note: this tool _very_ experimental and does not work in many cases
# That being said, it's a great place to start for building up the label in the Case-statement
# Usage
# ./buildCaseStatement.sh <URL to download software>
# create temporary working directory # create temporary working directory
@@ -20,15 +24,7 @@ fi
# download the URL # download the URL
echo "Downloading $downloadURL" echo "Downloading $downloadURL"
<<<<<<< HEAD
<<<<<<< Updated upstream
if ! archivePath=$(curl -fsL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}"); then
=======
if ! downloadOut="$(curl -fsL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then if ! downloadOut="$(curl -fsL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
>>>>>>> Stashed changes
=======
if ! downloadOut="$(curl -fsL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
>>>>>>> 4932ea6a3186d902d88c9bb5a3774c6ff81b1608
echo "error downloading $downloadURL" echo "error downloading $downloadURL"
exit 2 exit 2
fi fi
@@ -44,13 +40,6 @@ xpath() {
fi fi
} }
<<<<<<< HEAD
<<<<<<< Updated upstream
#archivePath=$(find $tmpDir -print )
echo "archivePath: $archivePath"
archiveName=${archivePath##*/}
echo "archiveName: $archiveName"
=======
pkgInvestigation() { pkgInvestigation() {
echo "Package found" echo "Package found"
teamID=$(spctl -a -vv -t install "$archiveName" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' ) teamID=$(spctl -a -vv -t install "$archiveName" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' )
@@ -81,39 +70,6 @@ echo "archivePath: $archivePath"
archiveName=${archivePath##*/} archiveName=${archivePath##*/}
echo "archiveName: $archiveName" echo "archiveName: $archiveName"
mv $archiveTempName $archiveName mv $archiveTempName $archiveName
>>>>>>> Stashed changes
=======
pkgInvestigation() {
echo "Package found"
teamID=$(spctl -a -vv -t install "$archiveName" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' )
echo "For PKGs it's advised to find packageID for version checking"
pkgutil --expand "$pkgPath" "$archiveName"_pkg
cat "$archiveName"_pkg/Distribution | xpath '//installer-gui-script/pkg-ref[@id][@version]' 2>/dev/null
packageID="$(cat "$archiveName"_pkg/Distribution | xpath '//installer-gui-script/pkg-ref[@id][@version]' 2>/dev/null | tr ' ' '\n' | grep -i "id" | cut -d \" -f 2)"
rm -r "$archiveName"_pkg
echo "$packageID"
echo "Above is the possible packageIDs that can be used, and the correct one is probably one of those with a version number. More investigation might be needed to figure out correct packageID if several are displayed."
}
appInvestigation() {
appName=${appPath##*/}
# verify with spctl
echo "Verifying: $appPath"
if ! teamID=$(spctl -a -vv "$appPath" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' ); then
echo "Error verifying $appPath"
exit 4
fi
}
echo "downloadOut: ${downloadOut}"
archiveTempName=$( echo "${downloadOut}" | head -1 )
echo "archiveTempName: $archiveTempName"
archivePath=$( echo "${downloadOut}" | tail -1 )
echo "archivePath: $archivePath"
archiveName=${archivePath##*/}
echo "archiveName: $archiveName"
mv $archiveTempName $archiveName
>>>>>>> 4932ea6a3186d902d88c9bb5a3774c6ff81b1608
name=${archiveName%.*} name=${archiveName%.*}
echo "name: $name" echo "name: $name"
archiveExt=${archiveName##*.} archiveExt=${archiveName##*.}
@@ -122,25 +78,8 @@ identifier=$(echo $name | tr '[:upper:]' '[:lower:]')
echo "identifier: $identifier" echo "identifier: $identifier"
if [ "$archiveExt" = "pkg" ]; then if [ "$archiveExt" = "pkg" ]; then
<<<<<<< HEAD
<<<<<<< Updated upstream
echo "Package found"
teamID=$(spctl -a -vv -t install "$archiveName" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' )
echo "For PKGs it's advised to find packageID for version checking"
pkgutil --expand "$archiveName" "$archiveName"_pkg
cat "$archiveName"_pkg/Distribution | xpath '//installer-gui-script/pkg-ref[@id][@version]' 2>/dev/null
packageID="$(cat "$archiveName"_pkg/Distribution | xpath '//installer-gui-script/pkg-ref[@id][@version]' 2>/dev/null | tr ' ' '\n' | grep -i "id" | cut -d \" -f 2)"
rm -r "$archiveName"_pkg
echo "$packageID"
echo "Above is the possible packageIDs that can be used, and the correct one is probably one of those with a version number. More investigation might be needed to figure out correct packageID if several are displayed."
=======
pkgPath="$archiveName" pkgPath="$archiveName"
pkgInvestigation pkgInvestigation
>>>>>>> Stashed changes
=======
pkgPath="$archiveName"
pkgInvestigation
>>>>>>> 4932ea6a3186d902d88c9bb5a3774c6ff81b1608
elif [ "$archiveExt" = "dmg" ]; then elif [ "$archiveExt" = "dmg" ]; then
echo "Diskimage found" echo "Diskimage found"
# mount the dmg # mount the dmg
@@ -182,15 +121,7 @@ elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then
fi fi
echo echo
<<<<<<< HEAD
<<<<<<< Updated upstream
echo "appNewVersion is often difficult to find. Can sometimes be found in the filename, but also on a web page."
=======
echo "appNewVersion is often difficult to find. Can sometimes be found in the filename, but also on a web page. See archivePath above if link contains information about this." echo "appNewVersion is often difficult to find. Can sometimes be found in the filename, but also on a web page. See archivePath above if link contains information about this."
>>>>>>> Stashed changes
=======
echo "appNewVersion is often difficult to find. Can sometimes be found in the filename, but also on a web page. See archivePath above if link contains information about this."
>>>>>>> 4932ea6a3186d902d88c9bb5a3774c6ff81b1608
echo echo
echo "$identifier)" echo "$identifier)"
echo " name=\"$name\"" echo " name=\"$name\""