Merge branch 'dev' of github.com:scriptingosx/Installomator into dev

This commit is contained in:
Armin Briegel
2021-07-14 14:16:37 +02:00
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
- Major update and now with help from @Theile and @Isaac

View File

@@ -871,6 +871,14 @@ longversion)
blockingProcesses=( "1Password Extension Helper" "1Password 7" "1Password (Safari)" "1PasswordNativeMessageHost" "1PasswordSafariAppExtension" )
#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)
# credit: #D-A-James from MacAdmins Slack and Isaac Ordonez, Mann consulting (@mannconsulting)
name="8x8 Work"
@@ -985,6 +993,13 @@ androidfiletransfer)
downloadURL="https://dl.google.com/dl/androidjumper/mtp/current/AndroidFileTransfer.dmg"
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)
name="Apparency"
type="dmg"
@@ -1433,6 +1448,14 @@ etrecheck)
downloadURL="https://cdn.etrecheck.com/EtreCheckPro.zip"
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)
# credit: Søren Theilgaard (@theilgaard)
name="Stats"
@@ -1449,6 +1472,13 @@ fantastical)
appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "^location" | awk '{print $2}' | sed -E 's/.*\/[a-zA-Z]*_([0-9.]*)\..*/\1/g' )
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)
name="Ferdi"
type="dmg"
@@ -2491,6 +2521,13 @@ silnite)
expectedTeamID="QWY4LRW926"
blockingProcesses=( NONE )
;;
sirimote)
name="SiriMote"
type="zip"
downloadURL="http://bit.ly/sirimotezip"
#appNewVersion="" # Not found on web page
expectedTeamID="G78RJ6NLJU"
;;
sizeup)
# credit: AP Orlebeke (@apizz)
name="SizeUp"
@@ -2558,10 +2595,8 @@ sonoss2)
sourcetree)
name="Sourcetree"
type="zip"
downloadURL=$(curl -fs https://product-downloads.atlassian.com/software/sourcetree/Appcast/SparkleAppcastAlpha.xml \
| xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null \
| 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')
downloadURL=$(curl -fs "https://www.sourcetreeapp.com" | grep -i "macURL" | tr '"' '\n' | grep -io "https://.*/Sourcetree.*\.zip" | tail -1)
appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/Sourcetree_([0-9.]*)_[0-9]*\.zip/\1/g')
expectedTeamID="UPXU4CQZ5P"
;;
spotify)
@@ -2684,7 +2719,7 @@ theunarchiver)
name="The Unarchiver"
type="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"
appName="The Unarchiver.app"
;;
@@ -3275,7 +3310,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 )
expectedTeamID="UBF8T346G9"
appName="Visual Studio Code.app"
blockingProcesses=( Electron )
blockingProcesses=( Code )
;;
microsoftword)
name="Microsoft Word"

View File

@@ -1,4 +1,5 @@
1password7
4kvideodownloader
8x8
abstract
adobebrackets
@@ -14,6 +15,7 @@ alttab
amazonchime
amazonworkspaces
androidfiletransfer
anydesk
apparency
appcleaner
applenyfonts
@@ -72,8 +74,10 @@ egnyte
element
eraseinstall
etrecheck
evernote
exelbanstats
fantastical
favro
ferdi
figma
firefox
@@ -228,6 +232,7 @@ shield
sidekick
signal
silnite
sirimote
sizeup
sketch
skype

View File

@@ -5,6 +5,10 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
downloadURL=${1?:"need to provide a download URL"}
# 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
@@ -20,15 +24,7 @@ fi
# download the URL
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
>>>>>>> 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"
exit 2
fi
@@ -44,13 +40,6 @@ xpath() {
fi
}
<<<<<<< HEAD
<<<<<<< Updated upstream
#archivePath=$(find $tmpDir -print )
echo "archivePath: $archivePath"
archiveName=${archivePath##*/}
echo "archiveName: $archiveName"
=======
pkgInvestigation() {
echo "Package found"
teamID=$(spctl -a -vv -t install "$archiveName" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' )
@@ -81,39 +70,6 @@ echo "archivePath: $archivePath"
archiveName=${archivePath##*/}
echo "archiveName: $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%.*}
echo "name: $name"
archiveExt=${archiveName##*.}
@@ -122,25 +78,8 @@ identifier=$(echo $name | tr '[:upper:]' '[:lower:]')
echo "identifier: $identifier"
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"
pkgInvestigation
>>>>>>> Stashed changes
=======
pkgPath="$archiveName"
pkgInvestigation
>>>>>>> 4932ea6a3186d902d88c9bb5a3774c6ff81b1608
elif [ "$archiveExt" = "dmg" ]; then
echo "Diskimage found"
# mount the dmg
@@ -182,15 +121,7 @@ elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then
fi
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."
>>>>>>> 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 "$identifier)"
echo " name=\"$name\""