mirror of
https://github.com/mtan93/Installomator.git
synced 2026-03-08 05:31:53 +00:00
Merge branch 'dev' into fullscreen-check
This commit is contained in:
@@ -2,6 +2,12 @@
|
||||
|
||||
- We have moved the root check to the beginning of the script, and improved DEBUG handling with two different modes. `DEBUG=0` is still for production, and `1` is still for the DEBUG we previously knew downloading to the directory it is running from, but `2` will download to temporary folder, will detect updates, but will not install anything, but it will notify the user (almost as running the script without root before).
|
||||
- Added option to not interrupt Do Not Disturb full screen apps like Keynote or Zoom with `INTERRUPT_DND="no"`. Default is `"yes"` which is how it has worked until now.
|
||||
- `pkgName` in a label can now be searched for. An example is logitechoptions, where only the name of the pkg is given, and not the exact file path to it.
|
||||
- `LSMinimumSystemVersion` will now be honered, if the `Info.plist` in the app is specifying this. That means that an app that has this parameter in that file and it shows that the app requires a newer version of the OS than is currently installed, then we will not install it.
|
||||
- New variable `RETURN_LABEL_NAME`. If given the value `1`, like `RETURN_LABEL_NAME=1` then Installomator only returns the name of the label. It makes for a better user friendly message for displaying in DEPNotify if that is integrated.
|
||||
- Changed logic if `IGNORE_APP_STORE_APPS=yes`. Before this version a label like `microsoftonedrive` that was installed from App Store, and that we want to replace with the “ordinary” version, Installomator would still use `updateTool`, even though `IGNORE_APP_STORE_APPS=yes`. So we would have to have `INSTALL=force` in order to have the app replaced, as `updateTool` would be used. But now if `IGNORE_APP_STORE_APPS=yes` then `updateTool` will be not set, and the App Store app will be replaced. BUT if the installed software was not from App Store, then `updateTool` will not be used, and it would be a kind of a forced install (in the example of `microsoftonedrive`), except if the version is the same (where installation is skipped).
|
||||
- Added variable `SYSTEMOWNER` that is used when copying files when installing. Default `0` is to change owner of the app to the current user on the Mac, like this user was installing this app themselves. When using `1` we will put “root:wheel” on the app, which can be useful for shared machines.
|
||||
|
||||
|
||||
## v8.0
|
||||
|
||||
|
||||
@@ -328,6 +328,7 @@ textmate
|
||||
theunarchiver
|
||||
things
|
||||
thunderbird
|
||||
tidal
|
||||
toggltrack
|
||||
tom4aconverter
|
||||
torbrowser
|
||||
|
||||
@@ -55,7 +55,7 @@ caffexit $errorCount
|
||||
# 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="0.7.0"
|
||||
TARGET_VERSION="8.0"
|
||||
|
||||
vercomp () {
|
||||
if [[ $1 == $2 ]]; then
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
PKG_ID="com.scriptingosx.Installomator"
|
||||
TARGET_VERSION="0.7.0"
|
||||
TARGET_VERSION="8.0"
|
||||
URLDOWNLOAD="%MosyleCDNFile:blah-blah-blah%"
|
||||
######################################################################
|
||||
# Installation using Installomator (enter the software to install separated with spaces in the "what"-variable)
|
||||
|
||||
16
README.md
16
README.md
@@ -227,12 +227,12 @@ There are eight options:
|
||||
|
||||
- `ignore`: continue even when blocking processes are found.
|
||||
- `silent_fail`: exit script without prompt or installation.
|
||||
- `prompt_user`: (default) 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`: (default) show a user dialog for each blocking process found, user can choose "Quit and Update" or "Not Now". When "Quit and Update" is chosen, blocking process will be told to quit. Installomator will wait 30 seconds before checking again in case Save dialogs etc are being responded to. Installomator will abort if quitting after three tries does not succeed. "Not Now" will exit Installomator.
|
||||
- `prompt_user_then_kill`: show a user dialog for each blocking process found, user can choose "Quit and Update" or "Not Now". When "Quit and Update" is chosen, blocking process will be terminated. Installomator will abort if terminating after two tries does not succeed. "Not Now" will exit Installomator.
|
||||
- `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.
|
||||
WARNING! It might block the MDM agent on the machine, as the script will not exit, it will pause 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. This is default.
|
||||
- `tell_user_then_kill`: User will be showed a notification about the important update, but user is only allowed to Quit and Continue. If the quitting fails, the blocking processes will be terminated.
|
||||
- `kill`: kill process without prompting or giving the user a chance to save.
|
||||
|
||||
If any process was closed, Installomator will try to open the app again, after the update process is done.
|
||||
@@ -262,6 +262,12 @@ __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.
|
||||
|
||||
### Owner of copied apps
|
||||
Default is `SYSTEMOWNER=0`
|
||||
__options:__
|
||||
- `0`: Current user will be owner of copied apps, just like if they installed it themselves (default).
|
||||
- `1`: root:wheel will be set on the copied app. Useful for shared machines.
|
||||
|
||||
### Install behavior (force installation)
|
||||
|
||||
Since we now make a version checking, and only installs the software if the version is different, an `INSTALL` variable can be used to force the installation:
|
||||
|
||||
7
daisydisk.sh
Normal file
7
daisydisk.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
daisydisk)
|
||||
name="DaisyDisk"
|
||||
type="zip"
|
||||
downloadURL="https://daisydiskapp.com/downloads/DaisyDisk.zip"
|
||||
appNewVersion=$( curl -fs 'https://daisydiskapp.com/downloads/appcastReleaseNotes.php?appEdition=Standard' | grep Version | head -1 | cut -d \> -f 3 | cut -d \< -f 1 | awk '{print $2}' )
|
||||
expectedTeamID="4CBU3JHV97"
|
||||
;;
|
||||
@@ -1,7 +1,8 @@
|
||||
# MARK: check minimal macOS requirement
|
||||
autoload is-at-least
|
||||
|
||||
if ! is-at-least 10.14 $(sw_vers -productVersion); then
|
||||
installedOSversion=$(sw_vers -productVersion)
|
||||
if ! is-at-least 10.14 $installedOSversion; then
|
||||
printlog "Installomator requires at least macOS 10.14 Mojave."
|
||||
exit 98
|
||||
fi
|
||||
@@ -58,7 +59,7 @@ versionKey="CFBundleShortVersionString"
|
||||
currentUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ { print $3 }')
|
||||
|
||||
# MARK: check for root
|
||||
if [[ "$(whoami)" != "root" && "$DEBUG" -ne 2 ]]; then
|
||||
if [[ "$(whoami)" != "root" && "$DEBUG" -eq 0 ]]; then
|
||||
# not running as root
|
||||
cleanupAndExit 6 "not running as root, exiting"
|
||||
fi
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
mightymike)
|
||||
name="Nanosaur"
|
||||
name="Mighty Mike"
|
||||
type="dmg"
|
||||
downloadURL=$(downloadURLFromGit jorio MightyMike)
|
||||
appNewVersion=$(versionFromGit jorio MightyMike)
|
||||
7
fragments/disabled/mochakeyboard.sh
Normal file
7
fragments/disabled/mochakeyboard.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
mochakeyboard)
|
||||
name="Mocha Keyboard"
|
||||
type="appInDmgInZip"
|
||||
downloadURL="https://mochasoft.dk/mochakeyboard.dmg.zip"
|
||||
appNewVersion=""
|
||||
expectedTeamID="RR9F5EPNVW"
|
||||
;;
|
||||
7
fragments/disabled/mochatelnet.sh
Normal file
7
fragments/disabled/mochatelnet.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
mochatelnet)
|
||||
name="Telnet"
|
||||
type="appInDmgInZip"
|
||||
downloadURL="https://mochasoft.dk/telnet.dmg.zip"
|
||||
appNewVersion=""
|
||||
expectedTeamID="RR9F5EPNVW"
|
||||
;;
|
||||
7
fragments/disabled/mochatn3270.sh
Normal file
7
fragments/disabled/mochatn3270.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
mochatn3270)
|
||||
name="TN3270"
|
||||
type="appInDmgInZip"
|
||||
downloadURL="https://mochasoft.dk/tn3270.dmg.zip"
|
||||
appNewVersion=""
|
||||
expectedTeamID="RR9F5EPNVW"
|
||||
;;
|
||||
7
fragments/disabled/mochatn3812.sh
Normal file
7
fragments/disabled/mochatn3812.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
mochatn3812)
|
||||
name="TN3812"
|
||||
type="appInDmgInZip"
|
||||
downloadURL="https://mochasoft.dk/tn3812.dmg.zip"
|
||||
appNewVersion=""
|
||||
expectedTeamID="Frydendal"
|
||||
;;
|
||||
7
fragments/disabled/mochatn5250.sh
Normal file
7
fragments/disabled/mochatn5250.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
mochatn5250)
|
||||
name="TN5250"
|
||||
type="appInDmgInZip"
|
||||
downloadURL="https://mochasoft.dk/tn5250.dmg.zip"
|
||||
appNewVersion=""
|
||||
expectedTeamID="RR9F5EPNVW"
|
||||
;;
|
||||
@@ -18,6 +18,10 @@ cleanupAndExit() { # $1 = exit code, $2 message
|
||||
# If we closed any processes, reopen the app again
|
||||
reopenClosedProcess
|
||||
printlog "################## End Installomator, exit code $1 \n\n"
|
||||
# if label is wrong and we wanted name of the label, then return ##################
|
||||
if [[ $RETURN_LABEL_NAME -eq 1 ]]; then
|
||||
echo "#"
|
||||
fi
|
||||
exit "$1"
|
||||
}
|
||||
|
||||
@@ -66,7 +70,7 @@ 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
|
||||
@@ -78,7 +82,7 @@ printlog(){
|
||||
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
|
||||
@@ -86,7 +90,7 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name
|
||||
else
|
||||
filetype=$type
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$archiveName" ]; then
|
||||
downloadURL=$(curl --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" \
|
||||
| awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }")
|
||||
@@ -108,7 +112,7 @@ versionFromGit() {
|
||||
# $1 git user name, $2 git repo name
|
||||
gitusername=${1?:"no git user name"}
|
||||
gitreponame=${2?:"no git repo name"}
|
||||
|
||||
|
||||
appNewVersion=$(curl --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | grep tag_name | cut -d '"' -f 4 | sed 's/[^0-9\.]//g')
|
||||
if [ -z "$appNewVersion" ]; then
|
||||
printlog "could not retrieve version number for $gitusername/$gitreponame"
|
||||
@@ -122,7 +126,7 @@ versionFromGit() {
|
||||
|
||||
# Handling of differences in xpath between Catalina and Big Sur
|
||||
xpath() {
|
||||
# the xpath tool changes in Big Sur and now requires the `-e` option
|
||||
# the xpath tool changes in Big Sur and now requires the `-e` option
|
||||
if [[ $(sw_vers -buildVersion) > "20A" ]]; then
|
||||
/usr/bin/xpath -e $@
|
||||
# alternative: switch to xmllint (which is not perl)
|
||||
@@ -142,7 +146,7 @@ getAppVersion() {
|
||||
printlog "Custom App Version detection is used, found $appversion"
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
# pkgs contains a version number, then we don't have to search for an app
|
||||
if [[ $packageID != "" ]]; then
|
||||
appversion="$(pkgutil --pkg-info-plist ${packageID} 2>/dev/null | grep -A 1 pkg-version | tail -1 | sed -E 's/.*>([0-9.]*)<.*/\1/g')"
|
||||
@@ -154,7 +158,7 @@ getAppVersion() {
|
||||
printlog "No version found using packageID $packageID"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# get app in /Applications, or /Applications/Utilities, or find using Spotlight
|
||||
if [[ -d "/Applications/$appName" ]]; then
|
||||
applist="/Applications/$appName"
|
||||
@@ -211,7 +215,7 @@ checkRunningProcesses() {
|
||||
if pgrep -xq "$x"; then
|
||||
printlog "found blocking process $x"
|
||||
appClosed=1
|
||||
|
||||
|
||||
case $BLOCKING_PROCESS_ACTION in
|
||||
quit|quit_kill)
|
||||
printlog "telling app $x to quit"
|
||||
@@ -298,7 +302,7 @@ checkRunningProcesses() {
|
||||
reopenClosedProcess() {
|
||||
# If Installomator closed any processes, let's get the app opened again
|
||||
# credit: Søren Theilgaard (@theilgaard)
|
||||
|
||||
|
||||
# don't reopen if REOPEN is not "yes"
|
||||
if [[ $REOPEN != yes ]]; then
|
||||
printlog "REOPEN=no, not reopening anything"
|
||||
@@ -310,7 +314,7 @@ reopenClosedProcess() {
|
||||
printlog "DEBUG mode 1, not reopening anything"
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
if [[ $appClosed == 1 ]]; then
|
||||
printlog "Telling app $appName to open"
|
||||
#runAsUser osascript -e "tell app \"$appName\" to open"
|
||||
@@ -345,8 +349,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
cleanupAndExit 5 "Team IDs do not match"
|
||||
fi
|
||||
|
||||
# versioncheck
|
||||
# credit: Søren Theilgaard (@theilgaard)
|
||||
# app versioncheck
|
||||
appNewVersion=$(defaults read $appPath/Contents/Info.plist $versionKey)
|
||||
if [[ -n $appNewVersion && $appversion == $appNewVersion ]]; then
|
||||
printlog "Downloaded version of $name is $appNewVersion, same as installed."
|
||||
@@ -364,6 +367,21 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
printlog "Downloaded version of $name is $appNewVersion (replacing version $appversion)."
|
||||
fi
|
||||
|
||||
# macOS versioncheck
|
||||
minimumOSversion=$(defaults read $appPath/Contents/Info.plist LSMinimumSystemVersion)
|
||||
if [[ $minimumOSversion =~ '[0-9.]*' ]]; then
|
||||
printlog "App has LSMinimumSystemVersion: $minimumOSversion"
|
||||
if ! is-at-least $minimumOSversion $installedOSversion; then
|
||||
printlog "App requires higher System Version than installed: $installedOSversion"
|
||||
message="Cannot install $name, version $appNewVersion, as it is not compatible with the running system version."
|
||||
if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then
|
||||
printlog "notifying"
|
||||
displaynotification "$message" "Error updating $name!"
|
||||
fi
|
||||
cleanupAndExit 6 "Installed macOS is too old for this app."
|
||||
fi
|
||||
fi
|
||||
|
||||
# skip install for DEBUG 1
|
||||
if [ "$DEBUG" -eq 1 ]; then
|
||||
printlog "DEBUG mode 1 enabled, skipping remove, copy and chown steps"
|
||||
@@ -375,10 +393,10 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
printlog "DEBUG mode 2 enabled, exiting"
|
||||
cleanupAndExit 0
|
||||
fi
|
||||
|
||||
|
||||
# Test if variable CLIInstaller is set
|
||||
if [[ -z $CLIInstaller ]]; then
|
||||
|
||||
|
||||
# remove existing application
|
||||
if [ -e "$targetDir/$appName" ]; then
|
||||
printlog "Removing existing $targetDir/$appName"
|
||||
@@ -392,11 +410,12 @@ installAppWithPath() { # $1: path to app to install in $targetDir
|
||||
fi
|
||||
|
||||
# set ownership to current user
|
||||
if [ "$currentUser" != "loginwindow" ]; then
|
||||
if [[ "$currentUser" != "loginwindow" && $SYSTEMOWNER -ne 1 ]]; then
|
||||
printlog "Changing owner to $currentUser"
|
||||
chown -R "$currentUser" "$targetDir/$appName"
|
||||
else
|
||||
printlog "No user logged in, not changing user"
|
||||
printlog "No user logged in or SYSTEMOWNER=1, setting owner to root:wheel"
|
||||
chown -R root:wheel "$targetDir/$appName"
|
||||
fi
|
||||
|
||||
elif [[ ! -z $CLIInstaller ]]; then
|
||||
@@ -441,12 +460,12 @@ installFromDMG() {
|
||||
installFromPKG() {
|
||||
# verify with spctl
|
||||
printlog "Verifying: $archiveName"
|
||||
|
||||
|
||||
if ! spctlout=$(spctl -a -vv -t install "$archiveName" 2>&1 ); then
|
||||
printlog "Error verifying $archiveName"
|
||||
cleanupAndExit 4
|
||||
fi
|
||||
|
||||
|
||||
teamID=$(echo $spctlout | awk -F '(' '/origin=/ {print $2 }' | tr -d '()' )
|
||||
|
||||
# Apple signed software has no teamID, grab entire origin instead
|
||||
@@ -465,10 +484,11 @@ installFromPKG() {
|
||||
# Check version of pkg to be installed if packageID is set
|
||||
if [[ $packageID != "" && $appversion != "" ]]; then
|
||||
printlog "Checking package version."
|
||||
pkgutil --expand "$archiveName" "$archiveName"_pkg
|
||||
#printlog "$(cat "$archiveName"_pkg/Distribution | xpath '//installer-gui-script/pkg-ref[@id][@version]' 2>/dev/null)"
|
||||
appNewVersion=$(cat "$archiveName"_pkg/Distribution | xpath '//installer-gui-script/pkg-ref[@id][@version]' 2>/dev/null | grep -i "$packageID" | tr ' ' '\n' | grep -i version | cut -d \" -f 2) #sed -E 's/.*\"([0-9.]*)\".*/\1/g'
|
||||
rm -r "$archiveName"_pkg
|
||||
baseArchiveName=$(basename $archiveName)
|
||||
expandedPkg="$tmpDir/${baseArchiveName}_pkg"
|
||||
pkgutil --expand "$archiveName" "$expandedPkg"
|
||||
appNewVersion=$(cat "$expandedPkg"/Distribution | xpath 'string(//installer-gui-script/pkg-ref[@id][@version]/@version)' 2>/dev/null )
|
||||
rm -r "$expandedPkg"
|
||||
printlog "Downloaded package $packageID version $appNewVersion"
|
||||
if [[ $appversion == $appNewVersion ]]; then
|
||||
printlog "Downloaded version of $name is the same as installed."
|
||||
@@ -484,7 +504,7 @@ installFromPKG() {
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# skip install for DEBUG 1
|
||||
if [ "$DEBUG" -eq 1 ]; then
|
||||
printlog "DEBUG enabled, skipping installation"
|
||||
@@ -494,7 +514,7 @@ installFromPKG() {
|
||||
# skip install for DEBUG 2
|
||||
if [ "$DEBUG" -eq 2 ]; then
|
||||
printlog "DEBUG mode 2 enabled, exiting"
|
||||
cleanupAndExit 0
|
||||
cleanupAndExit 0
|
||||
fi
|
||||
|
||||
# install pkg
|
||||
@@ -508,17 +528,17 @@ installFromPKG() {
|
||||
installFromZIP() {
|
||||
# unzip the archive
|
||||
printlog "Unzipping $archiveName"
|
||||
|
||||
|
||||
# tar -xf "$archiveName"
|
||||
|
||||
# note: when you expand a zip using tar in Mojave the expanded
|
||||
# app will never pass the spctl check
|
||||
|
||||
# unzip -o -qq "$archiveName"
|
||||
|
||||
|
||||
# note: githubdesktop fails spctl verification when expanded
|
||||
# with unzip
|
||||
|
||||
|
||||
ditto -x -k "$archiveName" "$tmpDir"
|
||||
installAppWithPath "$tmpDir/$appName"
|
||||
}
|
||||
@@ -543,8 +563,19 @@ installPkgInDmg() {
|
||||
archiveName="${filearray[1]}"
|
||||
printlog "found pkg: $archiveName"
|
||||
else
|
||||
# it is now safe to overwrite archiveName for installFromPKG
|
||||
archiveName="$dmgmount/$pkgName"
|
||||
if ls "$tmpDir/$pkgName" ; then
|
||||
archiveName="$tmpDir/$pkgName"
|
||||
else
|
||||
# try searching for pkg
|
||||
findfiles=$(find "$tmpDir" -iname "$pkgName")
|
||||
filearray=( ${(f)findfiles} )
|
||||
if [[ ${#filearray} -eq 0 ]]; then
|
||||
cleanupAndExit 20 "couldn't find pkg “$pkgName” in zip $archiveName"
|
||||
fi
|
||||
# it is now safe to overwrite archiveName for installFromPKG
|
||||
archiveName="${filearray[1]}"
|
||||
printlog "found pkg: $archiveName"
|
||||
fi
|
||||
fi
|
||||
|
||||
# installFromPkgs
|
||||
@@ -564,12 +595,23 @@ installPkgInZip() {
|
||||
if [[ ${#filearray} -eq 0 ]]; then
|
||||
cleanupAndExit 20 "couldn't find pkg in zip $archiveName"
|
||||
fi
|
||||
archiveName="${filearray[1]}"
|
||||
# it is now safe to overwrite archiveName for installFromPKG
|
||||
archiveName="${filearray[1]}"
|
||||
printlog "found pkg: $archiveName"
|
||||
else
|
||||
# it is now safe to overwrite archiveName for installFromPKG
|
||||
archiveName="$tmpDir/$pkgName"
|
||||
if ls "$tmpDir/$pkgName" ; then
|
||||
archiveName="$tmpDir/$pkgName"
|
||||
else
|
||||
# try searching for pkg
|
||||
findfiles=$(find "$tmpDir" -iname "$pkgName")
|
||||
filearray=( ${(f)findfiles} )
|
||||
if [[ ${#filearray} -eq 0 ]]; then
|
||||
cleanupAndExit 20 "couldn't find pkg “$pkgName” in zip $archiveName"
|
||||
fi
|
||||
# it is now safe to overwrite archiveName for installFromPKG
|
||||
archiveName="${filearray[1]}"
|
||||
printlog "found pkg: $archiveName"
|
||||
fi
|
||||
fi
|
||||
|
||||
# installFromPkgs
|
||||
|
||||
@@ -23,8 +23,8 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
||||
# set to 0 for production, 1 or 2 for debugging
|
||||
# while debugging, items will be downloaded to the parent directory of this script
|
||||
# also no actual installation will be performed
|
||||
# debug mode 1 will download to the directory the script is run in, but will not check version
|
||||
# debug mode 2 will download to the temp directory, check for blocking processes, check version, but will not install anything or remove the current version
|
||||
# debug mode 1 will download to the directory the script is run in, but will not check the version
|
||||
# debug mode 2 will download to the temp directory, check for blocking processes, check the version, but will not install anything or remove the current version
|
||||
DEBUG=1
|
||||
|
||||
# notify behavior
|
||||
@@ -39,29 +39,36 @@ NOTIFY=success
|
||||
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 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
|
||||
# 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 show a user dialog for each blocking process found,
|
||||
# user can choose "Quit and Update" or "Not Now".
|
||||
# When "Quit and Update" is chosen, blocking process
|
||||
# will be told to quit. Installomator will wait 30 seconds
|
||||
# before checking again in case Save dialogs etc are being responded to.
|
||||
# Installomator will abort if quitting after three tries does not succeed.
|
||||
# "Not Now" will exit Installomator.
|
||||
# - prompt_user_then_kill
|
||||
# show a user dialog for each blocking process found,
|
||||
# attempt to quit two times, kill the process finally
|
||||
# user can choose "Quit and Update" or "Not Now".
|
||||
# When "Quit and Update" is chosen, blocking process
|
||||
# will be terminated. Installomator will abort if terminating
|
||||
# after two tries does not succeed. "Not Now" will exit Installomator.
|
||||
# - 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,
|
||||
# the script will not exit, it will pause 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.
|
||||
# but user is only allowed to Quit and Continue, and then we
|
||||
# ask the app to quit. This is default.
|
||||
# - tell_user_then_kill
|
||||
# Show dialog 2 times, and if the quitting fails, the
|
||||
# blocking processes will be killed.
|
||||
# User will be showed a notification about the important update,
|
||||
# but user is only allowed to Quit and Continue. If the quitting fails,
|
||||
# the blocking processes will be terminated.
|
||||
# - kill kill process without prompting or giving the user a chance to save
|
||||
|
||||
|
||||
@@ -81,18 +88,25 @@ LOGO=appstore
|
||||
# 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
|
||||
# - no If the installed app is from App Store (which include VPP installed apps)
|
||||
# it will not be touched, no matter its version (default)
|
||||
# - yes Replace App Store (and VPP) version of the 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.
|
||||
# Known bad example: Slack will lose all settings.
|
||||
|
||||
# Owner of copied apps
|
||||
SYSTEMOWNER=0
|
||||
# options:
|
||||
# - 0 Current user will be owner of copied apps, just like if they
|
||||
# installed it themselves (default).
|
||||
# - 1 root:wheel will be set on the copied app.
|
||||
# Useful for shared machines.
|
||||
|
||||
# install behavior
|
||||
INSTALL=""
|
||||
# options:
|
||||
# - When not set, software will only be installed
|
||||
# - When not set, the software will only be installed
|
||||
# if it is newer/different in version
|
||||
# - force Install even if it’s the same version
|
||||
|
||||
@@ -100,9 +114,17 @@ INSTALL=""
|
||||
# Re-opening of closed app
|
||||
REOPEN="yes"
|
||||
# options:
|
||||
# - yes App wil be reopened if it was closed
|
||||
# - yes App will be reopened if it was closed
|
||||
# - no App not reopened
|
||||
|
||||
# Only let Installomator return the name of the label
|
||||
# RETURN_LABEL_NAME=0
|
||||
# options:
|
||||
# - 1 Installomator will return the name of the label and exit, so last line of
|
||||
# output will be that name. When Installomator is locally installed and we
|
||||
# use DEPNotify, then DEPNotify can present a more nice name to the user,
|
||||
# instead of just the label name.
|
||||
|
||||
|
||||
# Interrupt Do Not Disturb (DND) full screen apps
|
||||
INTERRUPT_DND="yes"
|
||||
@@ -138,7 +160,7 @@ IGNORE_DND_APPS=""
|
||||
#
|
||||
# - packageID: (optional)
|
||||
# The package ID of a pkg
|
||||
# If given, will be used to find version of installed software, instead of searching for an app.
|
||||
# If given, will be used to find the version of installed software, instead of searching for an app.
|
||||
# Usefull if a pkg does not install an app.
|
||||
# See label installomator_st
|
||||
#
|
||||
@@ -148,7 +170,7 @@ IGNORE_DND_APPS=""
|
||||
#
|
||||
# - appNewVersion: (optional)
|
||||
# Version of the downloaded software.
|
||||
# If given, it will be compared to installed version, to see if download is different.
|
||||
# If given, it will be compared to the installed version, to see if the download is different.
|
||||
# It does not check for newer or not, only different.
|
||||
#
|
||||
# - versionKey: (optional)
|
||||
@@ -202,7 +224,7 @@ IGNORE_DND_APPS=""
|
||||
# blockingProcesses=( NONE )
|
||||
#
|
||||
# - pkgName: (optional, only used for pkgInDmg, dmgInZip, and appInDmgInZip)
|
||||
# File name of the pkg/dmg file _inside_ the dmg or zip
|
||||
# File name or path to the pkg/dmg file _inside_ the dmg or zip.
|
||||
# When not given the pkgName is derived from the $name
|
||||
#
|
||||
# - updateTool:
|
||||
@@ -219,10 +241,10 @@ IGNORE_DND_APPS=""
|
||||
#
|
||||
# - CLIInstaller:
|
||||
# - CLIArguments:
|
||||
# If the downloaded dmg is actually an installer that we can call using CLI, we can
|
||||
# If the downloaded dmg is an installer that we can call using CLI, we can
|
||||
# use these two variables for what to call.
|
||||
# We need to define `name` for the installed app (to be version checked), as well as
|
||||
# `installerTool` for the installer app (if named differently that `name`. Installomator
|
||||
# `installerTool` for the installer app (if named differently than `name`. Installomator
|
||||
# will add the path to the folder/disk image with the binary, and it will be called like this:
|
||||
`$CLIInstaller $CLIArguments`
|
||||
# For most installations `CLIInstaller` should contain the `installerTool` for the CLI call
|
||||
|
||||
@@ -3,5 +3,5 @@ applenyfonts)
|
||||
type="pkgInDmg"
|
||||
downloadURL="https://devimages-cdn.apple.com/design/resources/download/NY.dmg"
|
||||
packageID="com.apple.pkg.NYFonts"
|
||||
expectedTeamID="Development Update"
|
||||
expectedTeamID="Software Update"
|
||||
;;
|
||||
|
||||
7
fragments/labels/applesfarabic.sh
Normal file
7
fragments/labels/applesfarabic.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
applesfarabic)
|
||||
name="San Francisco Arabic"
|
||||
type="pkgInDmg"
|
||||
downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg"
|
||||
packageID="com.apple.pkg.SFArabicFonts"
|
||||
expectedTeamID="Software Update"
|
||||
;;
|
||||
@@ -3,5 +3,5 @@ applesfcompact)
|
||||
type="pkgInDmg"
|
||||
downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg"
|
||||
packageID="com.apple.pkg.SanFranciscoCompact"
|
||||
expectedTeamID="Development Update"
|
||||
expectedTeamID="Software Update"
|
||||
;;
|
||||
|
||||
@@ -3,5 +3,5 @@ applesfpro)
|
||||
type="pkgInDmg"
|
||||
downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg"
|
||||
packageID="com.apple.pkg.SanFranciscoPro"
|
||||
expectedTeamID="Development Update"
|
||||
expectedTeamID="Software Update"
|
||||
;;
|
||||
|
||||
@@ -2,7 +2,7 @@ applesfsymbols|\
|
||||
sfsymbols)
|
||||
name="SF Symbols"
|
||||
type="pkgInDmg"
|
||||
downloadURL=$( curl -fs "https://developer.apple.com/sf-symbols/" | grep -oe "https.*\.dmg" | head -1 )
|
||||
appNewVersion=$( echo "$downloadURL" | head -1 | sed -E 's/.*SF-Symbols-([0-9.]*)\..*/\1/g')
|
||||
downloadURL=$( curl -fs "https://developer.apple.com/sf-symbols/" | grep -oe "https.*Symbols.*\.dmg" | head -1 )
|
||||
appNewVersion=$( echo "$downloadURL" | sed -E 's/.*SF-Symbols-([0-9.]*)\..*/\1/g')
|
||||
expectedTeamID="Software Update"
|
||||
;;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
authydesktop)
|
||||
name="Authy Desktop"
|
||||
type="dmg"
|
||||
downloadURL="https://electron.authy.com/download?channel=stable&arch=x64&platform=darwin&version=latest&product=authy"
|
||||
downloadURL=$(curl -s -w '%{redirect_url}' -o /dev/null "https://electron.authy.com/download?channel=stable&arch=x64&platform=darwin&version=latest&product=authy" | sed 's/\ /%20/g')
|
||||
appNewVersion="$(curl -sfL --output /dev/null -r 0-0 "${downloadURL}" --remote-header-name --remote-name -w "%{url_effective}\n" | grep -o -E '([a-zA-Z0-9\_.%-]*)\.(dmg|pkg|zip|tbz)$' | sed -E 's/.*-([0-9.]*)\.dmg/\1/g')"
|
||||
expectedTeamID="9EVH78F4V4"
|
||||
;;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
autopkgr)
|
||||
# credit: Søren Theilgaard (@theilgaard)
|
||||
name="AutoPkgr"
|
||||
type="dmg"
|
||||
#downloadURL=$(curl -fs "https://api.github.com/repos/lindegroup/autopkgr/releases/latest" | awk -F '"' "/browser_download_url/ && /dmg/ && ! /sig/ && ! /CLI/ && ! /sha256/ { print \$4 }")
|
||||
downloadURL=$(downloadURLFromGit lindegroup autopkgr)
|
||||
appNewVersion=$(versionFromGit lindegroup autopkgr)
|
||||
expectedTeamID="JVY2ZR6SEF"
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
boxdrive)
|
||||
# credit: Isaac Ordonez, Mann consulting (@mannconsulting)
|
||||
name="Box"
|
||||
type="pkg"
|
||||
if [[ $(arch) == "arm64" ]]; then
|
||||
#Note: https://support.box.com/hc/en-us/articles/1500004479962-Box-Drive-support-on-devices-with-M1-chips
|
||||
downloadURL="https://e3.boxcdn.net/desktop/pre-releases/mac/BoxDrive.2.20.140-M1-beta.pkg"
|
||||
elif [[ $(arch) == "i386" ]]; then
|
||||
downloadURL="https://e3.boxcdn.net/box-installers/desktop/releases/mac/Box.pkg"
|
||||
fi
|
||||
downloadURL="https://e3.boxcdn.net/box-installers/desktop/releases/mac/Box.pkg"
|
||||
expectedTeamID="M683GB7CPW"
|
||||
;;
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
brave)
|
||||
# credit: @securitygeneration
|
||||
name="Brave Browser"
|
||||
type="dmg"
|
||||
if [[ $(arch) != "i386" ]]; then
|
||||
printlog "Architecture: arm64 (not i386)"
|
||||
downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osxarm64/release | grep -i "^location" | awk '{print $2}' | tr -d '\r\n')
|
||||
downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osxarm64/release | grep -i "^location" | sed -E 's/.*(https.*\.dmg).*/\1/g')
|
||||
appNewVersion="$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable-arm64/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2)"
|
||||
#appNewVersion="96.$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable-arm64/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 | cut -d "." -f1-3)"
|
||||
else
|
||||
printlog "Architecture: i386"
|
||||
downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osx/release | grep -i "^location" | awk '{print $2}' | tr -d '\r\n')
|
||||
downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osx/release | grep -i "^location" | sed -E 's/.*(https.*\.dmg).*/\1/g')
|
||||
appNewVersion="$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2)"
|
||||
#appNewVersion="96.$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 | cut -d "." -f1-3)"
|
||||
fi
|
||||
# downloadURL=$(curl --location --fail --silent "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2)
|
||||
appNewVersion=$(curl --location --fail --silent "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2)
|
||||
versionKey="CFBundleVersion"
|
||||
# downloadURL=$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2)
|
||||
expectedTeamID="KL8N8XSYF4"
|
||||
;;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
dangerzone)
|
||||
# credit: Micah Lee (@micahflee)
|
||||
name="Dangerzone"
|
||||
type="dmg"
|
||||
downloadURL=$(curl -s https://dangerzone.rocks/ | grep https://github.com/firstlookmedia/dangerzone/releases/download | grep \.dmg | cut -d'"' -f2)
|
||||
expectedTeamID="P24U45L8P5"
|
||||
downloadURL="$(downloadURLFromGit firstlookmedia dangerzone)"
|
||||
appNewVersion="$(versionFromGit firstlookmedia dangerzone)"
|
||||
expectedTeamID="N9B95FDWH4"
|
||||
;;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
depnotify)
|
||||
name="DEPNotify"
|
||||
type="zip"
|
||||
downloadURL="https://files.nomad.menu/DEPNotify.zip"
|
||||
type="pkg"
|
||||
#packageID="menu.nomad.depnotify"
|
||||
downloadURL="https://files.nomad.menu/DEPNotify.pkg"
|
||||
#appNewVersion=$()
|
||||
expectedTeamID="VRPY9KHGX6"
|
||||
targetDir="/Applications/Utilities"
|
||||
;;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
docker)
|
||||
# credit: @securitygeneration
|
||||
name="Docker"
|
||||
type="dmg"
|
||||
#downloadURL="https://download.docker.com/mac/stable/Docker.dmg"
|
||||
if [[ $(arch) == arm64 ]]; then
|
||||
downloadURL="https://desktop.docker.com/mac/stable/arm64/Docker.dmg"
|
||||
appNewVersion=$( curl -fs "https://desktop.docker.com/mac/main/arm64/appcast.xml" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[last()]' 2>/dev/null | cut -d '"' -f2 )
|
||||
elif [[ $(arch) == i386 ]]; then
|
||||
downloadURL="https://desktop.docker.com/mac/stable/amd64/Docker.dmg"
|
||||
appNewVersion=$( curl -fs "https://desktop.docker.com/mac/main/amd64/appcast.xml" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[last()]' 2>/dev/null | cut -d '"' -f2 )
|
||||
fi
|
||||
appNewVersion=$(curl -ifs https://docs.docker.com/docker-for-mac/release-notes/ | grep ">Docker Desktop Community" | head -1 | sed -n -e 's/^.*Community //p' | cut -d '<' -f1)
|
||||
expectedTeamID="9BNSXJN65R"
|
||||
;;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
ferdi)
|
||||
name="Ferdi"
|
||||
type="zip"
|
||||
if [[ $(arch) == i386 ]]; then
|
||||
downloadURL=$(curl --silent --fail "https://api.github.com/repos/getferdi/ferdi/releases/latest" \
|
||||
| awk -F '"' "/browser_download_url/ && /mac.zip/ && ! /blockmap/ && ! /arm64-mac/ && ! /AppImage/{ print \$4 }")
|
||||
elif [[ $(arch) == arm64 ]]; then
|
||||
downloadURL=$(downloadURLFromGit getferdi ferdi )
|
||||
archiveName="arm64-mac.zip"
|
||||
fi
|
||||
if [[ $(arch) == "arm64" ]]; then
|
||||
archiveName="arm64-mac.zip"
|
||||
elif [[ $(arch) == "i386" ]]; then
|
||||
archiveName="Ferdi-[0-9.]*-mac.zip"
|
||||
fi
|
||||
downloadURL="$(downloadURLFromGit getferdi ferdi)"
|
||||
appNewVersion=$(versionFromGit getferdi ferdi )
|
||||
expectedTeamID="B6J9X9DWFL"
|
||||
;;
|
||||
|
||||
7
fragments/labels/flux.sh
Normal file
7
fragments/labels/flux.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
flux)
|
||||
name="Flux"
|
||||
type="zip"
|
||||
downloadURL="https://justgetflux.com/mac/Flux.zip"
|
||||
expectedTeamID="VZKSA7H9J9"
|
||||
;;
|
||||
|
||||
@@ -5,4 +5,5 @@ gpgsuite)
|
||||
pkgName="Install.pkg"
|
||||
downloadURL=$(curl -s https://gpgtools.org/ | grep https://releases.gpgtools.org/GPG_Suite- | grep Download | cut -d'"' -f4)
|
||||
expectedTeamID="PKV8ZPD836"
|
||||
blockingProcesses=( "GPG Keychain" )
|
||||
;;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
gpgsync)
|
||||
# credit: Micah Lee (@micahflee)
|
||||
name="GPG Sync"
|
||||
type="pkg"
|
||||
downloadURL="https://github.com$(curl -s -L https://github.com/firstlookmedia/gpgsync/releases/latest | grep /firstlookmedia/gpgsync/releases/download | grep \.pkg | cut -d'"' -f2)"
|
||||
packageID="org.firstlook.gpgsync"
|
||||
downloadURL="$(downloadURLFromGit firstlookmedia gpgsync)"
|
||||
appNewVersion="$(versionFromGit firstlookmedia gpgsync)"
|
||||
expectedTeamID="P24U45L8P5"
|
||||
;;
|
||||
|
||||
7
fragments/labels/ibarcoder.sh
Normal file
7
fragments/labels/ibarcoder.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
ibarcoder)
|
||||
name="iBarcoder"
|
||||
type="dmg"
|
||||
downloadURL="https://cristallight.com/Downloads/mac/ibarcoder.dmg"
|
||||
appNewVersion="$(curl -fs "https://cristallight.com/iBarcoder/" | grep -i version: | head -1 | awk '{print $2}')"
|
||||
expectedTeamID="JAXVB9AH9M"
|
||||
;;
|
||||
7
fragments/labels/iina
Normal file
7
fragments/labels/iina
Normal file
@@ -0,0 +1,7 @@
|
||||
iina)
|
||||
name="IINA"
|
||||
type="dmg"
|
||||
downloadURL=$(downloadURLFromGit iina iina )
|
||||
appNewVersion=$(versionFromGit iina iina )
|
||||
expectedTeamID="67CQ77V27R"
|
||||
;;
|
||||
7
fragments/labels/itsycal.sh
Normal file
7
fragments/labels/itsycal.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
itsycal)
|
||||
name="Itsycal"
|
||||
type="zip"
|
||||
downloadURL=$(curl -fs https://s3.amazonaws.com/itsycal/itsycal-apple-silicon.xml | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)
|
||||
appNewVersion=$(curl -fs https://s3.amazonaws.com/itsycal/itsycal-apple-silicon.xml | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)
|
||||
expectedTeamID="HFT3T55WND"
|
||||
;;
|
||||
@@ -1,8 +1,12 @@
|
||||
libreoffice)
|
||||
# credit: Micah Lee (@micahflee)
|
||||
name="LibreOffice"
|
||||
type="dmg"
|
||||
downloadURL="https://download.documentfoundation.org/libreoffice/stable/$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)/mac/x86_64/LibreOffice_$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)_MacOS_x86-64.dmg"
|
||||
if [[ $(arch) == "arm64" ]]; then
|
||||
downloadURL="https://download.documentfoundation.org/libreoffice/stable/$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)/mac/aarch64/LibreOffice_$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)_MacOS_aarch64.dmg"
|
||||
elif [[ $(arch) == "i386" ]]; then
|
||||
downloadURL="https://download.documentfoundation.org/libreoffice/stable/$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)/mac/x86_64/LibreOffice_$(curl -s https://www.libreoffice.org/download/download/ | grep dl_version_number | head -n 1 | cut -d'>' -f3 | cut -d'<' -f1)_MacOS_x86-64.dmg"
|
||||
fi
|
||||
appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*_([0-9.]*)_.*/\1/g' )
|
||||
expectedTeamID="7P5S3ZLCN7"
|
||||
blockingProcesses=( soffice )
|
||||
;;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
logitechoptions)
|
||||
# credit: AP Orlebeke (@apizz)
|
||||
name="Logitech Options"
|
||||
type="pkgInZip"
|
||||
downloadURL=$(curl -fs -L https://www.logitech.com/en-us/product/options | grep -m 1 -o "https.*zip" | sed 's/\"//' | awk '{print $1}')
|
||||
#appNewVersion=$(curl -fs -L https://www.logitech.com/en-us/product/options | grep -m 1 -o "https.*zip" | sed 's/\"//' | awk '{print $1}' | sed -E 's/.*_([0-9\.]*)[-\.].*/\1/' )
|
||||
pkgName="LogiMgr Installer ${appNewVersion}.app/Contents/Resources/LogiMgr.pkg"
|
||||
downloadURL=$(curl -fs https://support.logi.com/api/v2/help_center/en-us/articles.json | tr "," "\n" | grep -A 10 "macOS" | grep -oie "https.*/.*/options.*\.zip")
|
||||
appNewVersion=$(curl -fs https://support.logi.com/api/v2/help_center/en-us/articles.json | tr "," "\n" | grep -A 10 "macOS" | grep -B 5 -ie "https.*/.*/options.*\.zip" | grep "Software Version" | sed 's/\\u[0-9a-z][0-9a-z][0-9a-z][0-9a-z]//g' | grep -ioe "Software Version.*[0-9.]*" | tr "/" "\n" | grep -oe "[0-9.]*" | head -1)
|
||||
#pkgName="LogiMgr Installer "*".app/Contents/Resources/LogiMgr.pkg"
|
||||
pkgName=LogiMgr.pkg
|
||||
expectedTeamID="QED4VVPZWA"
|
||||
;;
|
||||
|
||||
7
fragments/labels/lowprofile.sh
Normal file
7
fragments/labels/lowprofile.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
lowprofile)
|
||||
name="Low Profile"
|
||||
type="dmg"
|
||||
downloadURL="$(downloadURLFromGit ninxsoft LowProfile)"
|
||||
appNewVersion="$(versionFromGit ninxsoft LowProfile)"
|
||||
expectedTeamID="7K3HVCLV7Z"
|
||||
;;
|
||||
@@ -5,4 +5,3 @@ ottomatic)
|
||||
appNewVersion=$(versionFromGit jorio OttoMatic)
|
||||
expectedTeamID="RVNL7XC27G"
|
||||
;;
|
||||
|
||||
|
||||
7
fragments/labels/paretosecurity.sh
Normal file
7
fragments/labels/paretosecurity.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
paretosecurity)
|
||||
name="Pareto Security"
|
||||
type="dmg"
|
||||
downloadURL=$(downloadURLFromGit ParetoSecurity pareto-mac)
|
||||
appNewVersion=$(versionFromGit ParetoSecurity pareto-mac)
|
||||
expectedTeamID="PM784W7B8X"
|
||||
;;
|
||||
13
fragments/labels/pritunl.sh
Normal file
13
fragments/labels/pritunl.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
pritunl)
|
||||
name="Pritunl"
|
||||
type="pkgInZip"
|
||||
packageID="com.pritunl.pkg.Pritunl"
|
||||
if [[ $(arch) == "arm64" ]]; then
|
||||
archiveName="Pritunl.arm64.pkg.zip"
|
||||
elif [[ $(arch) == "i386" ]]; then
|
||||
archiveName="Pritunl.pkg.zip"
|
||||
fi
|
||||
downloadURL=$(downloadURLFromGit pritunl pritunl-client-electron)
|
||||
appNewVersion=$(versionFromGit pritunl pritunl-client-electron)
|
||||
expectedTeamID="U22BLATN63"
|
||||
;;
|
||||
@@ -1,7 +1,8 @@
|
||||
proxyman)
|
||||
name="Proxyman"
|
||||
type="dmg"
|
||||
downloadURL="https://proxyman.io/release/osx/Proxyman_latest.dmg"
|
||||
expectedTeamID="3X57WP8E8V"
|
||||
appNewVersion=$(curl -s -L https://github.com/ProxymanApp/Proxyman | grep -o 'releases/tag/.*\>' | awk -F '/' '{print $3}')
|
||||
;;
|
||||
name="Proxyman"
|
||||
type="dmg"
|
||||
#downloadURL="https://proxyman.io/release/osx/Proxyman_latest.dmg"
|
||||
downloadURL="$(downloadURLFromGit ProxymanApp Proxyman)"
|
||||
appNewVersion="$(versionFromGit ProxymanApp Proxyman)"
|
||||
expectedTeamID="3X57WP8E8V"
|
||||
;;
|
||||
|
||||
7
fragments/labels/sdnotary.sh
Normal file
7
fragments/labels/sdnotary.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
sdnotary)
|
||||
name="SD Notary"
|
||||
type="zip"
|
||||
downloadURL=$(curl -fs https://latenightsw.com/sd-notary-notarizing-made-easy/ | grep -io "https://.*/.*\.zip")
|
||||
appNewVersion=$(echo "$downloadURL" | sed -E 's/.*\/[a-zA-Z]*([0-9.]*)-.*\.zip/\1/g')
|
||||
expectedTeamID="Z7S6X96M3X"
|
||||
;;
|
||||
8
fragments/labels/secretive.sh
Normal file
8
fragments/labels/secretive.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
secretive)
|
||||
name="Secretive"
|
||||
type="zip"
|
||||
downloadURL=$(downloadURLFromGit maxgoedjen secretive)
|
||||
appNewVersion=$(versionFromGit maxgoedjen secretive)
|
||||
expectedTeamID="Z72PRUAWF6"
|
||||
;;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
signal)
|
||||
# credit: Søren Theilgaard (@theilgaard)
|
||||
name="Signal"
|
||||
type="dmg"
|
||||
downloadURL=https://updates.signal.org/desktop/$(curl -fs https://updates.signal.org/desktop/latest-mac.yml | awk '/url/ && /dmg/ {print $3}')
|
||||
downloadURL=https://updates.signal.org/desktop/$(curl -fs https://updates.signal.org/desktop/latest-mac.yml | awk '/url/ && /dmg/ {print $3}' | grep -i universal)
|
||||
appNewVersion=$(curl -fs https://updates.signal.org/desktop/latest-mac.yml | grep version | awk '{print $2}')
|
||||
expectedTeamID="U68MSDN6DR"
|
||||
;;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
textexpander)
|
||||
name="TextExpander"
|
||||
type="zip"
|
||||
downloadURL="https://textexpander.com/cgi-bin/redirect.pl?cmd=download&platform=osx"
|
||||
appNewVersion=$( curl -fsIL "https://textexpander.com/cgi-bin/redirect.pl?cmd=download&platform=osx" | grep -i "^location" | awk '{print $2}' | tail -1 | cut -d "_" -f2 | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p' )
|
||||
type="dmg"
|
||||
downloadURL="https://cgi.textexpander.com/cgi-bin/redirect.pl?cmd=download&platform=osx"
|
||||
appNewVersion=$( curl -fsIL "https://cgi.textexpander.com/cgi-bin/redirect.pl?cmd=download&platform=osx" | grep -i "^location" | awk '{print $2}' | tail -1 | cut -d "_" -f2 | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p' )
|
||||
expectedTeamID="7PKJ6G4DXL"
|
||||
;;
|
||||
|
||||
7
fragments/labels/tidal.sh
Normal file
7
fragments/labels/tidal.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
tidal)
|
||||
name="TIDAL"
|
||||
type="dmg"
|
||||
downloadURL="https://download.tidal.com/desktop/TIDAL.dmg"
|
||||
appNewVersion=$(curl -fs https://update.tidal.com/updates/latest\?v\=1 | cut -d '"' -f4 | sed -E 's/https.*\/TIDAL\.([0-9.]*)\.zip/\1/g')
|
||||
expectedTeamID="GK2243L7KB"
|
||||
;;
|
||||
7
fragments/labels/vimac.sh
Normal file
7
fragments/labels/vimac.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
vimac)
|
||||
name="Vimac"
|
||||
type="zip"
|
||||
downloadURL=$(curl -fs "https://vimacapp.com/latest-release-metadata" | tr ',' '\n' | awk -F\" '/download_url/ {print $4}')
|
||||
appNewVersion=$(curl -fs "https://vimacapp.com/latest-release-metadata" | tr ',' '\n' | awk -F\" '/short_version/ {print $4}')
|
||||
expectedTeamID="LQ2VH8VB84"
|
||||
;;
|
||||
@@ -1,8 +1,11 @@
|
||||
wireshark)
|
||||
# credit: Oh4sh0 https://github.com/Oh4sh0
|
||||
name="Wireshark"
|
||||
type="dmg"
|
||||
downloadURL="https://1.as.dl.wireshark.org/osx/Wireshark%20Latest%20Intel%2064.dmg"
|
||||
if [[ $(arch) == i386 ]]; then
|
||||
downloadURL="https://1.as.dl.wireshark.org/osx/Wireshark%20Latest%20Intel%2064.dmg"
|
||||
elif [[ $(arch) == arm64 ]]; then
|
||||
downloadURL="https://1.as.dl.wireshark.org/osx/Wireshark%20Latest%20Arm%2064.dmg"
|
||||
fi
|
||||
appNewVersion=$(curl -fs https://www.wireshark.org/download.html | grep "Stable Release" | grep -o "(.*.)" | cut -f2 | head -1 | awk -F '[()]' '{print $2}')
|
||||
expectedTeamID="7Z6EMTD2C6"
|
||||
;;
|
||||
|
||||
@@ -3,9 +3,9 @@ zulujdk11)
|
||||
type="pkgInDmg"
|
||||
packageID="com.azulsystems.zulu.11"
|
||||
if [[ $(arch) == i386 ]]; then
|
||||
downloadURL=$(curl -fs "https://www.azul.com/downloads/zulu-community/" | xmllint --html --format - 2>/dev/null | tr , '\n' | grep -o "https:.*/zulu11.*ca-jdk11.*x64.dmg" | sed 's/\\//g')
|
||||
downloadURL=https://cdn.azul.com/zulu/bin/$(curl -fs "https://cdn.azul.com/zulu/bin/" | grep -Eio '">zulu11.*ca-jdk11.*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=$(curl -fs "https://www.azul.com/downloads/zulu-community/" | xmllint --html --format - 2>/dev/null | tr , '\n' | grep -o "https:.*/zulu11.*ca-jdk11.*aarch64.dmg" | sed 's/\\//g')
|
||||
downloadURL=https://cdn.azul.com/zulu/bin/$(curl -fs "https://cdn.azul.com/zulu/bin/" | grep -Eio '">zulu11.*ca-jdk11.*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/+/\./" }
|
||||
|
||||
@@ -3,9 +3,9 @@ zulujdk15)
|
||||
type="pkgInDmg"
|
||||
packageID="com.azulsystems.zulu.15"
|
||||
if [[ $(arch) == i386 ]]; then
|
||||
downloadURL=$(curl -fs "https://www.azul.com/downloads/zulu-community/" | xmllint --html --format - 2>/dev/null | tr , '\n' | grep -o "https:.*/zulu15.*ca-jdk15.*x64.dmg" | sed 's/\\//g')
|
||||
downloadURL=https://cdn.azul.com/zulu/bin/$(curl -fs "https://cdn.azul.com/zulu/bin/" | grep -Eio '">zulu15.*ca-jdk15.*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=$(curl -fs "https://www.azul.com/downloads/zulu-community/" | xmllint --html --format - 2>/dev/null | tr , '\n' | grep -o "https:.*/zulu15.*ca-jdk15.*aarch64.dmg" | sed 's/\\//g')
|
||||
downloadURL=https://cdn.azul.com/zulu/bin/$(curl -fs "https://cdn.azul.com/zulu/bin/" | grep -Eio '">zulu15.*ca-jdk15.*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/+/\./" }
|
||||
|
||||
13
fragments/labels/zulujdk17.sh
Normal file
13
fragments/labels/zulujdk17.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
zulujdk17)
|
||||
name="Zulu JDK 17"
|
||||
type="pkgInDmg"
|
||||
packageID="com.azulsystems.zulu.17"
|
||||
if [[ $(arch) == i386 ]]; then
|
||||
downloadURL=https://cdn.azul.com/zulu/bin/$(curl -fs "https://cdn.azul.com/zulu/bin/" | grep -Eio '">zulu17.*ca-jdk17.*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 '">zulu17.*ca-jdk17.*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
|
||||
;;
|
||||
@@ -5,6 +5,13 @@
|
||||
;;
|
||||
esac
|
||||
|
||||
# Are we only asked to return label name
|
||||
if [[ $RETURN_LABEL_NAME -eq 1 ]]; then
|
||||
printlog "Only returning label name."
|
||||
printlog "$name"
|
||||
echo "$name"
|
||||
exit
|
||||
fi
|
||||
|
||||
# MARK: application download and installation starts here
|
||||
|
||||
@@ -123,9 +130,8 @@ getAppVersion
|
||||
printlog "appversion: $appversion"
|
||||
|
||||
# MARK: Exit if new version is the same as installed version (appNewVersion specified)
|
||||
# credit: Søren Theilgaard (@theilgaard)
|
||||
if [[ $INSTALL == "force" ]]; then
|
||||
printlog "Using force to install, so not using updateTool."
|
||||
if [[ "$type" != "updateronly" && ($INSTALL == "force" || $IGNORE_APP_STORE_APPS == "yes") ]]; then
|
||||
printlog "Label is not of type “updateronly”, and it’s set to use force to install or ignoring app store apps, so not using updateTool."
|
||||
updateTool=""
|
||||
fi
|
||||
if [[ -n $appNewVersion ]]; then
|
||||
|
||||
@@ -82,6 +82,43 @@ pkgInvestigation() {
|
||||
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."
|
||||
}
|
||||
|
||||
dmgInvestigation() {
|
||||
echo "DMG investigation."
|
||||
# mount the dmg
|
||||
echo "Mounting $archiveName"
|
||||
if ! dmgmount=$(echo "Y"$'\n' | hdiutil attach "$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then
|
||||
echo "Error mounting $archiveName"
|
||||
exit 3
|
||||
fi
|
||||
echo "Mounted: $dmgmount"
|
||||
|
||||
# check if app og pkg exists on disk image
|
||||
appPath=$(find "$dmgmount" -name "*.app" -maxdepth 1 -print )
|
||||
pkgPath=$(find "$dmgmount" -name "*.pkg" -maxdepth 1 -print )
|
||||
|
||||
if [[ $appPath != "" ]]; then
|
||||
echo "App found: $appPath"
|
||||
if [[ $archiveExt = "dmgInZip" ]]; then
|
||||
archiveExt="appInDmgInZip"
|
||||
fi
|
||||
appInvestigation
|
||||
elif [[ $pkgPath != "" ]]; then
|
||||
echo "PKG found: $pkgPath"
|
||||
if [[ $archiveExt = "dmgInZip" ]]; then
|
||||
archiveExt="pkgInDmgInZip not supported, yet!"
|
||||
else
|
||||
archiveExt="pkgInDmg"
|
||||
fi
|
||||
pkgInvestigation
|
||||
else
|
||||
echo "Nothing found on DMG."
|
||||
exit 9
|
||||
fi
|
||||
|
||||
hdiutil detach "$dmgmount"
|
||||
}
|
||||
|
||||
appInvestigation() {
|
||||
appName=${appPath##*/}
|
||||
name=${appName%.*}
|
||||
@@ -122,19 +159,22 @@ if ! downloadOut="$(curl -fL "$downloadURL" --remote-header-name --remote-name -
|
||||
echo "result: $downloadOut"
|
||||
echo "Trying all headers…" # that I know of
|
||||
if ! downloadOut="$(curl -fL -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" -H "accept-encoding: gzip, deflate, br" -H "Referrer Policy: strict-origin-when-cross-origin" -H "upgrade-insecure-requests: 1" -H "sec-fetch-dest: document" -H "sec-gpc: 1" -H "sec-fetch-user: ?1" -H "accept-language: en-US,en;q=0.9" -H "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" -H "sec-fetch-mode: navigate" "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
|
||||
# we are only here if the download failed
|
||||
echo "error downloading $downloadURL using all headers."
|
||||
echo "result: $downloadOut"
|
||||
# Sometimes a server will give some results to the downloaded output
|
||||
if [[ -n $downloadOut ]]; then
|
||||
echo "Trying output of this…"
|
||||
downloadURL="$(echo $downloadOut | tail -1)"
|
||||
# Last chance for succes on this download
|
||||
if ! downloadOut="$(curl -fL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
|
||||
echo "error downloading $downloadURL using previous output."
|
||||
echo "result: $downloadOut"
|
||||
echo "No more tries. Cannot continue."
|
||||
exit 1
|
||||
echo "Trying almost all headers…" # that I know of
|
||||
if ! downloadOut="$(curl -fL -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" -H "accept-encoding: gzip, deflate, br" -H "upgrade-insecure-requests: 1" -H "sec-fetch-dest: document" -H "sec-gpc: 1" -H "sec-fetch-user: ?1" -H "accept-language: en-US,en;q=0.9" -H "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" -H "sec-fetch-mode: navigate" "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
|
||||
# we are only here if the download failed
|
||||
echo "error downloading $downloadURL using two different sets of headers."
|
||||
echo "result: $downloadOut"
|
||||
# Sometimes a server will give some results to the downloaded output
|
||||
if [[ -n $downloadOut ]]; then
|
||||
echo "Trying output of this…"
|
||||
downloadURL="$(echo $downloadOut | tail -1)"
|
||||
# Last chance for succes on this download
|
||||
if ! downloadOut="$(curl -fL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then
|
||||
echo "error downloading $downloadURL using previous output."
|
||||
echo "result: $downloadOut"
|
||||
echo "No more tries. Cannot continue."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -171,10 +211,6 @@ echo "name: $name"
|
||||
archiveExt=${archiveName##*.}
|
||||
type=$archiveExt
|
||||
echo "archiveExt: $archiveExt"
|
||||
identifier=${name:l} # making lower case
|
||||
identifier=${identifier//\%[0-9a-fA-F][0-9a-fA-F]} # removing certain characters
|
||||
identifier=${identifier//[,._*@$\(\)\-]} # removing more characters from label name
|
||||
echo "identifier: $identifier"
|
||||
|
||||
# Now figuring out the filename extension and handling those situations
|
||||
if [ "$archiveExt" = "pkg" ]; then
|
||||
@@ -183,31 +219,7 @@ if [ "$archiveExt" = "pkg" ]; then
|
||||
pkgInvestigation
|
||||
elif [ "$archiveExt" = "dmg" ]; then
|
||||
echo "Diskimage found"
|
||||
# mount the dmg
|
||||
echo "Mounting $archiveName"
|
||||
if ! dmgmount=$(echo "Y"$'\n' | hdiutil attach "$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then
|
||||
echo "Error mounting $archiveName"
|
||||
exit 3
|
||||
fi
|
||||
echo "Mounted: $dmgmount"
|
||||
|
||||
# check if app og pkg exists on disk image
|
||||
appPath=$(find "$dmgmount" -name "*.app" -maxdepth 1 -print )
|
||||
pkgPath=$(find "$dmgmount" -name "*.pkg" -maxdepth 1 -print )
|
||||
|
||||
if [[ $appPath != "" ]]; then
|
||||
echo "App found: $appPath"
|
||||
appInvestigation
|
||||
elif [[ $pkgPath != "" ]]; then
|
||||
echo "PKG found: $pkgPath"
|
||||
archiveExt="pkgInDmg"
|
||||
pkgInvestigation
|
||||
else
|
||||
echo "Nothing found on DMG."
|
||||
exit 9
|
||||
fi
|
||||
|
||||
hdiutil detach "$dmgmount"
|
||||
dmgInvestigation
|
||||
elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then
|
||||
echo "Compressed file found"
|
||||
# unzip the archive
|
||||
@@ -216,6 +228,7 @@ elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then
|
||||
# check if app og pkg exists after expanding
|
||||
appPath=$(find "$tmpDir" -name "*.app" -maxdepth 2 -print )
|
||||
pkgPath=$(find "$tmpDir" -name "*.pkg" -maxdepth 2 -print )
|
||||
archiveName=$(find "$tmpDir" -name "*.dmg" -maxdepth 2 -print )
|
||||
|
||||
if [[ $appPath != "" ]]; then
|
||||
echo "App found: $appPath"
|
||||
@@ -223,14 +236,24 @@ elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then
|
||||
elif [[ $pkgPath != "" ]]; then
|
||||
echo "PKG found: $pkgPath"
|
||||
archiveExt="pkgInZip"
|
||||
echo "archiveExt: $archiveExt"
|
||||
pkgInvestigation
|
||||
elif [[ $archiveName != "" ]]; then
|
||||
echo "Disk image found: $archiveName"
|
||||
archiveExt="dmgInZip"
|
||||
echo "archiveExt: $archiveExt"
|
||||
dmgInvestigation
|
||||
else
|
||||
echo "Nothing found in compressed archive."
|
||||
exit 9
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
identifier=${name:l} # making lower case
|
||||
identifier=${identifier//\%[0-9a-fA-F][0-9a-fA-F]} # removing certain characters
|
||||
identifier=${identifier//[,._*@$\(\)\-]} # removing more characters from label name
|
||||
echo "identifier: $identifier"
|
||||
|
||||
# github-part to figure out if we can find author and repo, to use our github functions for the label
|
||||
if echo "$downloadURL" | grep -i "github.com.*releases/download"; then
|
||||
echo "\n**********\n\nFound GitHub path"
|
||||
|
||||
Reference in New Issue
Block a user