diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b9bade3 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# EditorConfig is awesome: https://EditorConfig.org + + # Unix-style newlines and whitespace cleanup + [*] + end_of_line = lf + insert_final_newline = true + trim_trailing_whitespace = true + insert_final_newline = true + + # shell formatting + [*.{sh,bash,zsh}] + indent_style = space + indent_size = 4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8db070c..5a9e96e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,24 @@ +## v9? + +- 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"`. -## v0.7 - pre-release +## v8.0 -- default for `BLOCKING_PROCESS_ACTION`is now `BLOCKING_PROCESS_ACTION=tell_user` and not `prompt_user`. It will demand the user to quit the app to get it updated, and not present any option to skip it. In considering various use cases in different MDM solutions this is the best option going forward. Users usually choose to update, and is most often not bothered much with this information. If it's absoultely a bad time, then they can move the dialog box to the side, and click it when ready. +- removed leading `0` from the version because it has lost all meaning (thanks to @grahampugh for the inspiration) +- Installomator now detects when an app is already installed, and will display notifications correctly the user based on if the app was updated or installed for the first time. +- New variables for labels that should be installed using CLI: `CLIInstaller` and `CLIArguments`. When the installer app is named differently than the installed app, then the variable `installerTool` should be used to name the app that should be located in the DMG or zip. See the label __adobecreativeclouddesktop__ to see its use. +- `buildLabel.sh` has been improved to build GitHub software labels much easier. In essense if the URL contains github.com, then it will try to find if it's the latest version or if variable `archiveName` is needed for finding the software. Also improved messaging throughout the script, as well as handling a situation where a pkg does not include a “Distribution” file, but a “PackageInfo”. +- MDM script extended with `caffeinate` so Mac will not go to sleep during the time it takes installomator to run. Especially during setup, this can be useful. +- Microsoft labels with `updateTool` variable, is updated to run `msupdate --list` before running the updateTool directly. Problems have been reported that the update would fail if the `--list` parameter for the command was not run first. This should help with the Jamf agent stalling during installation. +- Added bunch of new labels, and improved others. + +## v0.7 + +- default for `BLOCKING_PROCESS_ACTION`is now `BLOCKING_PROCESS_ACTION=tell_user` and not `prompt_user`. It will demand the user to quit the app to get it updated, and not present any option to skip it. In considering various use cases in different MDM solutions this is the best option going forward. Users usually choose to update, and is most often not bothered much with this information. If it's absoultely a bad time, then they can move the dialog box to the side, and click it when ready. - script is now assembled from fragments. This helps avoid merging conflicts on git and allows the core team to work on the script logic while also accepting new labels. See the "Assemble Script ReadMe" for details. - We now detect App Store installed apps, and we do not replace them automatically. An example is Slack that will loose all settings if it is suddenly changed from App Store version to the "web" version (they differ in the handling of settings files). If `INSTALL=force` then we will replace the App Store app. We log all this. -- 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.) +- 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 spotlight found that Windows version of the app that Parallels created.) - Added bunch of new labels, and improved others. - Renamed `buildCaseStatement.sh` to `buildLabel.sh` and improved it a lot. It is a great start when figuring out how to create a new label for an app, or a piece of software. Look at the tutorials in our wiki. - Mosyle changed their app name from Business to Self-Service @@ -26,10 +39,10 @@ - Major update and now with help from @Theile and @Isaac - Added additional `BLOCKING_PROCESS_ACTION` handlings - Added additional `NOTIFY=all`. Usuful if used in Self Service, as the user will be notified before download, before install as well as when it is done. -- Added variable `LOGO` for icons i dialogs, use `LOGO=appstore` (or `jamf` or `mosyleb` or `mosylem` or `addigy`). It's also possible to set it to a direct path to a specific icon. Default is `appstore`. +- Added variable `LOGO` for icons i dialogs, use `LOGO=appstore` (or `jamf` or `mosyleb` or `mosylem` or `addigy`). It's also possible to set it to a direct path to a specific icon. Default is `appstore`. - Added variable `INSTALL` that can be set to `INSTALL=force` if software needs to be installed even though latest version is already installed (it will be a reinstall). - Version control now included. The variable `appNewVersion` in a label can be used to tell what the latest version from the web is. If this is not given, version checking is done after download. -- For a label that only installs a pkg without an app in it, a variable `packageID` can be used for version checking. +- For a label that only installs a pkg without an app in it, a variable `packageID` can be used for version checking. - Labels now sorted alphabetically, except for the Microsoft ones (that are at the end of the list). A bunch of new labels added, and lots of them have either been changed or improved (with `appNewVersion` og `packageID`). - If an app is asked to be closed down, it will now be opened again after the update. - If your MDM cannot call a script with parameters, the label can be set in the top of the script. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f725b46 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,34 @@ +# Contributing to Installomator + +__Please note, that if you are contributing to this project with new labels or other suggestions in PRs, please put your changes in the files below `fragments`-folder. DO NOT edit the full `Installomator.sh` script. The full script is now a build of the fragments, and will be overwritten.__ + +We try to keep the script as short as possible, and with more than 300 labels, we can save 300 lines in the script, if we do not have credit lines on each of these. So we are thankful for your contribution, but we will be removing these lines in the coming releases. + +## Labels + +If you need a new label for a piece of software, please take a look at the tutorials in the Wiki, if those can be helpful for starting out on the creation of the label. + +We expect you to try out finding the __version__ of the software online, so that `appNewVersion` can be filled in the label. It helps a lot when the software needs update, and greatly improve user experience. + +Please document what you found out about the __version__ of the software if it's not included. We will not accept a new label if this is not documented, we will ask about this if it was not included. This is very important for the quality and reliability of Installomator. + +When creating a new label, please file a pull request (PR). And feel free to ask questions or make your comments about what else is needed, if we should take a look at the label, or help out in finding the version or isolating URLs or anything else. + +Please include the log of installing this label in the description, like this: +``` +% /Users/st/Documents/GitHub/Installomator/utils/assemble.sh software +2021-11-24 10:07:19 software ################## Start Installomator v. 0.8.0 +2021-11-24 10:07:19 software ################## software +2021-11-24 10:07:19 software DEBUG mode 1 enabled. +``` + +Please have one label per PR, so we can separate these. Also if you change/fix a label. + +Thank you very much for your contribution! + + +## Issues + +Do not create an issue just when you have a questions, but do file an issue or pull request (PR) for bugs or wrong behavior. Include the full log and include the version of Installomator you're running. + +When in doubt, use the MacAdmins.org Slack as described in [README.md](https://github.com/Installomator/Installomator/) diff --git a/Installomator.sh b/Installomator.sh index 5b848cc..81b56c7 100755 --- a/Installomator.sh +++ b/Installomator.sh @@ -34,7 +34,7 @@ NOTIFY=success # behavior when blocking processes are found -BLOCKING_PROCESS_ACTION=prompt_user +BLOCKING_PROCESS_ACTION=tell_user # options: # - ignore continue even when blocking processes are found # - quit app will be told to quit nicely, if running @@ -51,6 +51,9 @@ BLOCKING_PROCESS_ACTION=prompt_user # - 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. @@ -68,7 +71,20 @@ LOGO=appstore # - 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 are escaped). +# 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 @@ -148,6 +164,8 @@ REOPEN="yes" # - archiveName: (optional) # The name of the downloaded file. # When not given the archiveName is derived from the $name. +# Note: This has to be defined BEFORE calling downloadURLFromGit or +# versionFromGit functions in the label. # # - appName: (optional) # File name of the app bundle in the dmg to verify and copy (include .app). @@ -180,13 +198,32 @@ REOPEN="yes" # $updateTool $updateArguments # Will be run instead of of downloading and installing a complete new version. # Use this when the updateTool does differential and optimized downloads. -# e.g. msupdate +# e.g. msupdate on various Microsoft labels # # - updateToolRunAsCurrentUser: # When this variable is set (any value), $updateTool will be run as the current user. # -VERSION="0.7.0b1" -VERSIONDATE="2021-08-17" +# - CLIInstaller: +# - CLIArguments: +# If the downloaded dmg is actually 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 +# 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 +# (if it’s the same). +# We can support a whole range of other software titles by implementing this. +# See label adobecreativeclouddesktop +# +# - installerTool: +# Introduced as part of `CLIInstaller`. If the installer in the DMG or ZIP is named +# differently than the installed app, then this variable can be used to name the +# installer that should be located after mounting/expanding the downloaded archive. +# See label adobecreativeclouddesktop +# +VERSION="9.0dev" +VERSIONDATE="2021-11-23" # MARK: Functions @@ -338,6 +375,7 @@ getAppVersion() { appversion="$(pkgutil --pkg-info-plist ${packageID} 2>/dev/null | grep -A 1 pkg-version | tail -1 | sed -E 's/.*>([0-9.]*)<.*/\1/g')" if [[ $appversion != "" ]]; then printlog "found packageID $packageID installed, version $appversion" + updateDetected="YES" return else printlog "No version found using packageID $packageID" @@ -352,7 +390,11 @@ getAppVersion() { else applist=$(mdfind "kind:application $appName" -0 ) fi - printlog "App(s) found: ${applist}" + if [[ -z applist ]]; then + printlog "No previous app found" + else + printlog "App(s) found: ${applist}" + fi appPathArray=( ${(0)applist} ) @@ -363,6 +405,17 @@ getAppVersion() { #appversion=$(mdls -name kMDItemVersion -raw $installedAppPath ) appversion=$(defaults read $installedAppPath/Contents/Info.plist $versionKey) #Not dependant on Spotlight indexing printlog "found app at $installedAppPath, version $appversion" + updateDetected="YES" + # Is current app from App Store + if [[ -d "$installedAppPath"/Contents/_MASReceipt ]];then + printlog "Installed $appName is from App Store, use “IGNORE_APP_STORE_APPS=yes” to replace." + if [[ $IGNORE_APP_STORE_APPS == "yes" ]]; then + printlog "Replacing App Store apps, no matter the version" + appversion=0 + else + cleanupAndExit 1 "App previously installed from App Store, and we respect that" + fi + fi else printlog "could not determine location of $appName" fi @@ -522,10 +575,10 @@ installAppWithPath() { # $1: path to app to install in $targetDir # versioncheck # credit: Søren Theilgaard (@theilgaard) appNewVersion=$(defaults read $appPath/Contents/Info.plist $versionKey) - if [[ $appversion == $appNewVersion ]]; then + if [[ -n $appNewVersion && $appversion == $appNewVersion ]]; then printlog "Downloaded version of $name is $appNewVersion, same as installed." if [[ $INSTALL != "force" ]]; then - message="$name, version $appNewVersion, is the latest version." + message="$name, version $appNewVersion, is the latest version." if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then printlog "notifying" displaynotification "$message" "No update for $name!" @@ -549,26 +602,44 @@ installAppWithPath() { # $1: path to app to install in $targetDir # not running as root cleanupAndExit 6 "not running as root, exiting" fi + + # Test if variable CLIInstaller is set + if [[ -z $CLIInstaller ]]; then + + # remove existing application + if [ -e "$targetDir/$appName" ]; then + printlog "Removing existing $targetDir/$appName" + rm -Rf "$targetDir/$appName" + fi - # remove existing application - if [ -e "$targetDir/$appName" ]; then - printlog "Removing existing $targetDir/$appName" - rm -Rf "$targetDir/$appName" - fi + # copy app to /Applications + printlog "Copy $appPath to $targetDir" + if ! ditto "$appPath" "$targetDir/$appName"; then + cleanupAndExit 7 "Error while copying" + fi - # copy app to /Applications - printlog "Copy $appPath to $targetDir" - if ! ditto "$appPath" "$targetDir/$appName"; then - cleanupAndExit 7 "Error while copying" - fi + # set ownership to current user + if [ "$currentUser" != "loginwindow" ]; then + printlog "Changing owner to $currentUser" + chown -R "$currentUser" "$targetDir/$appName" + else + printlog "No user logged in, not changing user" + fi + elif [[ ! -z $CLIInstaller ]]; then + mountname=$(dirname $appPath) + printlog "CLIInstaller exists, running installer command $mountname/$CLIInstaller $CLIArguments" #INFO - # set ownership to current user - if [ "$currentUser" != "loginwindow" ]; then - printlog "Changing owner to $currentUser" - chown -R "$currentUser" "$targetDir/$appName" - else - printlog "No user logged in, not changing user" + CLIoutput=$("$mountname/$CLIInstaller" "${CLIArguments[@]}" 2>&1) + CLIstatus=$(echo $?) + logoutput="$CLIoutput" # dedupliatelogs "$CLIoutput" + + if [ $CLIstatus -ne 0 ] ; then + cleanupAndExit 3 "Error installing $mountname/$CLIInstaller $CLIArguments error:\n$logoutput" #ERROR + else + printlog "Succesfully ran $mountname/$CLIInstaller $CLIArguments" + fi + printlog "Debugging enabled, update tool output was:\n$logoutput" #DEBUG fi } @@ -591,7 +662,6 @@ mountDMG() { installFromDMG() { mountDMG - installAppWithPath "$dmgmount/$appName" } @@ -630,7 +700,7 @@ installFromPKG() { if [[ $appversion == $appNewVersion ]]; then printlog "Downloaded version of $name is the same as installed." if [[ $INSTALL != "force" ]]; then - message="$name, version $appNewVersion, is the latest version." + message="$name, version $appNewVersion, is the latest version." if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then printlog "notifying" displaynotification "$message" "No update for $name!" @@ -778,7 +848,7 @@ runUpdateTool() { } finishing() { - printlog "Finishing…" + printlog "Finishing..." sleep 10 # wait a moment to let spotlight catch up getAppVersion @@ -792,7 +862,11 @@ finishing() { if [[ $currentUser != "loginwindow" && ( $NOTIFY == "success" || $NOTIFY == "all" ) ]]; then printlog "notifying" - displaynotification "$message" "$name update/installation complete!" + if [[ $updateDetected == "YES" ]]; then + displaynotification "$message" "$name update complete!" + else + displaynotification "$message" "$name installation complete!" + fi fi } @@ -835,9 +909,20 @@ done # lowercase the label label=${label:l} +# separate check for 'version' in order to print plain version number without any other information +if [[ $label == "version" ]]; then + echo "$VERSION" + exit 0 +fi + printlog "################## Start Installomator v. $VERSION" printlog "################## $label" +# Check for DEBUG mode +if [[ $DEBUG -gt 0 ]]; then + printlog "DEBUG mode $DEBUG enabled." +fi + # How we get version number from app # (alternative is "CFBundleVersion", that can be used in labels) versionKey="CFBundleShortVersionString" @@ -848,11 +933,6 @@ currentUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ { print # MARK: labels in case statement case $label in -version) - # print the script VERSION - printlog "$VERSION" - exit 0 - ;; longversion) # print the script version printlog "Installomater: version $VERSION ($VERSIONDATE)" @@ -928,6 +1008,23 @@ adobeconnect) appNewVersion=$(curl -fs https://helpx.adobe.com/adobe-connect/connect-downloads-updates.html | grep "Mac" | grep version | head -1 | sed -E 's/.*\(version ([0-9\.]*),.*/\1/g') expectedTeamID="JQ525L2MZD" ;; +adobecreativeclouddesktop) + name="Adobe Creative Cloud" + #appName="Install.app" + type="dmg" + if [[ $(arch) == "arm64" ]]; then + downloadURL=$(curl -fs "https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" | grep -o "https*.*macarm64.*dmg" | cut -d '"' -f1 | head -1) + elif [[ $(arch) == "i386" ]]; then + downloadURL=$(curl -fs "https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" | grep -o "https*.*osx10.*dmg" | cut -d '"' -f1 | head -1) + fi + #downloadURL=$(curl -fs "https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" | grep -o "https*.*dmg" | head -1) + appNewVersion=$(curl -fs "https://helpx.adobe.com/creative-cloud/release-note/cc-release-notes.html" | grep "mandatory" | head -1 | grep -o "Version *.* released" | cut -d " " -f2) + installerTool="Install.app" + CLIInstaller="Install.app/Contents/MacOS/Install" + CLIArguments=(--mode=silent) + expectedTeamID="JQ525L2MZD" + Company="Adobe" + ;; adobereaderdc-update) name="Adobe Acrobat Reader DC" type="pkgInDmg" @@ -960,9 +1057,16 @@ airserver) name="AirServer" type="dmg" downloadURL="https://www.airserver.com/download/mac/latest" - #appNewVersion=$() # Cannot find version history or release notes on home page + appNewVersion=$(curl -fsIL "${downloadURL}" | grep -i "location" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') expectedTeamID="6C755KS5W3" ;; +airtame) + name="Airtame" + type="dmg" + downloadURL="$(curl -fs https://airtame.com/download/ | grep -i platform=mac | head -1 | grep -o -i -E "https.*" | cut -d '"' -f1)" + appNewVersion="$(curl -fsIL "${downloadURL}" | grep -i ^location | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g')" + expectedTeamID="4TPSP88HN2" + ;; aldente) name="AlDente" type="dmg" @@ -970,6 +1074,13 @@ aldente) appNewVersion=$(versionFromGit davidwernhart AlDente) expectedTeamID="3WVC84GB99" ;; +alephone) + name="Aleph One" + type="dmg" + downloadURL=$(downloadURLFromGit Aleph-One-Marathon alephone) + appNewVersion=$(versionFromGit Aleph-One-Marathon alephone) + expectedTeamID="E8K89CXZE7" + ;; alfred) # credit: AP Orlebeke (@apizz) name="Alfred" @@ -1020,6 +1131,7 @@ apparency) name="Apparency" type="dmg" downloadURL="https://www.mothersruin.com/software/downloads/Apparency.dmg" + appNewVersion=$(curl -fs https://mothersruin.com/software/Apparency/data/ApparencyVersionInfo.plist | grep -A1 CFBundleShortVersionString | tail -1 | sed -E 's/.*>([0-9.]*)<.*/\1/g') expectedTeamID="936EB786NH" ;; appcleaner) @@ -1032,14 +1144,14 @@ appcleaner) applenyfonts) name="Apple New York Font Collection" type="pkgInDmg" - downloadURL="https://devimages-cdn.apple.com/design/resources/download/NY-Font.dmg" + downloadURL="https://devimages-cdn.apple.com/design/resources/download/NY.dmg" packageID="com.apple.pkg.NYFonts" expectedTeamID="Development Update" ;; applesfcompact) name="San Francisco Compact" type="pkgInDmg" - downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Font-Compact.dmg" + downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg" packageID="com.apple.pkg.SanFranciscoCompact" expectedTeamID="Development Update" ;; @@ -1053,10 +1165,18 @@ applesfmono) applesfpro) name="San Francisco Pro" type="pkgInDmg" - downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Font-Pro.dmg" + downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg" packageID="com.apple.pkg.SanFranciscoPro" expectedTeamID="Development Update" ;; +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') + expectedTeamID="Software Update" + ;; aquaskk) # credit: Tadayuki Onishi (@kenchan0130) name="aquaskk" @@ -1096,12 +1216,18 @@ atom) expectedTeamID="VEKTX9H2N7" ;; audacity) - # credit: Gabe Marchan (gabemarchan.com - @darklink87) name="Audacity" type="dmg" downloadURL=$(downloadURLFromGit audacity audacity) appNewVersion=$(versionFromGit audacity audacity) - expectedTeamID="T3N4JQ7YY6" + expectedTeamID="AWEYX923UX" + ;; +authydesktop) + name="Authy Desktop" + type="dmg" + downloadURL="https://electron.authy.com/download?channel=stable&arch=x64&platform=darwin&version=latest&product=authy" + 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" ;; autodmg) # credit: Mischa van der Bent (@mischavdbent) @@ -1197,7 +1323,7 @@ bitwarden) blender) name="blender" type="dmg" - downloadURL=$(redirect=$(curl -sfL https://www.blender.org/download/ | sed 's/.*href="//' | sed 's/".*//' | grep .dmg) && curl -sfL "$redirect" | sed 's/.*href="//' | sed 's/".*//' | grep .dmg) + downloadURL=$(redirect=$(curl -sfL https://www.blender.org/download/ | sed 's/.*href="//' | sed 's/".*//' | grep .dmg) && curl -sfL "$redirect" | sed 's/.*href="//' | sed 's/".*//' | grep -m1 .dmg) appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)-.*/\1/g' ) expectedTeamID="68UA947AUU" ;; @@ -1205,7 +1331,7 @@ bluejeans) name="BlueJeans" type="pkg" if [[ $(arch) == "arm64" ]]; then - downloadURL=$(curl -fs "https://www.bluejeans.com/downloads" | xmllint --html --format - 2>/dev/null | grep -o "https://.*BlueJeansInstaller.*arm.*.pkg" ) + downloadURL=$(curl -fs "https://www.bluejeans.com/downloads" | xmllint --html --format - 2>/dev/null | grep -o "https://.*BlueJeans.*Installer.*arm.*.pkg" ) elif [[ $(arch) == "i386" ]]; then downloadURL=$(curl -fs "https://www.bluejeans.com/downloads" | xmllint --html --format - 2>/dev/null | grep -o "https://.*BlueJeansInstaller.*x86.*.dmg" | sed 's/dmg/pkg/g') fi @@ -1224,12 +1350,19 @@ boxdrive) fi expectedTeamID="M683GB7CPW" ;; +boxsync) + name="Box Sync" + type="dmg" + downloadURL="https://e3.boxcdn.net/box-installers/sync/Sync+4+External/Box%20Sync%20Installer.dmg" + expectedTeamID="M683GB7CPW" + ;; boxtools) - name="Box Tools" - type="pkg" - downloadURL="https://box-installers.s3.amazonaws.com/boxedit/mac/currentrelease/BoxToolsInstaller.pkg" - expectedTeamID="M683GB7CPW" - ;;brave) + name="Box Tools" + type="pkg" + downloadURL="https://box-installers.s3.amazonaws.com/boxedit/mac/currentrelease/BoxToolsInstaller.pkg" + expectedTeamID="M683GB7CPW" + ;; +brave) # credit: @securitygeneration name="Brave Browser" type="dmg" @@ -1244,6 +1377,13 @@ boxtools) 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) expectedTeamID="KL8N8XSYF4" ;; +bugdom) + name="Bugdom" + type="dmg" + downloadURL=$(downloadURLFromGit jorio Bugdom) + appNewVersion=$(versionFromGit jorio Bugdom) + expectedTeamID="RVNL7XC27G" + ;; caffeine) name="Caffeine" type="dmg" @@ -1265,14 +1405,19 @@ calibre) type="dmg" downloadURL="https://calibre-ebook.com/dist/osx" appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "^location" | awk '{print $2}' | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g' ) + #Maybe change to GitHub for this title. Looks like 5.28.0 release is the first to also release a binary, so maybe see what the next release will be to decide if we should switch. + #downloadURL=$(downloadURLFromGit kovidgoyal calibre ) + #appNewVersion=$(versionFromGit kovidgoyal calibre ) + #archiveName="OS X dmg" expectedTeamID="NTY7FVCEKP" ;; camostudio) - # credit: Søren Theilgaard (@theilgaard) name="Camo Studio" type="zip" downloadURL="https://reincubate.com/res/labs/camo/camo-macos-latest.zip" - appNewVersion=$(curl -s -L https://reincubate.com/support/camo/release-notes/ | grep -m2 "has-m-t-0" | head -1 | cut -d ">" -f2 | cut -d " " -f1) + #appNewVersion=$(curl -s -L https://reincubate.com/support/camo/release-notes/ | grep -m2 "has-m-t-0" | head -1 | cut -d ">" -f2 | cut -d " " -f1) + appNewVersion=$( curl -fs "https://uds.reincubate.com/release-notes/camo/" | head -1 | cut -d "," -f3 | grep -o -e "[0-9.]*" ) + # Camo Studio will ask for admin permissions to install som plug-ins. that has not been handled. expectedTeamID="Q248YREB53" ;; camtasia) @@ -1281,6 +1426,30 @@ camtasia) downloadURL=https://download.techsmith.com/camtasiamac/releases/Camtasia.dmg expectedTeamID="7TQL462TU8" ;; +canva) + name="Canva" + type="dmg" + if [[ $(arch) == "arm64" ]]; then + downloadURL=$(curl -fsLI -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 "accept-encoding: gzip, deflate, br" -H "accept-language: en-US,en;q=0.9" -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 "sec-fetch-mode: navigate" -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" "https://www.canva.com/download/mac/arm/canva-desktop/" | grep -i "^location" | cut -d " " -f2 | tr -d '\r') + elif [[ $(arch) == "i386" ]]; then + downloadURL=$(curl -fsLI -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" "https://www.canva.com/download/mac/intel/canva-desktop/" | grep -i "^location" | cut -d " " -f2 | tr -d '\r') + fi + appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g' ) + expectedTeamID="5HD2ARTBFS" + ;; +chatwork) + name="Chatwork" + type="dmg" + downloadURL="https://desktop-app.chatwork.com/installer/Chatwork.dmg" + expectedTeamID="H34A3H2Y54" + ;; +cisdem-documentreader) + name="cisdem-documentreader" + type="dmg" + downloadURL="https://download.cisdem.com/cisdem-documentreader.dmg" + expectedTeamID="5HGV8EX6BQ" + appName="Cisdem Document Reader.app" + ;; citrixworkspace) #credit: Erik Stam (@erikstam) and #Philipp on MacAdmins Slack name="Citrix Workspace" @@ -1290,10 +1459,9 @@ citrixworkspace) expectedTeamID="S272Y5R93J" ;; clevershare2) - # credit: Søren Theilgaard (@theilgaard) name="Clevershare" type="dmg" - downloadURL=$(curl -fs https://archive.clevertouch.com/clevershare2g | grep -i "_Mac" | tr '"' "\n" | grep "^http.*dmg") + downloadURL=$(curl -fs https://www.clevertouch.com/eu/clevershare2g | grep -i -o -E "https.*Mac.*\.dmg") appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z-]*_Mac\.([0-9.]*)\.[0-9]*\.dmg$/\1/g' ) expectedTeamID="P76M9BE8DQ" ;; @@ -1304,6 +1472,20 @@ clickshare) downloadURL=https://www.barco.com$(curl -fs "https://www.barco.com/en/clickshare/app" | grep -E -o '(\/\S*Download\?FileNumber=R3306192\S*ShowDownloadPage=False)' | tail -1) expectedTeamID="P6CDJZR997" ;; +closeio) + name="Close.io" + type="dmg" + downloadURL=$(downloadURLFromGit closeio closeio-desktop-releases) + appNewVersion=$(versionFromGit closeio closeio-desktop-releases) + expectedTeamID="WTNQ6773UC" + ;; +cloudya) + name="Cloudya" + type="appInDmgInZip" + downloadURL="$(curl -fs https://www.nfon.com/de/service/downloads | grep -i -E -o "https://cdn.cloudya.com/Cloudya-[.0-9]+-mac.zip")" + appNewVersion="$(curl -fs https://www.nfon.com/de/service/downloads | grep -i -E -o "Cloudya Desktop App MAC [0-9.]*" | sed 's/^.*\ \([^ ]\{0,7\}\)$/\1/g')" + expectedTeamID="X26F74J8TH" + ;; code42) # credit: Isaac Ordonez, Mann consulting (@mannconsulting) name="Code42" @@ -1320,13 +1502,14 @@ coderunner) expectedTeamID="R4GD98AJF9" ;; colourcontrastanalyser) - name="Colour Contrast Analyser (CCA)" - type="dmg" - downloadURL=$(downloadURLFromGit ThePacielloGroup CCAe) - appNewVersion=$(versionFromGit ThePacielloGroup CCAe) - expectedTeamID="34RS4UC3M6" - blockingProcesses=( NONE ) - ;;cormorant) + name="Colour Contrast Analyser (CCA)" + type="dmg" + downloadURL=$(downloadURLFromGit ThePacielloGroup CCAe) + appNewVersion=$(versionFromGit ThePacielloGroup CCAe) + expectedTeamID="34RS4UC3M6" + blockingProcesses=( NONE ) + ;; +cormorant) # credit: Søren Theilgaard (@theilgaard) name="Cormorant" type="zip" @@ -1334,6 +1517,14 @@ colourcontrastanalyser) appNewVersion=$(curl -fs https://eclecticlight.co/downloads/ | grep zip | grep -o -E "$name [0-9.]*" | awk '{print $2}') expectedTeamID="QWY4LRW926" ;; +craftmanager) + name="CraftManager" + type="zip" + #downloadURL="https://craft-assets.invisionapp.com/CraftManager/production/CraftManager.zip" + downloadURL="$(curl -fs https://craft-assets.invisionapp.com/CraftManager/production/appcast.xml | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)" + appNewVersion="$(curl -fs https://craft-assets.invisionapp.com/CraftManager/production/appcast.xml | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)" + expectedTeamID="VRXQSNCL5W" + ;; cryptomator) name="Cryptomator" type="dmg" @@ -1416,6 +1607,14 @@ devonthink) appNewVersion=$( echo ${downloadURL} | tr '/' '\n' | grep "[0-9]" | grep "[.]" | head -1 ) expectedTeamID="679S2QUWR8" ;; +dialog) + name="Dialog" + type="pkg" + packageID="au.csiro.dialogcli" + downloadURL="$(downloadURLFromGit bartreardon Dialog)" + appNewVersion="$(versionFromGit bartreardon Dialog)" + expectedTeamID="PWA5E9TQ59" + ;; dialpad) # credit: @ehosaka name="Dialpad" @@ -1484,6 +1683,15 @@ eraseinstall) downloadURL=https://bitbucket.org$(curl -fs https://bitbucket.org/prowarehouse-nl/erase-install/downloads/ | grep pkg | cut -d'"' -f2 | head -n 1) expectedTeamID="R55HK5K86Y" ;; +eshareosx) + name="e-Share" + type="pkg" + packageID="com.ncryptedcloud.e-Share.pkg" + downloadURL=https://www.ncryptedcloud.com/static/downloads/osx/$(curl -fs https://www.ncryptedcloud.com/static/downloads/osx/ | grep -o -i "href.*\".*\"" | cut -d '"' -f2) + versionKey="CFBundleVersion" + appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z\-]*_([0-9.]*)\.pkg/\1/g' ) + expectedTeamID="X9MBQS7DDC" + ;; etrecheck) # credit: @dvsjr macadmins slack name="EtreCheckPro" @@ -1507,6 +1715,13 @@ exelbanstats) appNewVersion=$(versionFromGit exelban stats) expectedTeamID="RP2S87B72W" ;; +exifrenamer) + name="ExifRenamer" + type="dmg" + downloadURL="https://www.qdev.de/"$(curl -fs "https://www.qdev.de/download.php?file=ExifRenamer.dmg" | grep -o -e "URL=[a-zA-Z/]*.dmg" | cut -d "=" -f2) + appNewVersion=$(curl -fs "https://www.qdev.de/?location=downloads" | grep -A1 -m1 "ExifRenamer" | tail -1 | cut -d ">" -f2 | cut -d " " -f1) + expectedTeamID="MLF9FE35AM" + ;; fantastical) # credit: Drew Diver (@grumpydrew on MacAdmins Slack) name="Fantastical" @@ -1515,6 +1730,13 @@ fantastical) appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "^location" | awk '{print $2}' | sed -E 's/.*\/[a-zA-Z]*_([0-9.]*)\..*/\1/g' ) expectedTeamID="85C27NK92C" ;; +fastscripts) + name="FastScripts" + type="zip" + downloadURL=$( curl -fs "https://redsweater.com/fastscripts/appcast3.php" | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | cut -d '"' -f2 ) + appNewVersion=$( curl -fs "https://redsweater.com/fastscripts/appcast3.php" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | cut -d '"' -f2 ) + expectedTeamID="493CVA9A35" + ;; favro) name="Favro" type="dmg" @@ -1538,14 +1760,26 @@ ferdi) figma) name="Figma" type="zip" - downloadURL="https://desktop.figma.com/mac/Figma.zip" + if [[ $(arch) == "arm64" ]]; then + downloadURL="https://desktop.figma.com/mac-arm/Figma.zip" + elif [[ $(arch) == "i386" ]]; then + downloadURL="https://desktop.figma.com/mac/Figma.zip" + fi + appNewVersion="$(curl -fsL https://desktop.figma.com/mac/RELEASE.json | awk -F '"' '{ print $8 }')" expectedTeamID="T8RA8NE3B7" ;; +findanyfile) + name="Find Any File" + type="zip" + downloadURL=$(curl -fs "https://findanyfile.app/appcast2.php" | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | cut -d '"' -f2) + appNewVersion=$(curl -fs "https://findanyfile.app/appcast2.php" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | cut -d '"' -f2) + expectedTeamID="25856V4B4X" + ;; firefox) name="Firefox" type="dmg" downloadURL="https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" - appNewVersion=$(/usr/bin/curl https://www.mozilla.org/en-US/firefox/releases/ --silent | /usr/bin/grep 'Inkscape" | cut -d '>' -f 3 | cut -d '<' -f 1 | sed 's/[^0-9.]*//g') # Can't figure out where exact new version is found. Currently returns 1.0, but version is "1.0.0 (4035a4f)" + downloadURL="https://inkscape.org$(curl -fs https://inkscape.org$(curl -fsJL https://inkscape.org/release/ | grep "/release/" | grep en | head -n 1 | cut -d '"' -f 6)mac-os-x/dmg/dl/ | grep "click here" | cut -d '"' -f 2)" + appCustomVersion() { /Applications/Inkscape.app/Contents/MacOS/inkscape --version | cut -d " " -f2 } + appNewVersion=$(curl -fsJL https://inkscape.org/release/ | grep "" | grep -o -e "[0-9.]*") expectedTeamID="SW3D6BB6A6" ;; +insomnia) + name="insomnia" + type="dmg" + downloadURL=$(downloadURLFromGit kong insomnia) + appNewVersion=$(versionFromGit kong insomnia) + expectedTeamID="FX44YY62GV" + ;; +installomator|\ installomator_theile) - # credit: Søren Theilgaard (@theilgaard) name="Installomator" type="pkg" - packageID="dk.theilgaard.pkg.Installomator" - downloadURL=$(downloadURLFromGit theile Installomator ) - appNewVersion=$(versionFromGit theile Installomator ) - #appCustomVersion(){/usr/local/bin/Installomator.sh version | tail -1 | awk '{print $4}'} - expectedTeamID="FXW6QXBFW5" + packageID="com.scriptingosx.Installomator" + downloadURL=$(downloadURLFromGit Installomator Installomator ) + appNewVersion=$(versionFromGit Installomator Installomator ) + expectedTeamID="JME5BW3F3R" blockingProcesses=( NONE ) ;; istatmenus) @@ -1883,10 +2131,11 @@ iterm2) ;; jabradirect) name="Jabra Direct" - type="dmg" + type="pkgInDmg" + packageID="com.jabra.directonline" downloadURL="https://jabraxpressonlineprdstor.blob.core.windows.net/jdo/JabraDirectSetup.dmg" + appNewVersion=$(curl -fs https://www.jabra.com/Support/release-notes/release-note-jabra-direct | grep -oe "Release version:.*[0-9.]*<" | head -1 | cut -d ">" -f2 | cut -d "<" -f1 | sed 's/ //g') expectedTeamID="55LV32M29R" - appNewVersion=$(curl -fs https://www.jabra.com/Support/release-notes/release-note-jabra-direct | grep -o "Jabra Direct macOS:*.*<" | head -1 | cut -d ":" -f2 | cut -d " " -f2 | cut -d "<" -f1) ;; jamfconnect) name="Jamf Connect" @@ -1895,6 +2144,12 @@ jamfconnect) downloadURL="https://files.jamfconnect.com/JamfConnect.dmg" expectedTeamID="483DWKW443" ;; +jamfconnectconfiguration) + name="Jamf Connect Configuration" + type="dmg" + downloadURL="https://files.jamfconnect.com/JamfConnect.dmg" + expectedTeamID="483DWKW443" + ;; jamfmigrator) # credit: Mischa van der Bent name="jamf-migrator" @@ -1919,64 +2174,132 @@ jamfreenroller) #appNewVersion=$(versionFromGit jamf ReEnroller) expectedTeamID="PS2F6S478M" ;; +jetbrainsclion) + name="CLion" + type="dmg" + jetbrainscode="CL" + jetbrainsdistribution="mac" + if [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) + expectedTeamID="2ZEFAR8TH3" + ;; jetbrainsdatagrip) - # credit: AP Orlebeke (@apizz) - name="DataGrip" - type="dmg" - appNewVersion=$(curl -fs "https://data.services.jetbrains.com/products/releases?code=DG&latest=true&type=release" | grep -o 'version*.*,' | cut -d '"' -f3) - if [[ $(arch) == "arm64" ]]; then - downloadURL=$(curl -fs "https://data.services.jetbrains.com/products/releases?code=DG&latest=true&type=release" | grep -o 'macM1*.*,' | cut -d '"' -f5) - elif [[ $(arch) == "i386" ]]; then - downloadURL=$(curl -fs "https://data.services.jetbrains.com/products/releases?code=DG&latest=true&type=release" | grep -o 'mac*.*,' | cut -d '"' -f5) - fi - expectedTeamID="2ZEFAR8TH3" - ;;jetbrainsintellijidea) - # credit: Gabe Marchan (gabemarchan.com - @darklink87) + name="DataGrip" + type="dmg" + jetbrainscode="DG" + if [[ $(arch) == i386 ]]; then + jetbrainsdistribution="mac" + elif [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) + expectedTeamID="2ZEFAR8TH3" + ;; +jetbrainsintellijidea) name="IntelliJ IDEA" type="dmg" - downloadURL="https://download.jetbrains.com/product?code=II&latest&distribution=mac" - appNewVersion=$(curl -fs "https://data.services.jetbrains.com/products/releases?code=II&latest=true&type=release" | grep -o 'version*.*,' | cut -d '"' -f3) + jetbrainscode="II" + if [[ $(arch) == i386 ]]; then + jetbrainsdistribution="mac" + elif [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) expectedTeamID="2ZEFAR8TH3" ;; jetbrainsintellijideace|\ intellijideace) name="IntelliJ IDEA CE" type="dmg" - downloadURL="https://download.jetbrains.com/product?code=IIC&latest&distribution=mac" - appNewVersion=$(curl -fs "https://data.services.jetbrains.com/products/releases?code=IIC&latest=true&type=release" | grep -o 'version*.*,' | cut -d '"' -f3) + jetbrainscode="IIC" + if [[ $(arch) == i386 ]]; then + jetbrainsdistribution="mac" + elif [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) expectedTeamID="2ZEFAR8TH3" ;; jetbrainsphpstorm) - # credit: Casey Jensen (@cajenson01 on MacAdmins Slack)Appended by Skylar Damiano @catdad on MacAdmins Slack - name="JetBrains PHPStorm" + name="PHPStorm" type="dmg" - downloadURL=$(curl -fs "https://data.services.jetbrains.com/products/releases?code=PS&latest=true&type=release" | grep -o "mac*.*.dmg" | cut -d '"' -f5) - appNewVersion=$(curl -fs "https://data.services.jetbrains.com/products/releases?code=PS&latest=true&type=release" | grep -o 'version*.*,' | cut -d '"' -f3) + jetbrainscode="PS" + if [[ $(arch) == i386 ]]; then + jetbrainsdistribution="mac" + elif [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) expectedTeamID="2ZEFAR8TH3" ;; jetbrainspycharm) - # This is the Pro version of PyCharm. - # Do not confuse with PyCharm CE. + # This is the Pro version of PyCharm. Do not confuse with PyCharm CE. name="PyCharm" type="dmg" - appNewVersion=$(curl -fs "https://data.services.jetbrains.com/products/releases?code=PCP&latest=true&type=release" | grep -o 'version*.*,' | cut -d '"' -f3) - if [[ $(arch) == i386 ]]; then - downloadURL="https://download.jetbrains.com/product?code=PCP&latest&distribution=mac" - elif [[ $(arch) == arm64 ]]; then - downloadURL="https://download.jetbrains.com/product?code=PCP&latest&distribution=macM1" + jetbrainscode="PCP" + jetbrainsdistribution="mac" + if [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) expectedTeamID="2ZEFAR8TH3" ;; jetbrainspycharmce|\ pycharmce) name="PyCharm CE" type="dmg" - appNewVersion=$(curl -fs "https://data.services.jetbrains.com/products/releases?code=PCC&latest=true&type=release" | grep -o 'version*.*,' | cut -d '"' -f3) - if [[ $(arch) == i386 ]]; then - downloadURL="https://download.jetbrains.com/product?code=PCC&latest&distribution=mac" - elif [[ $(arch) == arm64 ]]; then - downloadURL="https://download.jetbrains.com/product?code=PCC&latest&distribution=macM1" + jetbrainscode="PCC" + jetbrainsdistribution="mac" + if [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) + expectedTeamID="2ZEFAR8TH3" + ;; +jetbrainsrubymine) + name="RubyMine" + type="dmg" + jetbrainscode="RM" + if [[ $(arch) == i386 ]]; then + jetbrainsdistribution="mac" + elif [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) + expectedTeamID="2ZEFAR8TH3" + ;; +jetbrainstoolbox) + name="JetBrains Toolbox" + type="dmg" + jetbrainscode="TBA" + jetbrainsdistribution="mac" + if [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) + expectedTeamID="2ZEFAR8TH3" + ;; +jetbrainswebstorm) + name="Webstorm" + type="dmg" + jetbrainscode="WS" + jetbrainsdistribution="mac" + if [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) expectedTeamID="2ZEFAR8TH3" ;; karabinerelements) @@ -2006,6 +2329,12 @@ keka) appNewVersion=$(versionFromGit aonez Keka) expectedTeamID="4FG648TM2A" ;; +keybase) + name="Keybase" + type="dmg" + downloadURL=$(curl -s https://keybase.io/docs/the_app/install_macos | grep data-target | cut -d '"' -f2) + expectedTeamID="99229SGT5K" + ;; keyboardmaestro) # credit: Søren Theilgaard (@theilgaard) name="Keyboard Maestro" @@ -2060,11 +2389,9 @@ launchbar) expectedTeamID="MLZF7K7B5R" ;; lexarrecoverytool) - # credit: Søren Theilgaard (@theilgaard) name="Lexar Recovery Tool" type="appInDmgInZip" - downloadURL="https://www.lexar.com$( curl -fs "https://www.lexar.com/support/downloads/" | grep -i "mac" | grep -i "recovery" | head -1 | tr '"' '\n' | grep -i ".zip" )" - #appNewVersion="" + downloadURL="https://www.lexar.com/wp-content/uploads/product_images/Lexar-Recovery-Tool-Mac.zip" expectedTeamID="Y8HM6WR2DV" ;; libreoffice) @@ -2080,10 +2407,23 @@ logitechoptions) 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/' ) + #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" expectedTeamID="QED4VVPZWA" ;; +logseq) + name="Logseq" + type="dmg" + if [[ $(arch) == "arm64" ]]; then + archiveName="darwin-arm64-[0-9.]*.dmg" + downloadURL=$(downloadURLFromGit logseq logseq) + elif [[ $(arch) == "i386" ]]; then + archiveName="darwin-x64-[0-9.]*.dmg" + downloadURL=$(downloadURLFromGit logseq logseq) + fi + appNewVersion=$(versionFromGit logseq logseq) + expectedTeamID="3K44EUN829" + ;; loom) # credit: Lance Stephens (@pythoninthegrass on MacAdmins Slack) name="Loom" @@ -2103,10 +2443,19 @@ lucifer) lulu) name="LuLu" type="dmg" - downloadURL=$( curl -fs "https://objective-see.com/products/lulu.html" | grep https | grep "$type" | head -1 | tr '"' "\n" | grep "^http" ) - appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*_([0-9.]*)\..*/\1/g' ) + #downloadURL=$( curl -fs "https://objective-see.com/products/lulu.html" | grep https | grep "$type" | head -1 | tr '"' "\n" | grep "^http" ) + #appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*_([0-9.]*)\..*/\1/g' ) + downloadURL=$(downloadURLFromGit objective-see LuLu) + appNewVersion=$(versionFromGit objective-see LuLu) expectedTeamID="VBG97UB4TA" ;; +maccyapp) + name="Maccy" + type="zip" + downloadURL="$(downloadURLFromGit p0deje Maccy)" + appNewVersion="$(versionFromGit p0deje Maccy)" + expectedTeamID="MN3X4648SC" + ;; macfuse) name="FUSE for macOS" type="pkgInDmg" @@ -2114,6 +2463,29 @@ macfuse) appNewVersion=$(versionFromGit osxfuse osxfuse) expectedTeamID="3T5GSNBU6W" ;; +macports) + name="MacPorts" + type="pkg" + #buildVersion=$(uname -r | cut -d '.' -f 1) + case $(uname -r | cut -d '.' -f 1) in + 21) + archiveName="Monterey.pkg" + ;; + 20) + archiveName="BigSur.pkg" + ;; + 19) + archiveName="Catalina.pkg" + ;; + *) + cleanupAndExit 1 "macOS 10.14 or earlier not supported by Installomator." + ;; + esac + downloadURL=$(downloadURLFromGit macports macports-base) + appNewVersion=$(versionFromGit macports macports-base) + appCustomVersion(){ if [ -x /opt/local/bin/port ]; then /opt/local/bin/port version | awk '{print $2}'; else "0"; fi } + expectedTeamID="QTA3A3B7F3" + ;; malwarebytes) name="Malwarebytes" type="pkg" @@ -2121,17 +2493,38 @@ malwarebytes) appNewVersion=$(curl -Ifs https://downloads.malwarebytes.com/file/mb3-mac | grep "location" | sed -E 's/.*-Mac-([0-9\.]*)\.pkg/\1/g') expectedTeamID="GVZRY6KDKR" ;; +marathon) + name="Marathon" + type="dmg" + archiveName="Marathon-[0-9.]*-Mac.dmg" + downloadURL="$(downloadURLFromGit Aleph-One-Marathon alephone)" + appNewVersion="$(versionFromGit Aleph-One-Marathon alephone)" + expectedTeamID="E8K89CXZE7" + ;; +marathon2) + name="Marathon 2" + type="dmg" + archiveName="Marathon2-[0-9.]*-Mac.dmg" + downloadURL="$(downloadURLFromGit Aleph-One-Marathon alephone)" + appNewVersion="$(versionFromGit Aleph-One-Marathon alephone)" + expectedTeamID="E8K89CXZE7" + ;; +marathoninfinity) + name="Marathon Infinity" + type="dmg" + archiveName="MarathonInfinity-[0-9.]*-Mac.dmg" + downloadURL="$(downloadURLFromGit Aleph-One-Marathon alephone)" + appNewVersion="$(versionFromGit Aleph-One-Marathon alephone)" + expectedTeamID="E8K89CXZE7" + ;; mattermost) name="Mattermost" type="dmg" - if [[ $(arch) == i386 ]]; then - archiveName="mac.dmg" - elif [[ $(arch) == arm64 ]]; then - archiveName="mac-m1.dmg" - fi + archiveName="mac-universal.dmg" downloadURL=$(downloadURLFromGit mattermost desktop) appNewVersion=$(versionFromGit mattermost desktop ) expectedTeamID="UQ8HT4Q2XM" + Mattermost Helper (Renderer).app app.asar ;; menumeters) name="MenuMeters" @@ -2152,6 +2545,14 @@ microsoftautoupdate) #updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" #updateToolArguments=( --install --apps MSau04 ) ;; +microsoftazurestorageexplorer) + name="Microsoft Azure Storage Explorer" + type="zip" + downloadURL=$(downloadURLFromGit microsoft AzureStorageExplorer ) + appNewVersion=$(versionFromGit microsoft AzureStorageExplorer ) + expectedTeamID="UBF8T346G9" + archiveName="Mac_StorageExplorer.zip" + ;; microsoftcompanyportal) name="Company Portal" type="pkg" @@ -2159,6 +2560,10 @@ microsoftcompanyportal) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.intunecompanyportal.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/CompanyPortal_.*pkg" | cut -d "_" -f 2 | cut -d "-" -f 1) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps IMCP01 ) ;; @@ -2169,27 +2574,26 @@ microsoftdefenderatp) appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.defender.standalone"]/version' 2>/dev/null | sed -E 's/<version>([0-9.]*) .*/\1/') # No version number in download url expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps WDAV00 ) ;; microsoftedge|\ -microsoftedgeconsumerstable) - name="Microsoft Edge" - type="pkg" - downloadURL="https://go.microsoft.com/fwlink/?linkid=2069148" - #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.edge"]/cfbundleversion' 2>/dev/null | sed -E 's/<cfbundleversion>([0-9.]*)<.*/\1/') - appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/MicrosoftEdge.*pkg" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') - expectedTeamID="UBF8T346G9" - updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" - updateToolArguments=( --install --apps EDGE01 ) - ;; +microsoftedgeconsumerstable|\ microsoftedgeenterprisestable) name="Microsoft Edge" type="pkg" - downloadURL="https://go.microsoft.com/fwlink/?linkid=2093438" - #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.edge"]/version' 2>/dev/null | sed -E 's/<version>([0-9.]*) .*/\1/') + downloadURL="https://go.microsoft.com/fwlink/?linkid=2093504" + #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.edge"]/cfbundleversion' 2>/dev/null | sed -E 's/<cfbundleversion>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/MicrosoftEdge.*pkg" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps EDGE01 ) ;; @@ -2200,6 +2604,10 @@ microsoftexcel) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.excel.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps XCEL2019 ) ;; @@ -2221,6 +2629,10 @@ microsoftoffice365) expectedTeamID="UBF8T346G9" # using MS PowerPoint as the 'stand-in' for the entire suite #appName="Microsoft PowerPoint.app" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi blockingProcesses=( "Microsoft AutoUpdate" "Microsoft Word" "Microsoft PowerPoint" "Microsoft Excel" "Microsoft OneNote" "Microsoft Outlook" "OneDrive" ) updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install ) @@ -2229,9 +2641,14 @@ microsoftofficebusinesspro) name="MicrosoftOfficeBusinessPro" type="pkg" downloadURL="https://go.microsoft.com/fwlink/?linkid=2009112" + appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3) expectedTeamID="UBF8T346G9" # using MS PowerPoint as the 'stand-in' for the entire suite appName="Microsoft PowerPoint.app" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi blockingProcesses=( "Microsoft AutoUpdate" "Microsoft Word" "Microsoft PowerPoint" "Microsoft Excel" "Microsoft OneNote" "Microsoft Outlook" "OneDrive" "Teams") updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install ) @@ -2243,6 +2660,10 @@ microsoftonedrive) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.onedrive.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | cut -d "/" -f 6 | cut -d "." -f 1-3) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps ONDR18 ) ;; @@ -2253,6 +2674,10 @@ microsoftonenote) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.onenote.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps ONMC2019 ) ;; @@ -2263,6 +2688,10 @@ microsoftoutlook) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.outlook.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps OPIM2019 ) ;; @@ -2273,6 +2702,10 @@ microsoftpowerpoint) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.powerpoint.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps PPT32019 ) ;; @@ -2283,6 +2716,10 @@ microsoftremotedesktop) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.remotedesktop.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_Remote_Desktop.*pkg" | cut -d "_" -f 4) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps MSRD10 ) ;; @@ -2302,6 +2739,10 @@ microsoftskypeforbusiness) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.skypeforbusiness.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps MSFB16 ) ;; @@ -2310,21 +2751,18 @@ microsoftteams) type="pkg" packageID="com.microsoft.teams" downloadURL="https://go.microsoft.com/fwlink/?linkid=869428" - #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.teams.standalone"]/version' 2>/dev/null | sed -E 's/<version>([0-9.]*) .*/\1/') - # Still using macadmin.software for version, as the path does not contain the version in a matching format. packageID can be used, but version is the same. appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.teams.standalone"]/version' 2>/dev/null | sed -E 's/<version>([0-9.]*) .*/\1/') - # Looks like macadmin.software has package ID version. At least on 2021-05-28 version 1.00.411161 is matched on installed version and homepage. + # Looks like macadmin.software has package ID version. At least on 202105-28 version 1.00.411161 is matched on installed version and homepage. expectedTeamID="UBF8T346G9" blockingProcesses=( Teams "Microsoft Teams Helper" ) # Commenting out msupdate as it is not really supported *yet* for teams - # updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" + # updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate --list; /Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" # updateToolArguments=( --install --apps TEAM01 ) ;; microsoftvisualstudiocode|\ visualstudiocode) name="Visual Studio Code" type="zip" - #downloadURL="https://go.microsoft.com/fwlink/?LinkID=620882" # Intel only downloadURL="https://go.microsoft.com/fwlink/?LinkID=2156837" # Universal appNewVersion=$(curl -fsL "https://code.visualstudio.com/Updates" | grep "/darwin" | grep -oiE ".com/([^>]+)([^<]+)/darwin" | cut -d "/" -f 2 | sed $'s/[^[:print:] ]//g' | head -1 ) expectedTeamID="UBF8T346G9" @@ -2338,6 +2776,10 @@ microsoftword) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.word.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps MSWD2019 ) ;; @@ -2348,7 +2790,7 @@ microsoftyammer) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/oldpackage[id="com.microsoft.yammer.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') expectedTeamID="UBF8T346G9" - #updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" + #updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate --list; /Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" #updateToolArguments=( --install --apps ?????? ) ;; miro) @@ -2358,6 +2800,22 @@ miro) downloadURL="https://desktop.miro.com/platforms/darwin/Miro.dmg" expectedTeamID="M3GM7MFY7U" ;; +montereyblocker) + name="montereyblocker" + type="pkg" + packageID="dk.envo-it.montereyblocker" + downloadURL=$(downloadURLFromGit Theile montereyblocker ) + appNewVersion=$(versionFromGit Theile montereyblocker ) + expectedTeamID="FXW6QXBFW5" + ;; +mowgliiitsycal) + name="Itsycal" + type="zip" + downloadURL=$(curl -fs https://s3.amazonaws.com/itsycal/itsycal.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.xml | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2) + expectedTeamID="HFT3T55WND" + ;; + musescore) name="MuseScore 3" type="dmg" @@ -2365,6 +2823,13 @@ musescore) appNewVersion=$(versionFromGit musescore MuseScore) expectedTeamID="6EPAF2X3PR" ;; +muzzle) + name="Muzzle" + type="zip" + downloadURL="https://muzzleapp.com/binaries/muzzle.zip" + appNewVersion=$(curl -fs https://muzzleapp.com/updates/ | grep -io 'h2.*Version.* [0-9.]*.*h2' | head -1 | sed -E 's/.*ersion *([0-9.]*).*/\1/g') + expectedTeamID="49EYHPJ4Q3" + ;; netnewswire) name="NetNewsWire" type="zip" @@ -2413,6 +2878,14 @@ notion) appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "^location" | awk '{print $2}' | tr -d '\r\n' | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g' ) expectedTeamID="LBQJ96FQ8D" ;; +nudge) + name="Nudge" + type="pkg" + downloadURL=$(downloadURLFromGit macadmins Nudge ) + appNewVersion=$(versionFromGit macadmins Nudge ) + expectedTeamID="9GQZ7KUFR6" + archiveName="Nudge-[0-9.]*.pkg" + ;; nvivo) name="NVivo" type="dmg" @@ -2538,12 +3011,43 @@ opera) versionKey="CFBundleVersion" expectedTeamID="A2P9LX4JPN" ;; +ottomatic) + name="Otto Matic" + type="dmg" + downloadURL=$(downloadURLFromGit jorio OttoMatic) + appNewVersion=$(versionFromGit jorio OttoMatic) + expectedTeamID="RVNL7XC27G" + ;; + +overflow) + name="Overflow" + type="dmg" + downloadURL="$(curl -sL 'https://overflow.io/download/' | awk -F '"' '/app-updates.overflow.io\/packages\/updates\/osx_64/ { print $8; exit }')" + appNewVersion=$(echo "$downloadURL" | awk -F '-|[.]dmg' '{ print $(NF-1) }') + expectedTeamID="7TK7YSGJFF" + versionKey="CFBundleShortVersionString" + ;; pacifist) name="Pacifist" type="dmg" downloadURL="https://charlessoft.com/cgi-bin/pacifist_download.cgi?type=dmg" expectedTeamID="HRLUCP7QP4" ;; +pandoc) + name="Pandoc" + type="pkg" + packageID="net.johnmacfarlane.pandoc" + downloadURL=$(downloadURLFromGit jgm pandoc ) + appNewVersion=$(versionFromGit jgm pandoc ) + archiveName="mac.pkg" + expectedTeamID="5U2WKE6DES" + ;; +parsec) + name="Parsec" + type="pkg" + downloadURL="https://builds.parsecgaming.com/package/parsec-macos.pkg" + expectedTeamID="Y9MY52XZDB" + ;; pdfsam) name="PDFsam Basic" type="dmg" @@ -2551,6 +3055,13 @@ pdfsam) appNewVersion=$(versionFromGit torakiki pdfsam) expectedTeamID="8XM3GHX436" ;; +perimeter81) + name="Perimeter 81" + type="pkg" + downloadURL="https://static.perimeter81.com/agents/mac/snapshot/latest/Perimeter81.pkg" + appNewVersion="$(curl -fsIL "${downloadURL}" | grep -i ^x-amz-meta-version | sed -E 's/x-amz-meta-version: //' | cut -d"." -f1-3)" + expectedTeamID="924635PD62" + ;; pitch) name="Pitch" type="dmg" @@ -2565,12 +3076,13 @@ plantronicshub) appNewVersion=$(curl -fs "https://www.poly.com/in/en/support/knowledge-base/kb-article-page?lang=en_US&urlName=Hub-Release-Notes&type=Product_Information__kav" | grep -o "(*.*<span>)" | head -1 | cut -d "(" -f2 | sed 's/\<\/span\>//g' | cut -d "<" -f1) ;; platypus) - name="Platypus" - type="zip" - downloadURL=$(downloadURLFromGit sveinbjornt Platypus) - appNewVersion=$(versionFromGit sveinbjornt Platypus) - expectedTeamID="55GP2M789L" - ;;plisteditpro) + name="Platypus" + type="zip" + downloadURL=$(downloadURLFromGit sveinbjornt Platypus) + appNewVersion=$(versionFromGit sveinbjornt Platypus) + expectedTeamID="55GP2M789L" + ;; +plisteditpro) name="PlistEdit Pro" type="zip" downloadURL="https://www.fatcatsoftware.com/plisteditpro/PlistEditPro.zip" @@ -2589,7 +3101,6 @@ prism9) type="dmg" downloadURL="https://cdn.graphpad.com/downloads/prism/9/InstallPrism9.dmg" expectedTeamID="YQ2D36NS9M" - Company="GraphPad Software" ;; privileges) # credit: Erik Stam (@erikstam) @@ -2627,11 +3138,10 @@ pymol) expectedTeamID="26SDDJ756N" ;; r) - # credit: Tadayuki Onishi (@kenchan0130) name="R" type="pkg" - downloadURL=$( curl -fsL https://formulae.brew.sh/api/cask/r.json | sed -n 's/^.*"url":"\([^"]*\)".*$/\1/p' ) - appNewVersion=$(curl -fsL https://formulae.brew.sh/api/cask/r.json | sed -n 's/^.*"version":"\([^"]*\)".*$/\1/p') + downloadURL="https://cloud.r-project.org/bin/macosx/$( curl -fsL https://cloud.r-project.org/bin/macosx/ | grep -m 1 -o '<a href=".*pkg">' | sed -E 's/.+"(.+)".+/\1/g' )" + appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') expectedTeamID="VZLD955F6P" ;; ramboxce) @@ -2656,6 +3166,21 @@ redeye) appNewVersion=$( curl -fs "https://www.hexedbits.com/redeye/" | grep "Latest version" | sed -E 's/.*Latest version ([0-9.]*),.*/\1/g' ) expectedTeamID="5VRJU68BZ5" ;; +remotix) + name="Remotix" + type="dmg" + downloadURL="https://remotix.com/downloads/latest-remotix-mac/" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "^location" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)-.*\.dmg/\1/g' ) + expectedTeamID="K293Y6CVN4" + ;; +remotixagent) + name="RemotixAgent" + type="pkg" + packageID="com.nulana.rxagentmac" + downloadURL="https://remotix.com/downloads/latest-agent-mac/" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "^location" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)-.*\.pkg/\1/g' ) + expectedTeamID="K293Y6CVN4" + ;; resiliosynchome) name="Resilio Sync" type="dmg" @@ -2722,11 +3247,19 @@ rocketchat) expectedTeamID="S6UPZG7ZR3" blockingProcesses=( Rocket.Chat ) ;; +rodeconnect) + name="RODE Connect" + type="pkgInZip" + #packageID="com.rodeconnect.installer" #Versioned wrong as 0 in 1.1.0 pkg + downloadURL="https://cdn1.rode.com/rodeconnect_installer_mac.zip" + appNewVersion="$(curl -fs https://rode.com/software/rode-connect | grep -i -o ">Current version .*<" | cut -d " " -f4)" + expectedTeamID="Z9T72PWTJA" + ;; royaltsx) name="Royal TSX" type="dmg" - downloadURL=$(curl -fs https://royaltsx-v4.royalapps.com/updates_stable | xpath '//rss/channel/item[1]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2) - appNewVersion=$(curl -fs https://royaltsx-v4.royalapps.com/updates_stable | xpath '//rss/channel/item[1]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2) + downloadURL=$(curl -fs https://royaltsx-v5.royalapps.com/updates_stable | xpath '//rss/channel/item[1]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2) + appNewVersion=$(curl -fs https://royaltsx-v5.royalapps.com/updates_stable | xpath '//rss/channel/item[1]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2) expectedTeamID="VXP8K9EDP6" ;; rstudio) @@ -2746,36 +3279,40 @@ santa) expectedTeamID="EQHXZ8M8AV" ;; scaleft) - name="ScaleFT" - type="pkg" - downloadURL="https://dist.scaleft.com/client-tools/mac/latest/ScaleFT.pkg" - appNewVersion=$(curl -sf "https://dist.scaleft.com/client-tools/mac/" | awk '/dir/{i++}i==2' | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p') - expectedTeamID="HV2G9Z3RP5" - blockingProcesses=( ScaleFT ) - ;;screamingfrogseospider) + name="ScaleFT" + type="pkg" + downloadURL="https://dist.scaleft.com/client-tools/mac/latest/ScaleFT.pkg" + appNewVersion=$(curl -sf "https://dist.scaleft.com/client-tools/mac/" | awk '/dir/{i++}i==2' | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p') + expectedTeamID="HV2G9Z3RP5" + blockingProcesses=( ScaleFT ) + ;; +screamingfrogseospider) name="Screaming Frog SEO Spider" type="dmg" - downloadURL="https://download.screamingfrog.co.uk/products/seo-spider/ScreamingFrogSEOSpider-14.3.dmg" + downloadURL=$(curl -fs "https://www.screamingfrog.co.uk/wp-content/themes/screamingfrog/inc/download-modal.php" | 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" ;; screencloudplayer) - # credit: AP Orlebeke (@apizz) - name="ScreenCloud Player" - type="dmg" - downloadURL=$(curl -sL "https://screencloud.com/download" | sed -n 's/^.*"url":"\([^"]*\)".*$/\1/p') - expectedTeamID="3C4F953K6P" - ;;screenflick) + name="ScreenCloud Player" + type="dmg" + downloadURL=$(curl -fs "https://screencloud.com/download" | sed -n 's/^.*"url":"\(https.*\.dmg\)".*$/\1/p') + appNewVersion=$( echo $downloadURL | sed -e 's/.*\/ScreenCloud.*\-\([0-9.]*\)\.dmg/\1/g' ) + expectedTeamID="3C4F953K6P" + ;; +screenflick) # credit: Gabe Marchan (gabemarchan.com - @darklink87) name="Screenflick" type="zip" downloadURL="https://www.araelium.com/screenflick/downloads/Screenflick.zip" expectedTeamID="28488A87JB" ;; -sfsymbols) - name="SF Symbols" - type="pkgInDmg" - downloadURL="https://developer.apple.com/design/downloads/SF-Symbols.dmg" - expectedTeamID="Software Update" +sequelpro) + name="Sequel Pro" + type="dmg" + downloadURL="$(downloadURLFromGit sequelpro sequelpro)" + appNewVersion="$(versionFromGit sequelpro sequelpro)" + expectedTeamID="Media" ;; shield) # credit: Søren Theilgaard (@theilgaard) @@ -2825,12 +3362,18 @@ sizeup) expectedTeamID="GVZ7RF955D" ;; sketch) - name="Sketch" - type="zip" - downloadURL=$(curl -sf https://www.sketch.com/downloads/mac/ | grep 'href="https://download.sketch.com' | sed -E 's/.*href=\"(.*)\".?/\1/g') - appNewVersion=$(curl -fs https://www.sketch.com/updates/ | grep "Sketch Version" | head -1 | sed -E 's/.*Version ([0-9.]*)<.*/\1/g') # version from update page - expectedTeamID="WUGMZZ5K46" - ;; + name="Sketch" + type="zip" + downloadURL=$(curl -sf https://www.sketch.com/downloads/mac/ | grep 'href="https://download.sketch.com' | sed -E 's/.*href=\"(.*)\".?/\1/g') + appNewVersion=$(curl -fs https://www.sketch.com/updates/ | grep "Sketch Version" | head -1 | sed -E 's/.*Version ([0-9.]*)<.*/\1/g') # version from update page + expectedTeamID="WUGMZZ5K46" + ;; +sketchupviewer) + name="SketchUpViewer" + type="dmg" + downloadURL="$(curl -fs https://www.sketchup.com/sketchup/SketchUpViewer-en-dmg | grep "<a href=" | sed 's/.*href="//' | sed 's/".*//')" + expectedTeamID="J8PVMCY7KL" + ;; skype) name="Skype" type="dmg" @@ -2843,14 +3386,20 @@ slack) name="Slack" type="dmg" downloadURL="https://slack.com/ssb/download-osx-universal" # Universal -# if [[ $(arch) == "arm64" ]]; then -# downloadURL="https://slack.com/ssb/download-osx-silicon" -# elif [[ $(arch) == "i386" ]]; then -# downloadURL="https://slack.com/ssb/download-osx" -# fi - appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "^location" | awk '{print $2}' | tr -d '\r\n' | sed -E 's/.*macos\/([0-9.]*)\/.*/\1/g' ) + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "^location" | cut -d "/" -f6 ) expectedTeamID="BQR82RBBHL" ;; +smartgit) + name="SmartGit" + type="dmg" + if [[ $(arch) == "arm64" ]]; then + downloadURL="https://www.syntevo.com$(curl -fs "https://www.syntevo.com/smartgit/download/" | grep -i -o -E "/downloads/.*/smartgit.*\.dmg" | tail -1)" + elif [[ $(arch) == "i386" ]]; then + downloadURL="https://www.syntevo.com$(curl -fs "https://www.syntevo.com/smartgit/download/" | grep -i -o -E "/downloads/.*/smartgit.*\.dmg" | head -1)" + fi + appNewVersion="$(curl -fs "https://www.syntevo.com/smartgit/changelog.txt" | grep -i -E "SmartGit *[0-9.]* *.*" | head -1 | awk '{print $2}')" + expectedTeamID="PHMY45PTNW" + ;; snagit|\ snagit2021|\ snagit2020) @@ -2887,13 +3436,53 @@ sourcetree) appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/Sourcetree_([0-9.]*)_[0-9]*\.zip/\1/g') expectedTeamID="UPXU4CQZ5P" ;; +splashtopsos) + name="Splashtop SOS" + type="dmg" + downloadURL="https://download.splashtop.com/sos/SplashtopSOS.dmg" + expectedTeamID="CPQQ3AW49Y" + ;; spotify) name="Spotify" type="dmg" - downloadURL="https://download.scdn.co/Spotify.dmg" + if [[ $(arch) == arm64 ]]; then + downloadURL="https://download.scdn.co/SpotifyARM64.dmg" + elif [[ $(arch) == i386 ]]; then + downloadURL="https://download.scdn.co/Spotify.dmg" + fi # appNewVersion=$(curl -fs https://www.spotify.com/us/opensource/ | cat | grep -o "<td>.*.</td>" | head -1 | cut -d ">" -f2 | cut -d "<" -f1) # does not result in the same version as downloaded expectedTeamID="2FNC3A47ZF" ;; +sqlpropostgres) + name="SQLPro for Postgres" + type="zip" + downloadURL="https://macpostgresclient.com/download.php" + expectedTeamID="LKJB72232C" + blockingProcesses=( "SQLPro for Postgres" ) + ;; +sqlprostudio) + name="SQLPro Studio" + type="zip" + downloadURL="https://www.sqlprostudio.com/download.php" + expectedTeamID="LKJB72232C" + blockingProcesses=( "SQLPro Studio" ) + ;; +steelseriesengine) + name="SteelSeries GG" + type="pkg" + downloadURL="https://steelseries.com/engine/latest/darwin" + appNewVersion="$(curl -fsIL "$downloadURL" | grep -i "^location" | sed -E 's/.*SteelSeriesGG([0-9.]*)\.pkg/\1/')" + expectedTeamID="6WGL6CHFH2" + ;; +strongsync) + name="Strongsync" + type="dmg" + #downloadURL="https://updates.expandrive.com/apps/strongsync/download_latest" + downloadURL=$(curl -fs "https://updates.expandrive.com/appcast/strongsync.xml" | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2) + appNewVersion=$(curl -fs "https://updates.expandrive.com/appcast/strongsync.xml" | xpath '(//rss/channel/item/enclosure/@sparkle:version)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2) + versionKey="CFBundleVersion" + expectedTeamID="CH86M498V4" + ;; sublimetext) # credit: Søren Theilgaard (@theilgaard) name="Sublime Text" @@ -2902,6 +3491,17 @@ sublimetext) appNewVersion=$(curl -fs https://www.sublimetext.com/download | grep -i -A 4 "id.*changelog" | grep -io "Build [0-9]*") expectedTeamID="Z6D26JE4Y4" ;; +superhuman) + name="superhuman" + type="dmg" + if [[ $(arch) == "arm64" ]]; then + downloadURL="https://download.superhuman.com/Superhuman-arm64.dmg" + elif [[ $(arch) == "i386" ]]; then + downloadURL="https://download.superhuman.com/Superhuman.dmg" + fi + appNewVersion=$(curl -fs "https://storage.googleapis.com/download.superhuman.com/supertron-update/latest-mac.yml" | head -1 | cut -d " " -f2) + expectedTeamID="6XHFYUTQGX" + ;; supportapp) # credit: Søren Theilgaard (@theilgaard) name="Support" @@ -2926,6 +3526,13 @@ swiftruntimeforcommandlinetools) downloadURL="https://updates.cdn-apple.com/2019/cert/061-41823-20191025-5efc5a59-d7dc-46d3-9096-396bb8cb4a73/SwiftRuntimeForCommandLineTools.dmg" expectedTeamID="Software Update" ;; +sync) + name="Sync" + type="dmg" + downloadURL="https://www.sync.com/download/apple/Sync.dmg" + appNewVersion="$(curl -fs "https://www.sync.com/blog/category/desktop/feed/" | xpath '(//channel/item/title)[1]' 2>/dev/null | sed -E 's/^.* ([0-9.]*) .*$/\1/g')" + expectedTeamID="7QR39CMJ3W" + ;; tableaudesktop) name="Tableau Desktop" type="pkgInDmg" @@ -2940,6 +3547,20 @@ tableaureader) downloadURL="https://www.tableau.com/downloads/reader/mac" expectedTeamID="QJ4XPRK37C" ;; +tageditor) + name="Tag Editor" + type="dmg" + downloadURL="https://amvidia.com/downloads/tag-editor-mac.dmg" + appNewVersion=curl -sf "https://amvidia.com/tag-editor" | grep -o -E '"softwareVersion":.'"{8}" | sed 's/\"//g' | awk -F ': ' '{print $2}' + expectedTeamID="F2TH9XX9CJ" + ;; +talkdeskcallbar) + name="Callbar" + type="dmg" + downloadURL=https://downloadcallbar.talkdesk.com/Callbar-$(curl -fsL https://downloadcallbar.talkdesk.com/release_metadata.json | sed -n 's/^.*"version":"\([^"]*\)".*$/\1/p').dmg + appNewVersion=$(curl -fsL https://downloadcallbar.talkdesk.com/release_metadata.json | sed -n 's/^.*"version":"\([^"]*\)".*$/\1/p') + expectedTeamID="YGGJX44TB8" + ;; taskpaper) # credit: Drew Diver (@grumpydrew on MacAdmins Slack) name="TaskPaper" @@ -3024,12 +3645,6 @@ thunderbird) expectedTeamID="43AQ936H96" blockingProcesses=( thunderbird ) ;; -tigervnc) - name="TigerVNC Viewer" - type="dmg" - downloadURL=https://dl.bintray.com/tigervnc/stable/$(curl -s -l https://dl.bintray.com/tigervnc/stable/ | grep .dmg | sed 's/<pre><a onclick="navi(event)" href="://' | sed 's/".*//' | sort -V | tail -1) - expectedTeamID="S5LX88A9BW" - ;; toggltrack) name="Toggl Track" type="dmg" @@ -3037,6 +3652,13 @@ toggltrack) appNewVersion=$(versionFromGit toggl-open-source toggldesktop ) expectedTeamID="B227VTMZ94" ;; +tom4aconverter) + name="To M4A Converter" + type="dmg" + downloadURL="https://amvidia.com/downloads/to-m4a-converter-mac.dmg" + appNewVersion=curl -sf "https://amvidia.com/to-m4a-converter" | grep -o -E '"softwareVersion":.'"{8}" | sed 's/\"//g' | awk -F ': ' '{print $2}' + expectedTeamID="F2TH9XX9CJ" + ;; torbrowser) # credit: Søren Theilgaard (@theilgaard) name="Tor Browser" @@ -3065,6 +3687,15 @@ tunnelblick) downloadURL=$(downloadURLFromGit TunnelBlick Tunnelblick ) expectedTeamID="Z2SG5H3HC8" ;; +typora) + name="Typora" + type="dmg" + #downloadURL="https://www.typora.io/download/Typora.dmg" + downloadURL=$(curl -fs "https://www.typora.io/download/dev_update.xml" | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | cut -d '"' -f2) + #appNewVersion="$(curl -fs "https://www.typora.io/dev_release.html" | grep -o -i "h4>[0-9.]*</h4" | head -1 | sed -E 's/.*h4>([0-9.]*)<\/h4.*/\1/')" + appNewVersion=$(curl -fs "https://www.typora.io/download/dev_update.xml" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | cut -d '"' -f2) + expectedTeamID="9HWK5273G4" + ;; umbrellaroamingclient) # credit: Tadayuki Onishi (@kenchan0130) name="Umbrella Roaming Client" @@ -3086,14 +3717,19 @@ universaltypeclient) downloadURL=https://bin.extensis.com/$( curl -fs https://www.extensis.com/support/universal-type-server-7/ | grep -o "UTC-[0-9].*M.zip" ) expectedTeamID="J6MMHGD9D6" ;; +utm) + name="UTM" + type="dmg" + downloadURL=$(downloadURLFromGit utmapp UTM ) + appNewVersion=$(versionFromGit utmapp UTM ) + expectedTeamID="WDNLXAD4W8" + ;; vagrant) - # credit: AP Orlebeke (@apizz) name="Vagrant" type="pkgInDmg" pkgName="vagrant.pkg" - downloadURL=$(curl -fs https://www.vagrantup.com/downloads | tr '><' '\n' | awk -F'"' '/x86_64.dmg/ {print $6}' | head -1) - #appNewVersion=$( curl -fs https://www.vagrantup.com/downloads.html | grep -i "Current Version" ) - appNewVersion=$(versionFromGit hashicorp vagrant) + downloadURL=$(curl -fs "https://www.vagrantup.com/downloads" | tr '"' '\n' | grep "^https.*\.dmg$" | head -1) + appNewVersion=$( echo $downloadURL | cut -d "/" -f5 ) expectedTeamID="D38WU7D763" ;; vanilla) @@ -3148,24 +3784,36 @@ vlc) expectedTeamID="75GAHG3SZQ" ;; vmwarehorizonclient) - # credit: Oh4sh0 https://github.com/Oh4sh0 name="VMware Horizon Client" type="dmg" - downloadURL=$(curl -fs "https://my.vmware.com/channel/public/api/v1.0/dlg/details?locale=en_US&downloadGroup=CART21FQ2_MAC_800&productId=1027&rPId=48989" | grep -o 'Url.*..dmg"' | cut -d '"' -f3) - appNewVersion=$(curl -fs "https://my.vmware.com/channel/public/api/v1.0/dlg/details?locale=en_US&downloadGroup=CART21FQ2_MAC_800&productId=1027&rPId=48989" | sed 's/.*-\(.*\)-.*/\1/') + downloadURL=$(curl -fsL "https://my.vmware.com/channel/public/api/v1.0/dlg/details?locale=en_US&downloadGroup=CART21FQ2_MAC_800&productId=1027&rPId=48989" | grep -o 'Url.*..dmg"' | cut -d '"' -f3) + appNewVersion=$(curl -fsL "https://my.vmware.com/channel/public/api/v1.0/dlg/details?locale=en_US&downloadGroup=CART21FQ2_MAC_800&productId=1027&rPId=48989" | sed 's/.*-\(.*\)-.*/\1/') expectedTeamID="EG7KH642X6" ;; vscodium) - # credit: AP Orlebeke (@apizz) name="VSCodium" type="dmg" - downloadURL=$(curl -fs "https://api.github.com/repos/VSCodium/vscodium/releases/latest" | awk -F '"' "/browser_download_url/ && /dmg/ && ! /sig/ && ! /CLI/ && ! /sha256/ { print \$4 }") - #downloadURL=$(downloadURLFromGit VSCodium vscodium) # Too many versions - appNewVersion=$(versionFromGit VSCodium vscodium) + downloadURL="$(downloadURLFromGit VSCodium vscodium)" + appNewVersion="$(versionFromGit VSCodium vscodium)" expectedTeamID="C7S3ZQ2B8V" - appName="VSCodium.app" blockingProcesses=( Electron ) ;; +wacomdrivers) + name="Wacom Desktop Center" + type="pkgInDmg" + downloadURL="$(curl -fs https://www.wacom.com/en-us/support/product-support/drivers | grep -e "drivers/mac/professional.*dmg" | head -1 | sed -e 's/data-download-link="//g' -e 's/"//' | awk '{$1=$1}{ print }' | sed 's/\r//')" + expectedTeamID="EG27766DY7" + pkgName="Install Wacom Tablet.pkg" + appNewVersion="$(curl -fs https://www.wacom.com/en-us/support/product-support/drivers | grep mac/professional/releasenotes | head -1 | awk -F"|" '{print $1}' | awk -F"Driver" '{print $3}' | sed -e 's/ (.*//g' | tr -d ' ')" + ;; +wallyezflash) + name="Wally" + type="dmg" + downloadURL="https://configure.zsa.io/wally/osx" + #appNewVersion=$(curl -fsIL "${downloadURL}" | grep -i ^location | head -1 | sed -E 's/.*\/[a-zA-Z\-]*-([0-9.]*)\..*/\1/g') + expectedTeamID="V32BWKSNYH" + #versionKey="CFBundleVersion" + ;; webex|\ webexteams) # credit: Erik Stam (@erikstam) @@ -3188,13 +3836,6 @@ webexmeetings) #blockingProcessesMaxCPU="5" blockingProcesses=( Webex ) ;; -webexteams) - # credit: Erik Stam (@erikstam) - name="Webex Teams" - type="dmg" - downloadURL="https://binaries.webex.com/WebexTeamsDesktop-MACOS-Gold/WebexTeams.dmg" - expectedTeamID="DE8Y96K9QP" - ;; whatsapp) name="WhatsApp" type="dmg" @@ -3241,9 +3882,10 @@ xeroxphaser7800) ;; xink) name="Xink" - type="zip" - downloadURL="https://downloads.xink.io/macos/client" - #appNewVersion=$() # Cannot find version history or release notes on home page + type="pkg" + packageID="com.emailsignature.Xink" + downloadURL="https://downloads.xink.io/macos/pkg" + appNewVersion=$(curl -fs "https://downloads.xink.io/macos/appcast" | xpath '(//rss/channel/item/enclosure/@sparkle:version)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2) expectedTeamID="F287823HVS" ;; xquartz) @@ -3254,6 +3896,14 @@ xquartz) appNewVersion=$(versionFromGit XQuartz XQuartz) expectedTeamID="NA574AWV7E" ;; +yed) + # This label assumes accept of these T&C’s: https://www.yworks.com/resources/yed/license.html + name="yEd" + type="dmg" + downloadURL="https://www.yworks.com"$(curl -fs "https://www.yworks.com/products/yed/download" | grep -o -e "/resources/.*\.dmg" | tr " " '\n' | grep -o -e "/resources/.*\.dmg") + appNewVersion=$(echo $downloadURL | sed -E 's/.*-([0-9.]*)_.*\.dmg/\1/') + expectedTeamID="JD89S887M2" + ;; yubikeymanagerqt) # credit: Tadayuki Onishi (@kenchan0130) name="YubiKey Manager GUI" @@ -3269,19 +3919,45 @@ zappy) downloadURL="https://zappy.zapier.com/releases/zappy-latest.zip" expectedTeamID="6LS97Q5E79" ;; +zeplin) + name="Zeplin" + type="zip" + downloadURL="https://zpl.io/download-mac" + appNewVersion="$(curl -fs "https://api.appcenter.ms/v0.1/public/sparkle/apps/8926efff-e734-b6d3-03d0-9f41d90c34fc" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | cut -d '"' -f 2)" + expectedTeamID="8U3Y4X5WDQ" + ;; +zohoworkdrive) +# Using this label expects you to agree to these: +# License Areemant: https://www.zoho.com/workdrive/zohoworkdrive-license-agreement.html +# Privacy policy: https://www.zoho.com/privacy.html + name="Zoho WorkDrive" + type="dmg" + lines=$(curl -fs https://www.zohowebstatic.com/sites/all/themes/zoho/scripts/workdrive.js | grep files-accl.zohopublic.com | tr '"' "\n") + downloadURL=$(echo "$lines" | grep -i "files-accl.zohopublic.com")$(echo "$lines" | grep -i -A17 "files-accl.zohopublic.com" | grep -i -A2 macintosh | tail -1) + expectedTeamID="TZ824L8Y37" + ;; +zohoworkdrivetruesync) +# Using this label expects you to agree to these: +# License Areemant: https://www.zoho.com/workdrive/zohoworkdrive-license-agreement.html +# Privacy policy: https://www.zoho.com/privacy.html + name="Zoho WorkDrive TrueSync" + type="pkg" + #https://www.zoho.com/workdrive/truesync.html + #https://files-accl.zohopublic.com/public/tsbin/download/c488f53fb0fe339a8a3868a16d56ede6 + downloadURL=$(curl -fs "https://www.zoho.com/workdrive/truesync.html" | tr '<' '\n' | grep -B3 "For Mac" | grep -o -m1 "https.*\"" | cut -d '"' -f1) + expectedTeamID="TZ824L8Y37" + ;; zoom) - # credit: Isaac Ordonez, Mann consulting (@mannconsulting) - name="Zoom.us" + name="zoom.us" type="pkg" downloadURL="https://zoom.us/client/latest/ZoomInstallerIT.pkg" - appNewVersion=$(curl -fs -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15)" "https://zoom.us/download" | grep Version | head -n 1 | sed -E 's/.* ([0-9.]* \(.*\)).*/\1/') # credit: Søren Theilgaard (@theilgaard) + appNewVersion="$(curl -fsIL ${downloadURL} | grep -i ^location | cut -d "/" -f5)" expectedTeamID="BJ4HAAB9B3" - blockingProcesses=( zoom.us ) ;; zoomclient) name="zoom.us" type="pkg" - packageID="us.zoom.pkg.videmeeting" + packageID="us.zoom.pkg.videomeeting" if [[ $(arch) == i386 ]]; then downloadURL="https://zoom.us/client/latest/Zoom.pkg" elif [[ $(arch) == arm64 ]]; then @@ -3292,15 +3968,22 @@ zoomclient) blockingProcesses=( zoom.us ) #blockingProcessesMaxCPU="5" ;; +zoomgov) + name="zoom.us" + type="pkg" + downloadURL="https://www.zoomgov.com/client/latest/ZoomInstallerIT.pkg" + appNewVersion="$(curl -fsIL ${downloadURL} | grep -i ^location | cut -d "/" -f5)" + expectedTeamID="BJ4HAAB9B3" + ;; zoomrooms) -   name="ZoomRooms" -   type="pkg" -   packageID="us.zoom.pkg.zp" -   downloadURL="https://zoom.us/client/latest/ZoomRooms.pkg" -   appNewVersion="$(curl -fsIL ${downloadURL} | grep -i location | cut -d "/" -f5)" -   expectedTeamID="BJ4HAAB9B3" + name="ZoomRooms" + type="pkg" + packageID="us.zoom.pkg.zp" + downloadURL="https://zoom.us/client/latest/ZoomRooms.pkg" + appNewVersion="$(curl -fsIL ${downloadURL} | grep -i location | cut -d "/" -f5)" + expectedTeamID="BJ4HAAB9B3" blockingProcesses=( "ZoomPresence" ) -   ;; + ;; zulujdk11) name="Zulu JDK 11" type="pkgInDmg" @@ -3341,18 +4024,18 @@ zulujdk15) appNewVersion=$(echo "$downloadURL" | cut -d "-" -f 1 | sed -e "s/.*zulu//") # Cannot be compared to anything ;; zulujdk8) - name="Zulu JDK 8" - type="pkgInDmg" - packageID="com.azulsystems.zulu.8" - if [[ $(arch) == i386 ]]; then - downloadURL=https://cdn.azul.com/zulu/bin/$(curl -fs "https://cdn.azul.com/zulu/bin/" | grep -Eio '">zulu8.*ca-jdk8.*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 '">zulu8.*ca-jdk8.*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(){ if [ -f "/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Info.plist" ]; then /usr/bin/defaults read "/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Info.plist" "CFBundleName" | sed 's/Zulu //'; fi } - appNewVersion=$(echo "$downloadURL" | cut -d "-" -f 1 | sed -e "s/.*zulu//") # Cannot be compared to anything - ;; + name="Zulu JDK 8" + type="pkgInDmg" + packageID="com.azulsystems.zulu.8" + if [[ $(arch) == i386 ]]; then + downloadURL=https://cdn.azul.com/zulu/bin/$(curl -fs "https://cdn.azul.com/zulu/bin/" | grep -Eio '">zulu8.*ca-jdk8.*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 '">zulu8.*ca-jdk8.*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(){ if [ -f "/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Info.plist" ]; then /usr/bin/defaults read "/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Info.plist" "CFBundleName" | sed 's/Zulu //'; fi } + appNewVersion=$(echo "$downloadURL" | cut -d "-" -f 1 | sed -e "s/.*zulu//") # Cannot be compared to anything + ;; *) # unknown label #printlog "unknown label $label" @@ -3472,6 +4155,10 @@ 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." + updateTool="" +fi if [[ -n $appNewVersion ]]; then printlog "Latest version of $name is $appNewVersion" if [[ $appversion == $appNewVersion ]]; then @@ -3484,9 +4171,6 @@ if [[ -n $appNewVersion ]]; then displaynotification "$message" "No update for $name!" fi cleanupAndExit 0 "No newer version." - else - printlog "Using force to install anyway. Not using updateTool." - updateTool="" fi else printlog "DEBUG mode enabled, not exiting, but there is no new version of app." @@ -3494,10 +4178,6 @@ if [[ -n $appNewVersion ]]; then fi else printlog "Latest version not specified." - if [[ $INSTALL == "force" ]]; then - printlog "Using force to install, so not using updateTool." - updateTool="" - fi fi # MARK: check if this is an Update and we can use updateTool @@ -3524,14 +4204,22 @@ else printlog "Downloading $downloadURL to $archiveName" if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then printlog "notifying" - displaynotification "Downloading $name update" "Download in progress …" + if [[ $updateDetected == "YES" ]]; then + displaynotification "Downloading $name update" "Download in progress …" + else + displaynotification "Downloading new $name" "Download in progress …" + fi fi if ! curl --location --fail --silent "$downloadURL" -o "$archiveName"; then printlog "error downloading $downloadURL" message="$name update/installation failed. This will be logged, so IT can follow up." if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then printlog "notifying" - displaynotification "$message" "Error installing/updating $name" + if [[ $updateDetected == "YES" ]]; then + displaynotification "$message" "Error updating $name" + else + displaynotification "$message" "Error installing $name" + fi fi cleanupAndExit 2 fi @@ -3554,7 +4242,17 @@ fi printlog "Installing $name" if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then printlog "notifying" - displaynotification "Installing $name" "Installation in progress …" + if [[ $updateDetected == "YES" ]]; then + displaynotification "Updating $name" "Installation in progress …" + else + displaynotification "Installing $name" "Installation in progress …" + fi +fi + +if [ -n "$installerTool" ]; then + # installerTool defined, and we use that for installation + printlog "installerTool used: $installerTool" + appName="$installerTool" fi case $type in diff --git a/Labels.txt b/Labels.txt index ecbd5a9..e873028 100644 --- a/Labels.txt +++ b/Labels.txt @@ -4,6 +4,7 @@ abstract adobebrackets adobeconnect +adobecreativeclouddesktop adobereaderdc adobereaderdc-install adobereaderdc-update @@ -11,6 +12,7 @@ aircall airserver airtame aldente +alephone alfred alttab amazonchime @@ -49,15 +51,20 @@ boxdrive boxsync boxtools brave +bugdom caffeine cakebrew calibre camostudio camtasia +canva +chatwork cisdem-documentreader citrixworkspace clevershare2 clickshare +closeio +cloudya code42 coderunner colourcontrastanalyser @@ -74,6 +81,7 @@ depnotify desktoppr detectxswift devonthink +dialog dialpad discord docker @@ -83,13 +91,17 @@ easeusdatarecoverywizard egnyte element eraseinstall +eshareosx etrecheck evernote exelbanstats +exifrenamer fantastical +fastscripts favro ferdi figma +findanyfile firefox firefox_da firefox_intl @@ -128,22 +140,27 @@ icons imazingprofileeditor inkscape insomnia +installomator installomator_theile intellijideace istatmenus iterm2 jabradirect jamfconnect +jamfconnectconfiguration jamfmigrator jamfpppcutility jamfreenroller +jetbrainsclion jetbrainsdatagrip jetbrainsintellijidea jetbrainsintellijideace jetbrainsphpstorm jetbrainspycharm jetbrainspycharmce +jetbrainsrubymine jetbrainstoolbox +jetbrainswebstorm karabinerelements keepassxc keka @@ -158,11 +175,17 @@ launchbar lexarrecoverytool libreoffice logitechoptions +logseq loom lucifer lulu +maccyapp macfuse +macports malwarebytes +marathon +marathon2 +marathoninfinity mattermost menumeters microsoftautoupdate @@ -188,6 +211,8 @@ microsoftvisualstudiocode microsoftword microsoftyammer miro +montereyblocker +mowgliiitsycal musescore muzzle netnewswire @@ -195,6 +220,7 @@ nextcloud nomad nomadlogin notion +nudge nvivo obs obsidian @@ -212,9 +238,13 @@ onlyofficedesktop openvpnconnect openvpnconnectv3 opera +ottomatic +overflow pacifist +pandoc parsec pdfsam +perimeter81 pitch plantronicshub platypus @@ -231,6 +261,8 @@ r ramboxce rectangle redeye +remotix +remotixagent resiliosynchome retrobatch ricohpsprinters @@ -248,6 +280,7 @@ scaleft screamingfrogseospider screencloudplayer screenflick +sequelpro sfsymbols shield sidekick @@ -256,6 +289,7 @@ silnite sirimote sizeup sketch +sketchupviewer skype slack smartgit @@ -269,13 +303,20 @@ sonoss2 sourcetree splashtopsos spotify +sqlpropostgres +sqlprostudio +steelseriesengine +strongsync sublimetext +superhuman supportapp suspiciouspackage swiftruntimeforcommandlinetools sync tableaudesktop tableaureader +tageditor +talkdeskcallbar taskpaper teamviewer teamviewerhost @@ -288,13 +329,16 @@ theunarchiver things thunderbird toggltrack +tom4aconverter torbrowser trex tunnelbear tunnelblick +typora umbrellaroamingclient uniconverter universaltypeclient +utm vagrant vanilla veracrypt @@ -305,6 +349,7 @@ vivaldi vlc vmwarehorizonclient vscodium +wacomdrivers wallyezflash webex webexmeetings @@ -317,12 +362,15 @@ wwdc xeroxphaser7800 xink xquartz +yed yubikeymanagerqt zappy zeplin zohoworkdrive +zohoworkdrivetruesync zoom zoomclient +zoomgov zoomrooms zulujdk11 zulujdk13 diff --git a/MDM/App script.sh b/MDM/App script.sh new file mode 100755 index 0000000..a23fd95 --- /dev/null +++ b/MDM/App script.sh @@ -0,0 +1,168 @@ +#!/bin/zsh +# Installation using Installomator +what="brave" # enter the software to install + +# To be used as a script sent out from a MDM. +# Fill the variable "what" above with a label. +# Script will run this label. +############################################### + +# No sleeping +/usr/bin/caffeinate -d -i -m -u & +caffeinatepid=$! +caffexit () { + kill "$caffeinatepid" + exit $1 +} + +# Verify that Installomator has been installed +destFile="/usr/local/Installomator/Installomator.sh" +if [ ! -e "${destFile}" ]; then + echo "Installomator not found here:" + echo "${destFile}" + echo "Exiting." + caffexit 99 +fi + +${destFile} ${what} LOGO=mosyleb BLOCKING_PROCESS_ACTION=tell_user #NOTIFY=all #INSTALL=force +if [ $? != 0 ]; then +# This is currently not working in Mosyle, that will ignore script errors. Please request support for this from Mosyle! + echo "Error installing ${what}. Exit code $?" + caffexit $? +fi + +echo "[$(DATE)][LOG-END]" + +caffexit 0 + +# notify behavior +# NOTIFY=success +# options: +# - success notify the user on success +# - silent no notifications +# - all all notifications (great for Self Service installation) + + +# behavior when blocking processes are found +# BLOCKING_PROCESS_ACTION=tell_user +# options: +# - ignore continue even when blocking processes are found +# - quit app will be told to quit nicely, if running +# - quit_kill told to quit twice, then it will be killed +# Could be great for service apps, if they do not respawn +# - silent_fail exit script without prompt or installation +# - prompt_user show a user dialog for each blocking process found +# abort after three attempts to quit +# (only if user accepts to quit the apps, otherwise +# the update is cancelled). +# - prompt_user_then_kill +# show a user dialog for each blocking process found, +# attempt to quit two times, kill the process finally +# - prompt_user_loop +# Like prompt-user, but clicking "Not Now", will just wait an hour, +# and then it will ask again. +# WARNING! It might block the MDM agent on the machine, as +# the scripts gets stuct in waiting until the hour has passed, +# possibly blocking for other management actions in this time. +# - tell_user User will be showed a notification about the important update, +# but user is only allowed to quit and continue, and then we +# ask the app to quit. +# - tell_user_then_kill +# Show dialog 2 times, and if the quitting fails, the +# blocking processes will be killed. +# - kill kill process without prompting or giving the user a chance to save + + +# logo-icon used in dialog boxes if app is blocking +# LOGO=appstore +# options: +# - appstore Icon is Apple App Store (default) +# - jamf JAMF Pro +# - mosyleb Mosyle Business +# - mosylem Mosyle Manager (Education) +# - addigy Addigy +# path can also be set in the command call, and if file exists, it will be used. +# Like 'LOGO="/System/Applications/App\ Store.app/Contents/Resources/AppIcon.icns"' +# (spaces have to be escaped). + + +# App Store apps handling +# IGNORE_APP_STORE_APPS=no +# options: +# - no If installed app is from App Store (which include VPP installed apps) +# it will not be touched, no matter it's version (default) +# - yes Replace App Store (and VPP) version of app and handle future +# updates using Installomator, even if latest version. +# 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-loop script.sh b/MDM/App-loop script.sh new file mode 100755 index 0000000..f8b1025 --- /dev/null +++ b/MDM/App-loop script.sh @@ -0,0 +1,176 @@ +#!/bin/zsh +# Installation using Installomator +what="microsoftteams microsoftyammer firefox bravebrowser cyberduck vlc signal" # enter the software to install separated with spaces + +# To be used as a script sent out from a MDM. +# Fill the variable "what" above with labels separated by space " ". +# Script will loop through these labels. +###################################################################### + +# No sleeping +/usr/bin/caffeinate -d -i -m -u & +caffeinatepid=$! +caffexit () { + kill "$caffeinatepid" + exit $1 +} + +# Count errors +errorCount=0 + +# Verify that Installomator has been installed +destFile="/usr/local/Installomator/Installomator.sh" +if [ ! -e "${destFile}" ]; then + echo "Installomator not found here:" + echo "${destFile}" + echo "Exiting." + caffexit 99 +fi + +for item in $what; do + #echo $item + ${destFile} ${item} LOGO=mosyleb BLOCKING_PROCESS_ACTION=tell_user #NOTIFY=all #INSTALL=force + if [ $? != 0 ]; then + # This is currently not working in Mosyle, that will ignore script errors. Please request support for this from Mosyle! + echo "[$(DATE)] Error installing ${item}. Exit code $?" + let errorCount++ + fi +done + +echo +echo "Errors: $errorCount" +echo "[$(DATE)][LOG-END]" + +caffexit $errorCount + +# notify behavior +# NOTIFY=success +# options: +# - success notify the user on success +# - silent no notifications +# - all all notifications (great for Self Service installation) + + +# behavior when blocking processes are found +# BLOCKING_PROCESS_ACTION=tell_user +# options: +# - ignore continue even when blocking processes are found +# - quit app will be told to quit nicely, if running +# - quit_kill told to quit twice, then it will be killed +# Could be great for service apps, if they do not respawn +# - silent_fail exit script without prompt or installation +# - prompt_user show a user dialog for each blocking process found +# abort after three attempts to quit +# (only if user accepts to quit the apps, otherwise +# the update is cancelled). +# - prompt_user_then_kill +# show a user dialog for each blocking process found, +# attempt to quit two times, kill the process finally +# - prompt_user_loop +# Like prompt-user, but clicking "Not Now", will just wait an hour, +# and then it will ask again. +# WARNING! It might block the MDM agent on the machine, as +# the scripts gets stuct in waiting until the hour has passed, +# possibly blocking for other management actions in this time. +# - tell_user User will be showed a notification about the important update, +# but user is only allowed to quit and continue, and then we +# ask the app to quit. +# - tell_user_then_kill +# Show dialog 2 times, and if the quitting fails, the +# blocking processes will be killed. +# - kill kill process without prompting or giving the user a chance to save + + +# logo-icon used in dialog boxes if app is blocking +# LOGO=appstore +# options: +# - appstore Icon is Apple App Store (default) +# - jamf JAMF Pro +# - mosyleb Mosyle Business +# - mosylem Mosyle Manager (Education) +# - addigy Addigy +# path can also be set in the command call, and if file exists, it will be used. +# Like 'LOGO="/System/Applications/App\ Store.app/Contents/Resources/AppIcon.icns"' +# (spaces have to be escaped). + + +# App Store apps handling +# IGNORE_APP_STORE_APPS=no +# options: +# - no If installed app is from App Store (which include VPP installed apps) +# it will not be touched, no matter it's version (default) +# - yes Replace App Store (and VPP) version of app and handle future +# updates using Installomator, even if latest version. +# 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/Installomator update.sh b/MDM/Installomator update.sh new file mode 100755 index 0000000..fbc8327 --- /dev/null +++ b/MDM/Installomator update.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Updating Installomator +# Usefull to push out after deployment if earlier version was deployed in DEP profile +# Currently script uses valuesfromarguments as a label is not included before next release, so this can be used to install to version 0.7 + +what="installomator" # enter the software to install + +# No sleeping +/usr/bin/caffeinate -d -i -m -u & +caffeinatepid=$! +caffexit () { + kill "$caffeinatepid" + exit $1 +} + +# Verify that Installomator has been installed +destFile="/usr/local/Installomator/Installomator.sh" +if [ ! -e "${destFile}" ]; then + echo "Installomator not found here:" + echo "${destFile}" + echo "Exiting." + caffexit 99 +fi + +${destFile} valuesfromarguments\ + name=Installomator \ + type=pkg \ + packageID=com.scriptingosx.Installomator \ + downloadURL=https://github.com/Installomator/Installomator/releases/download/v0.7release/Installomator-0.7.0.pkg \ + appNewVersion=0.7 \ + expectedTeamID=JME5BW3F3R \ + BLOCKING_PROCESS_ACTION=ignore \ + NOTIFY=silent + +# ${destFile} ${what} BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent +if [ $? != 0 ]; then +# This is currently not working in Mosyle, that will ignore script errors. Please request support for this from Mosyle! + echo "Error installing ${what}. Exit code $?" + caffexit $? +fi + +echo "[$(DATE)][LOG-END]" +caffexit 0 diff --git a/MDM/MDMAddigy CustomSoftware.sh b/MDM/MDMAddigy CustomSoftware.sh new file mode 100755 index 0000000..864e2d4 --- /dev/null +++ b/MDM/MDMAddigy CustomSoftware.sh @@ -0,0 +1,99 @@ +#!/bin/zsh + +# Specific settings in Addigy to configure Custom Software for installomator. +# Addigy has 3 parts to fill out for this, Installation script, Condition, and Removal steps (see RemoveInstallomator.sh). + +# Mark: Installation script +# Just click “Add” to autogenerate the installer script line by clicking the “Add”-button next to the Installer PKG, replace with first line below +/usr/sbin/installer -pkg "/Library/Addigy/ansible/packages/Installomator (0.7.0)/Installomator-0.7.0.pkg" -target / + +# Installation using Installomator +what="supportapp xink textmate microsoftedge wwdc keka vlc " # enter the software to installed separated with spaces + +# To be used as a script sent out from a MDM. +# Fill the variable "what" above with labels separated by space " ". +# Script will loop through these labels and exit with number of errors. +###################################################################### + +# No sleeping +/usr/bin/caffeinate -d -i -m -u & +caffeinatepid=$! +caffexit () { + kill "$caffeinatepid" + exit $1 +} + +# Count errors +errorCount=0 + +# Verify that Installomator has been installed +destFile="/usr/local/Installomator/Installomator.sh" +if [ ! -e "${destFile}" ]; then + echo "Installomator not found here:" + echo "${destFile}" + echo "Exiting." + caffexit 99 +fi + +for item in $what; do + #echo $item + ${destFile} ${item} LOGO=addigy NOTIFY=silent BLOCKING_PROCESS_ACTION=quit_kill #INSTALL=force + if [ $? != 0 ]; then + # Error handling + echo "[$(DATE)] Error installing ${item}. Exit code $?" + let errorCount++ + fi +done + +echo +echo "Errors: $errorCount" +echo "[$(DATE)][LOG-END]" + +caffexit $errorCount + +# Mark: Conditions +# Install on success +# Remember to fill out the correct “TARGET_VERSION” and “PKG_ID”, and click "Install on succes". +PKG_ID="com.scriptingosx.Installomator" +TARGET_VERSION="0.7.0" + +vercomp () { + if [[ $1 == $2 ]]; then + return 0 + fi + local IFS=. + local i ver1=($1) ver2=($2) + # fill empty fields in ver1 with zeros + for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do + ver1[i]=0 + done + for ((i=0; i<${#ver1[@]}; i++)); do + if [[ -z ${ver2[i]} ]]; then + # fill empty fields in ver2 with zeros + ver2[i]=0 + fi + if ((10#${ver1[i]} > 10#${ver2[i]})); then + return 1 + fi + if ((10#${ver1[i]} < 10#${ver2[i]})); then + return 2 + fi + done + return 0 +} + +INSTALLED_VERSION="$(pkgutil --pkg-info $PKG_ID | grep -i "^version" | awk '{print $2}')" + +echo "Current Version: ${INSTALLED_VERSION}" + +vercomp ${TARGET_VERSION} ${INSTALLED_VERSION} +COMP=$? # 0 means the same, 1 means TARGET is newer, 2 means INSTALLED is newer +echo "COMPARISON: ${COMP}" + +if [ "${COMP}" -eq 1 ]; then + echo "Installed version is older than ${TARGET_VERSION}." + exit 0 +else + echo "Installed version is the same or newer than ${TARGET_VERSION}." + exit 1 +fi diff --git a/MDM/MDMMosyle install.sh b/MDM/MDMMosyle install.sh new file mode 100644 index 0000000..5a628f7 --- /dev/null +++ b/MDM/MDMMosyle install.sh @@ -0,0 +1,72 @@ +PKG_ID="com.scriptingosx.Installomator" +TARGET_VERSION="0.7.0" +URLDOWNLOAD="%MosyleCDNFile:blah-blah-blah%" +###################################################################### +# Installation using Installomator (enter the software to install separated with spaces in the "what"-variable) +what="handbrake theunarchiver microsoftoffice365" +# Covered by Mosyle Catalog: "brave firefox googlechrome microsoftedge microsoftteams signal sublimetext vlc webex zoom" among others +###################################################################### + +## Mark: Code here + +# No sleeping +/usr/bin/caffeinate -d -i -m -u & +caffeinatepid=$! +caffexit () { + kill "$caffeinatepid" + exit $1 +} + +# Mark: Condition for Installomator installation + +INSTALLED_VERSION="$(pkgutil --pkg-info $PKG_ID 2>/dev/null | grep -i "^version" | awk '{print $2}')" + +echo "Current Version: ${INSTALLED_VERSION}" + +if [[ "$TARGET_VERSION" != "$INSTALLED_VERSION" ]]; then + TMPDIR=$(mktemp -d ) + if ! cd "$TMPDIR"; then + echo "error changing directory $TMPDIR" + caffexit 98 + fi + NAME=$TMPDIR/$(date +%s).pkg + if ! curl -fsL "$URLDOWNLOAD" -o "$NAME"; then + echo "error downloading $URLDOWNLOAD to $NAME." + caffexit 97 + fi + installer -pkg "$NAME" -target / + rm -rf "$TMPDIR" +else + echo "Installomator version $INSTALLED_VERSION already installed!" +fi + + +# Mark: Start Installomator label(s) installation + +# Count errors +errorCount=0 + +# Verify that Installomator has been installed +destFile="/usr/local/Installomator/Installomator.sh" +if [ ! -e "${destFile}" ]; then + echo "Installomator not found here:" + echo "${destFile}" + echo "Exiting." + caffexit 99 +fi + +for item in $what; do + #echo $item + ${destFile} ${item} LOGO=mosyle NOTIFY=all BLOCKING_PROCESS_ACTION=tell_user #NOTIFY=silent BLOCKING_PROCESS_ACTION=quit_kill #INSTALL=force + if [ $? != 0 ]; then + # Error handling + echo "[$(DATE)] Error installing ${item}. Exit code $?" + let errorCount++ + fi +done + +echo +echo "Errors: $errorCount" +echo "[$(DATE)][LOG-END]" + +caffexit $errorCount diff --git a/MDM/Manual valuesfromarguments.sh b/MDM/Manual valuesfromarguments.sh new file mode 100755 index 0000000..f435825 --- /dev/null +++ b/MDM/Manual valuesfromarguments.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Installation using Installomator +# Example of installing software using valuesfromarguments to install a custom software + +what="valuesfromarguments" # enter the software to install + +# No sleeping +/usr/bin/caffeinate -d -i -m -u & +caffeinatepid=$! +caffexit () { + kill "$caffeinatepid" + exit $1 +} + +# Verify that Installomator has been installed +destFile="/usr/local/Installomator/Installomator.sh" +if [ ! -e "${destFile}" ]; then + echo "Installomator not found here:" + echo "${destFile}" + echo "Exiting." + caffexit 99 +fi + +${destFile} valuesfromarguments \ + name=\"Zoho\ WorkDrive\" \ + type=dmg \ + downloadURL=https://files-accl.zohopublic.com/public/wdbin/download/46f971e4fc4a32b68ad5d7dade38a7d2 \ + appNewVersion=2.6.25 \ + expectedTeamID=TZ824L8Y37 \ + BLOCKING_PROCESS_ACTION=quit \ + NOTIFY=all + +# ${destFile} ${what} BLOCKING_PROCESS_ACTION=ignore NOTIFY=silent +if [ $? != 0 ]; then +# This is currently not working in Mosyle, that will ignore script errors. Please request support for this from Mosyle! + echo "Error installing ${what}. Exit code $?" + caffexit $? +fi + +echo "[$(DATE)][LOG-END]" +caffexit 0 diff --git a/MDM/RemoveInstallomator.sh b/MDM/RemoveInstallomator.sh new file mode 100644 index 0000000..8a6b405 --- /dev/null +++ b/MDM/RemoveInstallomator.sh @@ -0,0 +1,13 @@ +#!/bin/zsh + +# how to remove Installomator. + +# Mark: This fork +pkgutil --forget "com.scriptingosx.Installomator" +rm /usr/local/Installomator/Installomator.sh +rmdir /usr/local/Installomator + +# Mark: Theile fork +pkgutil --forget "dk.theilgaard.pkg.Installomator" +rm /usr/local/bin/Installomator.sh +rm /usr/local/bin/InstallomatorLabels.sh diff --git a/README.md b/README.md index 36cfaba..aef13c3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Installomator -__Please note, that if you are contributing to this project with new labels or other suggestions in PRs, please put your changes in the fragmented files, not the full `Installomator.sh` script. The full script is now a build of the fragments, and will be overwritten.__ - _The one installer script to rule them all._ ![](https://img.shields.io/github/v/release/scriptingosx/Installomator) ![](https://img.shields.io/github/downloads/scriptingosx/Installomator/latest/total) ![](https://img.shields.io/badge/macOS-10.14%2B-success) ![](https://img.shields.io/github/license/scriptingosx/Installomator) @@ -14,15 +12,13 @@ I have put a lot of work into making it stable and safe, but I cannot - of cours ## Support and Contributing +__Please note, that if you are contributing to this project with new labels or other suggestions in PRs, please put your changes in the files below `fragments`-folder. DO NOT edit the full `Installomator.sh` script. The full script is now a build of the fragments, and will be overwritten. See the REAMDME.md file in the `utils` directory for detailed instructions.__ + Discussion, support and advice around Installomator happens in the `#installomator` channel in the [MacAdmins.org Slack](https://macadmins.org). Go there for support questions. -Do not create an issue just when you have a questions, but do file an issue or pull request for bugs or wrong behavior. When in doubt, ask in the above Slack channel. +Do not create an issue just when you have a questions, but do file an issue or pull request (PR) for bugs or wrong behavior. When in doubt, ask in the above Slack channel. -If you have added a new label, then please file a pull request. (and Thank you!) - -__Please note, that if you are contributing to this project with new labels or other suggestions in PRs, please put your changes in the fragmented files, not the full `Installomator.sh` script. The full script is now a build of the fragments, and will be overwritten.__ - -We try to keep the script as short as possible, and with more than 300 labels, we can save 300 lines in the script, if we do not have credit lines on each of these. So we are thankful for your contribution, but we will be removing these lines in the coming releases. +Please see [CONTRIBUTING.md](https://github.com/Installomator/Installomator/blob/dev/CONTRIBUTING.md) for how to contribute. ## More reading @@ -30,7 +26,6 @@ There are a few interesting post on Installomator on my weblog: - [Introducing Installomator](https://scriptingosx.com/2020/05/introducing-installomator/) - [Using Installomator with Jamf Pro](https://scriptingosx.com/2020/06/using-installomator-with-jamf-pro/) by Mischa van der Bent -- [Using another MDM than Jamf and you might want a local installation](https://github.com/Theile/Installomator/) By Søren Theilgaard ## Background @@ -91,7 +86,7 @@ Installomator can work with the following common archive and installer types: - dmg: for the common 'drag app to /Applications' installation style - zip: the application is just compressed with zip or or tbz -When the download yields a pkg file, Installomator will run `installer` to install it on the current system. +When the download yields a pkg file, Installomator will run `installer` to install it on the current system. Applications in dmgs or zips will be copied to `/Applications` and their owner will be set to the current user, so the install works like a standard drag'n drop installation. @@ -116,7 +111,7 @@ There is a debug mode and one other setting that can be controlled with variable ### Extensible -As of this writing, Installomator knows how to download and install more than 238 different applications. You can add more by adding a block to the _long_ `case` statement starting on line 758. Some of them are more elaborate, but most of them (just) need this information (not really "just" in this case, as we have to differentiate between arm64 and i386 versions for both `downloadURL` and `appNewVersion`): +As of this writing, Installomator knows how to download and install more than 364 different applications. You can add more by adding new labels to the `fragments`-folder. Below is an example of a label, and most of them (just) needs this information (not really "just" in this case, as we have to differentiate between arm64 and i386 versions for both `downloadURL` and `appNewVersion`): ``` googlechrome) @@ -125,11 +120,11 @@ googlechrome) if [[ $(arch) != "i386" ]]; then printlog "Architecture: arm64 (not i386)" downloadURL="https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg" - appNewVersion=$(curl -s https://omahaproxy.appspot.com/history | awk -F',' '/mac_arm64,stable/{print $3; exit}') # Credit: William Smith (@meck) + appNewVersion=$(curl -s https://omahaproxy.appspot.com/history | awk -F',' '/mac_arm64,stable/{print $3; exit}') else printlog "Architecture: i386" downloadURL="https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg" - appNewVersion=$(curl -s https://omahaproxy.appspot.com/history | awk -F',' '/mac,stable/{print $3; exit}') # Credit: William Smith (@meck) + appNewVersion=$(curl -s https://omahaproxy.appspot.com/history | awk -F',' '/mac,stable/{print $3; exit}') fi expectedTeamID="EQHXZ8M8AV" ;; @@ -145,7 +140,7 @@ Please note: Labels should be named in small caps, numbers 0-9, “-”, and “ I wrote this script mainly for use with Jamf Pro, because that is what we use. For testing, you can run the script interactively from the command line. However, I have tried to keep anything that is specific to Jamf optional, or so flexible that it will work anywhere. Even if it does not work with your management system 'out of the box,' the adaptations should be straightforward. -Not all MDMs can include the full script, for those MDMs it might be more useful to install it on the client machines, and run it from there. See [Using another MDM than Jamf and you might want a local installation](https://github.com/Theile/Installomator/) By Søren Theilgaard. +Not all MDMs can include the full script, for those MDMs it might be more useful to install it on the client machines, and run it from there. So a PKG to be installed on client Macs is also provided here. ### No dependencies @@ -240,7 +235,7 @@ WARNING! It might block the MDM agent on the machine, as the scripts gets stuct - `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. -If any process was closed, Installomator will try to open the app again, after the update process is done. +If any process was closed, Installomator will try to open the app again, after the update process is done. ### Notification @@ -271,7 +266,7 @@ __options:__ 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: -- ``: When not set, software is only installed if it is newer/different in version (default) +- ` `: When not set, software is only installed if it is newer/different in version (default) - `force`: Install even if it’s the same version ### Re-opening of closed app @@ -354,7 +349,7 @@ Depending on the application or pkg there are a few more variables you can or ne dmg or zip: Applications will be copied to this directory. Default value is '`/Applications`' for dmg and zip installations. - pkg: + pkg: `targetDir` is used as the install-location. Default is '`/`'. - `blockingProcesses`: (optional) @@ -376,10 +371,23 @@ Depending on the application or pkg there are a few more variables you can or ne `$updateTool $updateArguments` Will be run instead of of downloading and installing a complete new version. Use this when the `updateTool` does differential and optimized downloads. - e.g. `msupdate` (see microsoft installations) + e.g. `msupdate` (see various Microsoft installations). - `updateToolRunAsCurrentUser`: - When this variable is set (any value), `$updateTool` will be run as the current user. Default is unset and + When this variable is set (any value), `$updateTool` will be run as the current user. Default is unset and + +- `CLIInstaller`: +- `CLIArguments`: + If the downloaded dmg is actually 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 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 (if it’s the same). + We can support a whole range of other software titles by implementing this. + See label adobecreativeclouddesktop. + +- `installerTool`: + Introduced as part of `CLIInstaller`. If the installer in the DMG or ZIP is named differently than the installed app, then this variable can be used to name the installer that should be located after mounting/expanding the downloaded archive. + See label adobecreativeclouddesktop ### Configuration from Arguments diff --git a/fragments/arguments.sh b/fragments/arguments.sh index 4fca81e..0f8765f 100644 --- a/fragments/arguments.sh +++ b/fragments/arguments.sh @@ -36,9 +36,20 @@ done # lowercase the label label=${label:l} +# separate check for 'version' in order to print plain version number without any other information +if [[ $label == "version" ]]; then + echo "$VERSION" + exit 0 +fi + printlog "################## Start Installomator v. $VERSION" printlog "################## $label" +# Check for DEBUG mode +if [[ $DEBUG -gt 0 ]]; then + printlog "DEBUG mode $DEBUG enabled." +fi + # How we get version number from app # (alternative is "CFBundleVersion", that can be used in labels) versionKey="CFBundleShortVersionString" @@ -46,14 +57,14 @@ versionKey="CFBundleShortVersionString" # get current user currentUser=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ { print $3 }') +# MARK: check for root +if [[ "$(whoami)" != "root" && "$DEBUG" -ne 2 ]]; then + # not running as root + cleanupAndExit 6 "not running as root, exiting" +fi # MARK: labels in case statement case $label in -version) - # print the script VERSION - printlog "$VERSION" - exit 0 - ;; longversion) # print the script version printlog "Installomater: version $VERSION ($VERSIONDATE)" diff --git a/fragments/broken/mightymike.sh b/fragments/broken/mightymike.sh new file mode 100644 index 0000000..b241a6a --- /dev/null +++ b/fragments/broken/mightymike.sh @@ -0,0 +1,7 @@ +mightymike) + name="Nanosaur" + type="dmg" + downloadURL=$(downloadURLFromGit jorio MightyMike) + appNewVersion=$(versionFromGit jorio MightyMike) + expectedTeamID="RVNL7XC27G" + ;; diff --git a/fragments/broken/nanosaur.sh b/fragments/broken/nanosaur.sh new file mode 100644 index 0000000..980f53e --- /dev/null +++ b/fragments/broken/nanosaur.sh @@ -0,0 +1,7 @@ +nanosaur) + name="Nanosaur" + type="dmg" + downloadURL=$(downloadURLFromGit jorio Nanosaur) + appNewVersion=$(versionFromGit jorio Nanosaur) + expectedTeamID="RVNL7XC27G" + ;; diff --git a/fragments/functions.sh b/fragments/functions.sh index 7725e80..82dbe00 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -4,7 +4,7 @@ cleanupAndExit() { # $1 = exit code, $2 message if [[ -n $2 && $1 -ne 0 ]]; then printlog "ERROR: $2" fi - if [ "$DEBUG" -eq 0 ]; then + if [ "$DEBUG" -ne 1 ]; then # remove the temporary working directory when done printlog "Deleting $tmpDir" rm -Rf "$tmpDir" @@ -148,6 +148,7 @@ getAppVersion() { appversion="$(pkgutil --pkg-info-plist ${packageID} 2>/dev/null | grep -A 1 pkg-version | tail -1 | sed -E 's/.*>([0-9.]*)<.*/\1/g')" if [[ $appversion != "" ]]; then printlog "found packageID $packageID installed, version $appversion" + updateDetected="YES" return else printlog "No version found using packageID $packageID" @@ -162,7 +163,11 @@ getAppVersion() { else applist=$(mdfind "kind:application $appName" -0 ) fi - printlog "App(s) found: ${applist}" + if [[ -z applist ]]; then + printlog "No previous app found" + else + printlog "App(s) found: ${applist}" + fi appPathArray=( ${(0)applist} ) @@ -173,6 +178,7 @@ getAppVersion() { #appversion=$(mdls -name kMDItemVersion -raw $installedAppPath ) appversion=$(defaults read $installedAppPath/Contents/Info.plist $versionKey) #Not dependant on Spotlight indexing printlog "found app at $installedAppPath, version $appversion" + updateDetected="YES" # Is current app from App Store if [[ -d "$installedAppPath"/Contents/_MASReceipt ]];then printlog "Installed $appName is from App Store, use “IGNORE_APP_STORE_APPS=yes” to replace." @@ -192,9 +198,9 @@ getAppVersion() { } checkRunningProcesses() { - # don't check in DEBUG mode - if [[ $DEBUG -ne 0 ]]; then - printlog "DEBUG mode, not checking for blocking processes" + # don't check in DEBUG mode 1 + if [[ $DEBUG -eq 1 ]]; then + printlog "DEBUG mode 1, not checking for blocking processes" return fi @@ -299,9 +305,9 @@ reopenClosedProcess() { return fi - # don't reopen in DEBUG mode - if [[ $DEBUG -ne 0 ]]; then - printlog "DEBUG mode, not reopening anything" + # don't reopen in DEBUG mode 1 + if [[ $DEBUG -eq 1 ]]; then + printlog "DEBUG mode 1, not reopening anything" return fi @@ -342,10 +348,10 @@ installAppWithPath() { # $1: path to app to install in $targetDir # versioncheck # credit: Søren Theilgaard (@theilgaard) appNewVersion=$(defaults read $appPath/Contents/Info.plist $versionKey) - if [[ $appversion == $appNewVersion ]]; then + if [[ -n $appNewVersion && $appversion == $appNewVersion ]]; then printlog "Downloaded version of $name is $appNewVersion, same as installed." if [[ $INSTALL != "force" ]]; then - message="$name, version $appNewVersion, is the latest version." + message="$name, version $appNewVersion, is the latest version." if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then printlog "notifying" displaynotification "$message" "No update for $name!" @@ -358,37 +364,55 @@ installAppWithPath() { # $1: path to app to install in $targetDir printlog "Downloaded version of $name is $appNewVersion (replacing version $appversion)." fi - # skip install for DEBUG - if [ "$DEBUG" -ne 0 ]; then - printlog "DEBUG enabled, skipping remove, copy and chown steps" + # skip install for DEBUG 1 + if [ "$DEBUG" -eq 1 ]; then + printlog "DEBUG mode 1 enabled, skipping remove, copy and chown steps" return 0 fi - # check for root - if [ "$(whoami)" != "root" ]; then - # not running as root - cleanupAndExit 6 "not running as root, exiting" + # skip install for DEBUG 2 + if [ "$DEBUG" -eq 2 ]; then + 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" + rm -Rf "$targetDir/$appName" + fi - # remove existing application - if [ -e "$targetDir/$appName" ]; then - printlog "Removing existing $targetDir/$appName" - rm -Rf "$targetDir/$appName" - fi + # copy app to /Applications + printlog "Copy $appPath to $targetDir" + if ! ditto "$appPath" "$targetDir/$appName"; then + cleanupAndExit 7 "Error while copying" + fi - # copy app to /Applications - printlog "Copy $appPath to $targetDir" - if ! ditto "$appPath" "$targetDir/$appName"; then - cleanupAndExit 7 "Error while copying" - fi + # set ownership to current user + if [ "$currentUser" != "loginwindow" ]; then + printlog "Changing owner to $currentUser" + chown -R "$currentUser" "$targetDir/$appName" + else + printlog "No user logged in, not changing user" + fi + elif [[ ! -z $CLIInstaller ]]; then + mountname=$(dirname $appPath) + printlog "CLIInstaller exists, running installer command $mountname/$CLIInstaller $CLIArguments" #INFO - # set ownership to current user - if [ "$currentUser" != "loginwindow" ]; then - printlog "Changing owner to $currentUser" - chown -R "$currentUser" "$targetDir/$appName" - else - printlog "No user logged in, not changing user" + CLIoutput=$("$mountname/$CLIInstaller" "${CLIArguments[@]}" 2>&1) + CLIstatus=$(echo $?) + logoutput="$CLIoutput" # dedupliatelogs "$CLIoutput" + + if [ $CLIstatus -ne 0 ] ; then + cleanupAndExit 3 "Error installing $mountname/$CLIInstaller $CLIArguments error:\n$logoutput" #ERROR + else + printlog "Succesfully ran $mountname/$CLIInstaller $CLIArguments" + fi + printlog "Debugging enabled, update tool output was:\n$logoutput" #DEBUG fi } @@ -411,7 +435,6 @@ mountDMG() { installFromDMG() { mountDMG - installAppWithPath "$dmgmount/$appName" } @@ -450,7 +473,7 @@ installFromPKG() { if [[ $appversion == $appNewVersion ]]; then printlog "Downloaded version of $name is the same as installed." if [[ $INSTALL != "force" ]]; then - message="$name, version $appNewVersion, is the latest version." + message="$name, version $appNewVersion, is the latest version." if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then printlog "notifying" displaynotification "$message" "No update for $name!" @@ -462,16 +485,16 @@ installFromPKG() { fi fi - # skip install for DEBUG - if [ "$DEBUG" -ne 0 ]; then + # skip install for DEBUG 1 + if [ "$DEBUG" -eq 1 ]; then printlog "DEBUG enabled, skipping installation" return 0 fi - # check for root - if [ "$(whoami)" != "root" ]; then - # not running as root - cleanupAndExit 6 "not running as root, exiting" + # skip install for DEBUG 2 + if [ "$DEBUG" -eq 2 ]; then + printlog "DEBUG mode 2 enabled, exiting" + cleanupAndExit 0 fi # install pkg @@ -598,7 +621,7 @@ runUpdateTool() { } finishing() { - printlog "Finishing…" + printlog "Finishing..." sleep 10 # wait a moment to let spotlight catch up getAppVersion @@ -612,7 +635,11 @@ finishing() { if [[ $currentUser != "loginwindow" && ( $NOTIFY == "success" || $NOTIFY == "all" ) ]]; then printlog "notifying" - displaynotification "$message" "$name update/installation complete!" + if [[ $updateDetected == "YES" ]]; then + displaynotification "$message" "$name update complete!" + else + displaynotification "$message" "$name installation complete!" + fi fi } diff --git a/fragments/header.sh b/fragments/header.sh index 43ebb7a..7486f60 100644 --- a/fragments/header.sh +++ b/fragments/header.sh @@ -20,9 +20,11 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin # NOTE: adjust these variables: -# set to 0 for production, 1 for debugging +# 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=1 # notify behavior @@ -176,6 +178,8 @@ IGNORE_DND_APPS="" # - archiveName: (optional) # The name of the downloaded file. # When not given the archiveName is derived from the $name. +# Note: This has to be defined BEFORE calling downloadURLFromGit or +# versionFromGit functions in the label. # # - appName: (optional) # File name of the app bundle in the dmg to verify and copy (include .app). @@ -208,8 +212,27 @@ IGNORE_DND_APPS="" # $updateTool $updateArguments # Will be run instead of of downloading and installing a complete new version. # Use this when the updateTool does differential and optimized downloads. -# e.g. msupdate +# e.g. msupdate on various Microsoft labels # # - updateToolRunAsCurrentUser: # When this variable is set (any value), $updateTool will be run as the current user. # +# - CLIInstaller: +# - CLIArguments: +# If the downloaded dmg is actually 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 +# 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 +# (if it’s the same). +# We can support a whole range of other software titles by implementing this. +# See label adobecreativeclouddesktop +# +# - installerTool: +# Introduced as part of `CLIInstaller`. If the installer in the DMG or ZIP is named +# differently than the installed app, then this variable can be used to name the +# installer that should be located after mounting/expanding the downloaded archive. +# See label adobecreativeclouddesktop +# diff --git a/fragments/labels/adobecreativeclouddesktop.sh b/fragments/labels/adobecreativeclouddesktop.sh new file mode 100644 index 0000000..7445443 --- /dev/null +++ b/fragments/labels/adobecreativeclouddesktop.sh @@ -0,0 +1,17 @@ +adobecreativeclouddesktop) + name="Adobe Creative Cloud" + #appName="Install.app" + type="dmg" + if [[ $(arch) == "arm64" ]]; then + downloadURL=$(curl -fs "https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" | grep -o "https*.*macarm64.*dmg" | cut -d '"' -f1 | head -1) + elif [[ $(arch) == "i386" ]]; then + downloadURL=$(curl -fs "https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" | grep -o "https*.*osx10.*dmg" | cut -d '"' -f1 | head -1) + fi + #downloadURL=$(curl -fs "https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html" | grep -o "https*.*dmg" | head -1) + appNewVersion=$(curl -fs "https://helpx.adobe.com/creative-cloud/release-note/cc-release-notes.html" | grep "mandatory" | head -1 | grep -o "Version *.* released" | cut -d " " -f2) + installerTool="Install.app" + CLIInstaller="Install.app/Contents/MacOS/Install" + CLIArguments=(--mode=silent) + expectedTeamID="JQ525L2MZD" + Company="Adobe" + ;; diff --git a/fragments/labels/airserver.sh b/fragments/labels/airserver.sh index 8c1ede4..df3310f 100644 --- a/fragments/labels/airserver.sh +++ b/fragments/labels/airserver.sh @@ -3,6 +3,6 @@ airserver) name="AirServer" type="dmg" downloadURL="https://www.airserver.com/download/mac/latest" - #appNewVersion=$() # Cannot find version history or release notes on home page + appNewVersion=$(curl -fsIL "${downloadURL}" | grep -i "location" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') expectedTeamID="6C755KS5W3" ;; diff --git a/fragments/labels/airtame.sh b/fragments/labels/airtame.sh index bbc5dc7..13d637a 100644 --- a/fragments/labels/airtame.sh +++ b/fragments/labels/airtame.sh @@ -4,4 +4,4 @@ airtame) downloadURL="$(curl -fs https://airtame.com/download/ | grep -i platform=mac | head -1 | grep -o -i -E "https.*" | cut -d '"' -f1)" appNewVersion="$(curl -fsIL "${downloadURL}" | grep -i ^location | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g')" expectedTeamID="4TPSP88HN2" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/alephone.sh b/fragments/labels/alephone.sh new file mode 100644 index 0000000..5ad40a9 --- /dev/null +++ b/fragments/labels/alephone.sh @@ -0,0 +1,7 @@ +alephone) + name="Aleph One" + type="dmg" + downloadURL=$(downloadURLFromGit Aleph-One-Marathon alephone) + appNewVersion=$(versionFromGit Aleph-One-Marathon alephone) + expectedTeamID="E8K89CXZE7" + ;; diff --git a/fragments/labels/apparency.sh b/fragments/labels/apparency.sh index 6ca5afb..32bf6f9 100644 --- a/fragments/labels/apparency.sh +++ b/fragments/labels/apparency.sh @@ -2,5 +2,6 @@ apparency) name="Apparency" type="dmg" downloadURL="https://www.mothersruin.com/software/downloads/Apparency.dmg" + appNewVersion=$(curl -fs https://mothersruin.com/software/Apparency/data/ApparencyVersionInfo.plist | grep -A1 CFBundleShortVersionString | tail -1 | sed -E 's/.*>([0-9.]*)<.*/\1/g') expectedTeamID="936EB786NH" ;; diff --git a/fragments/labels/applenyfonts.sh b/fragments/labels/applenyfonts.sh index f671819..16c7185 100644 --- a/fragments/labels/applenyfonts.sh +++ b/fragments/labels/applenyfonts.sh @@ -4,4 +4,4 @@ applenyfonts) downloadURL="https://devimages-cdn.apple.com/design/resources/download/NY.dmg" packageID="com.apple.pkg.NYFonts" expectedTeamID="Development Update" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/applesfcompact.sh b/fragments/labels/applesfcompact.sh index f174053..aef7977 100644 --- a/fragments/labels/applesfcompact.sh +++ b/fragments/labels/applesfcompact.sh @@ -4,4 +4,4 @@ applesfcompact) downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg" packageID="com.apple.pkg.SanFranciscoCompact" expectedTeamID="Development Update" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/applesfmono.sh b/fragments/labels/applesfmono.sh index 29233f1..46c32a7 100644 --- a/fragments/labels/applesfmono.sh +++ b/fragments/labels/applesfmono.sh @@ -4,4 +4,4 @@ applesfmono) downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg" packageID="com.apple.pkg.SFMonoFonts" expectedTeamID="Software Update" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/applesfpro.sh b/fragments/labels/applesfpro.sh index 9ba2628..9d76895 100644 --- a/fragments/labels/applesfpro.sh +++ b/fragments/labels/applesfpro.sh @@ -4,4 +4,4 @@ applesfpro) downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg" packageID="com.apple.pkg.SanFranciscoPro" expectedTeamID="Development Update" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/applesfsymbols.sh b/fragments/labels/applesfsymbols.sh index f90150b..b4f2764 100644 --- a/fragments/labels/applesfsymbols.sh +++ b/fragments/labels/applesfsymbols.sh @@ -2,6 +2,7 @@ applesfsymbols|\ sfsymbols) name="SF Symbols" type="pkgInDmg" - downloadURL="https://developer.apple.com/design/downloads/SF-Symbols.dmg" + 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') expectedTeamID="Software Update" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/audacity.sh b/fragments/labels/audacity.sh index 89c17fe..a5868d3 100644 --- a/fragments/labels/audacity.sh +++ b/fragments/labels/audacity.sh @@ -1,8 +1,7 @@ audacity) - # credit: Gabe Marchan (gabemarchan.com - @darklink87) name="Audacity" type="dmg" downloadURL=$(downloadURLFromGit audacity audacity) appNewVersion=$(versionFromGit audacity audacity) - expectedTeamID="T3N4JQ7YY6" + expectedTeamID="AWEYX923UX" ;; diff --git a/fragments/labels/blender.sh b/fragments/labels/blender.sh index 3a822ef..f45255e 100644 --- a/fragments/labels/blender.sh +++ b/fragments/labels/blender.sh @@ -1,7 +1,7 @@ blender) name="blender" type="dmg" - downloadURL=$(redirect=$(curl -sfL https://www.blender.org/download/ | sed 's/.*href="//' | sed 's/".*//' | grep .dmg) && curl -sfL "$redirect" | sed 's/.*href="//' | sed 's/".*//' | grep .dmg) + downloadURL=$(redirect=$(curl -sfL https://www.blender.org/download/ | sed 's/.*href="//' | sed 's/".*//' | grep .dmg) && curl -sfL "$redirect" | sed 's/.*href="//' | sed 's/".*//' | grep -m1 .dmg) appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)-.*/\1/g' ) expectedTeamID="68UA947AUU" ;; diff --git a/fragments/labels/bluejeans.sh b/fragments/labels/bluejeans.sh index d3d878a..9dc77dd 100644 --- a/fragments/labels/bluejeans.sh +++ b/fragments/labels/bluejeans.sh @@ -2,7 +2,7 @@ bluejeans) name="BlueJeans" type="pkg" if [[ $(arch) == "arm64" ]]; then - downloadURL=$(curl -fs "https://www.bluejeans.com/downloads" | xmllint --html --format - 2>/dev/null | grep -o "https://.*BlueJeansInstaller.*arm.*.pkg" ) + downloadURL=$(curl -fs "https://www.bluejeans.com/downloads" | xmllint --html --format - 2>/dev/null | grep -o "https://.*BlueJeans.*Installer.*arm.*.pkg" ) elif [[ $(arch) == "i386" ]]; then downloadURL=$(curl -fs "https://www.bluejeans.com/downloads" | xmllint --html --format - 2>/dev/null | grep -o "https://.*BlueJeansInstaller.*x86.*.dmg" | sed 's/dmg/pkg/g') fi diff --git a/fragments/labels/boxsync.sh b/fragments/labels/boxsync.sh index 9962e3f..b6df054 100644 --- a/fragments/labels/boxsync.sh +++ b/fragments/labels/boxsync.sh @@ -3,4 +3,4 @@ boxsync) type="dmg" downloadURL="https://e3.boxcdn.net/box-installers/sync/Sync+4+External/Box%20Sync%20Installer.dmg" expectedTeamID="M683GB7CPW" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/boxtools.sh b/fragments/labels/boxtools.sh index 2963c68..11690f5 100644 --- a/fragments/labels/boxtools.sh +++ b/fragments/labels/boxtools.sh @@ -3,4 +3,4 @@ boxtools) type="pkg" downloadURL="https://box-installers.s3.amazonaws.com/boxedit/mac/currentrelease/BoxToolsInstaller.pkg" expectedTeamID="M683GB7CPW" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/bugdom.sh b/fragments/labels/bugdom.sh new file mode 100644 index 0000000..106b3e5 --- /dev/null +++ b/fragments/labels/bugdom.sh @@ -0,0 +1,7 @@ +bugdom) + name="Bugdom" + type="dmg" + downloadURL=$(downloadURLFromGit jorio Bugdom) + appNewVersion=$(versionFromGit jorio Bugdom) + expectedTeamID="RVNL7XC27G" + ;; diff --git a/fragments/labels/camostudio.sh b/fragments/labels/camostudio.sh index 71b2646..8006c3b 100644 --- a/fragments/labels/camostudio.sh +++ b/fragments/labels/camostudio.sh @@ -1,8 +1,9 @@ camostudio) - # credit: Søren Theilgaard (@theilgaard) name="Camo Studio" type="zip" downloadURL="https://reincubate.com/res/labs/camo/camo-macos-latest.zip" - appNewVersion=$(curl -s -L https://reincubate.com/support/camo/release-notes/ | grep -m2 "has-m-t-0" | head -1 | cut -d ">" -f2 | cut -d " " -f1) + #appNewVersion=$(curl -s -L https://reincubate.com/support/camo/release-notes/ | grep -m2 "has-m-t-0" | head -1 | cut -d ">" -f2 | cut -d " " -f1) + appNewVersion=$( curl -fs "https://uds.reincubate.com/release-notes/camo/" | head -1 | cut -d "," -f3 | grep -o -e "[0-9.]*" ) + # Camo Studio will ask for admin permissions to install som plug-ins. that has not been handled. expectedTeamID="Q248YREB53" ;; diff --git a/fragments/labels/canva.sh b/fragments/labels/canva.sh new file mode 100644 index 0000000..f399d77 --- /dev/null +++ b/fragments/labels/canva.sh @@ -0,0 +1,11 @@ +canva) + name="Canva" + type="dmg" + if [[ $(arch) == "arm64" ]]; then + downloadURL=$(curl -fsLI -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 "accept-encoding: gzip, deflate, br" -H "accept-language: en-US,en;q=0.9" -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 "sec-fetch-mode: navigate" -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" "https://www.canva.com/download/mac/arm/canva-desktop/" | grep -i "^location" | cut -d " " -f2 | tr -d '\r') + elif [[ $(arch) == "i386" ]]; then + downloadURL=$(curl -fsLI -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" "https://www.canva.com/download/mac/intel/canva-desktop/" | grep -i "^location" | cut -d " " -f2 | tr -d '\r') + fi + appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g' ) + expectedTeamID="5HD2ARTBFS" + ;; diff --git a/fragments/labels/chatwork.sh b/fragments/labels/chatwork.sh new file mode 100644 index 0000000..f8fb708 --- /dev/null +++ b/fragments/labels/chatwork.sh @@ -0,0 +1,6 @@ +chatwork) + name="Chatwork" + type="dmg" + downloadURL="https://desktop-app.chatwork.com/installer/Chatwork.dmg" + expectedTeamID="H34A3H2Y54" + ;; diff --git a/fragments/labels/cisdem-documentreader.sh b/fragments/labels/cisdem-documentreader.sh index f8cf75c..f57b72a 100644 --- a/fragments/labels/cisdem-documentreader.sh +++ b/fragments/labels/cisdem-documentreader.sh @@ -4,4 +4,4 @@ cisdem-documentreader) downloadURL="https://download.cisdem.com/cisdem-documentreader.dmg" expectedTeamID="5HGV8EX6BQ" appName="Cisdem Document Reader.app" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/clevershare2.sh b/fragments/labels/clevershare2.sh index 1a7bb90..452ffde 100644 --- a/fragments/labels/clevershare2.sh +++ b/fragments/labels/clevershare2.sh @@ -4,4 +4,4 @@ clevershare2) downloadURL=$(curl -fs https://www.clevertouch.com/eu/clevershare2g | grep -i -o -E "https.*Mac.*\.dmg") appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z-]*_Mac\.([0-9.]*)\.[0-9]*\.dmg$/\1/g' ) expectedTeamID="P76M9BE8DQ" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/closeio.sh b/fragments/labels/closeio.sh new file mode 100644 index 0000000..577f0ef --- /dev/null +++ b/fragments/labels/closeio.sh @@ -0,0 +1,7 @@ +closeio) + name="Close.io" + type="dmg" + downloadURL=$(downloadURLFromGit closeio closeio-desktop-releases) + appNewVersion=$(versionFromGit closeio closeio-desktop-releases) + expectedTeamID="WTNQ6773UC" + ;; diff --git a/fragments/labels/cloudya.sh b/fragments/labels/cloudya.sh new file mode 100644 index 0000000..8d087d4 --- /dev/null +++ b/fragments/labels/cloudya.sh @@ -0,0 +1,7 @@ +cloudya) + name="Cloudya" + type="appInDmgInZip" + downloadURL="$(curl -fs https://www.nfon.com/de/service/downloads | grep -i -E -o "https://cdn.cloudya.com/Cloudya-[.0-9]+-mac.zip")" + appNewVersion="$(curl -fs https://www.nfon.com/de/service/downloads | grep -i -E -o "Cloudya Desktop App MAC [0-9.]*" | sed 's/^.*\ \([^ ]\{0,7\}\)$/\1/g')" + expectedTeamID="X26F74J8TH" + ;; diff --git a/fragments/labels/colourcontrastanalyser.sh b/fragments/labels/colourcontrastanalyser.sh index 613ccba..086569c 100644 --- a/fragments/labels/colourcontrastanalyser.sh +++ b/fragments/labels/colourcontrastanalyser.sh @@ -5,4 +5,4 @@ colourcontrastanalyser) appNewVersion=$(versionFromGit ThePacielloGroup CCAe) expectedTeamID="34RS4UC3M6" blockingProcesses=( NONE ) - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/craftmanager.sh b/fragments/labels/craftmanager.sh index 6906ad6..6bf89d8 100644 --- a/fragments/labels/craftmanager.sh +++ b/fragments/labels/craftmanager.sh @@ -5,4 +5,4 @@ craftmanager) downloadURL="$(curl -fs https://craft-assets.invisionapp.com/CraftManager/production/appcast.xml | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)" appNewVersion="$(curl -fs https://craft-assets.invisionapp.com/CraftManager/production/appcast.xml | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2)" expectedTeamID="VRXQSNCL5W" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/dialog.sh b/fragments/labels/dialog.sh new file mode 100644 index 0000000..5925db1 --- /dev/null +++ b/fragments/labels/dialog.sh @@ -0,0 +1,8 @@ +dialog) + name="Dialog" + type="pkg" + packageID="au.csiro.dialogcli" + downloadURL="$(downloadURLFromGit bartreardon Dialog)" + appNewVersion="$(versionFromGit bartreardon Dialog)" + expectedTeamID="PWA5E9TQ59" + ;; diff --git a/fragments/labels/eshareosx.sh b/fragments/labels/eshareosx.sh new file mode 100644 index 0000000..d46b9b8 --- /dev/null +++ b/fragments/labels/eshareosx.sh @@ -0,0 +1,9 @@ +eshareosx) + name="e-Share" + type="pkg" + packageID="com.ncryptedcloud.e-Share.pkg" + downloadURL=https://www.ncryptedcloud.com/static/downloads/osx/$(curl -fs https://www.ncryptedcloud.com/static/downloads/osx/ | grep -o -i "href.*\".*\"" | cut -d '"' -f2) + versionKey="CFBundleVersion" + appNewVersion=$( echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z\-]*_([0-9.]*)\.pkg/\1/g' ) + expectedTeamID="X9MBQS7DDC" + ;; diff --git a/fragments/labels/exifrenamer.sh b/fragments/labels/exifrenamer.sh new file mode 100644 index 0000000..588591b --- /dev/null +++ b/fragments/labels/exifrenamer.sh @@ -0,0 +1,7 @@ +exifrenamer) + name="ExifRenamer" + type="dmg" + downloadURL="https://www.qdev.de/"$(curl -fs "https://www.qdev.de/download.php?file=ExifRenamer.dmg" | grep -o -e "URL=[a-zA-Z/]*.dmg" | cut -d "=" -f2) + appNewVersion=$(curl -fs "https://www.qdev.de/?location=downloads" | grep -A1 -m1 "ExifRenamer" | tail -1 | cut -d ">" -f2 | cut -d " " -f1) + expectedTeamID="MLF9FE35AM" + ;; diff --git a/fragments/labels/fastscripts.sh b/fragments/labels/fastscripts.sh new file mode 100644 index 0000000..e75144d --- /dev/null +++ b/fragments/labels/fastscripts.sh @@ -0,0 +1,7 @@ +fastscripts) + name="FastScripts" + type="zip" + downloadURL=$( curl -fs "https://redsweater.com/fastscripts/appcast3.php" | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | cut -d '"' -f2 ) + appNewVersion=$( curl -fs "https://redsweater.com/fastscripts/appcast3.php" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | cut -d '"' -f2 ) + expectedTeamID="493CVA9A35" + ;; diff --git a/fragments/labels/findanyfile.sh b/fragments/labels/findanyfile.sh new file mode 100644 index 0000000..2061ac0 --- /dev/null +++ b/fragments/labels/findanyfile.sh @@ -0,0 +1,7 @@ +findanyfile) + name="Find Any File" + type="zip" + downloadURL=$(curl -fs "https://findanyfile.app/appcast2.php" | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | cut -d '"' -f2) + appNewVersion=$(curl -fs "https://findanyfile.app/appcast2.php" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | cut -d '"' -f2) + expectedTeamID="25856V4B4X" + ;; diff --git a/fragments/labels/firefox.sh b/fragments/labels/firefox.sh index 1983242..5bfdaef 100644 --- a/fragments/labels/firefox.sh +++ b/fragments/labels/firefox.sh @@ -2,7 +2,7 @@ firefox) name="Firefox" type="dmg" downloadURL="https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" - appNewVersion=$(/usr/bin/curl https://www.mozilla.org/en-US/firefox/releases/ --silent | /usr/bin/grep '<html' | /usr/bin/awk -F\" '{ print $8 }') # Credit: William Smith (@meck) + appNewVersion=$(curl -fs https://www.mozilla.org/en-US/firefox/releases/ | grep '<html' | grep -o -i -e "data-latest-firefox=\"[0-9.]*\"" | cut -d '"' -f2) expectedTeamID="43AQ936H96" blockingProcesses=( firefox ) ;; diff --git a/fragments/labels/firefox_da.sh b/fragments/labels/firefox_da.sh index a7b89e0..671cdc9 100644 --- a/fragments/labels/firefox_da.sh +++ b/fragments/labels/firefox_da.sh @@ -2,7 +2,7 @@ firefox_da) name="Firefox" type="dmg" downloadURL="https://download.mozilla.org/?product=firefox-latest&os=osx&lang=da" - appNewVersion=$(/usr/bin/curl https://www.mozilla.org/en-US/firefox/releases/ --silent | /usr/bin/grep '<html' | /usr/bin/awk -F\" '{ print $8 }') # Credit: William Smith (@meck) + appNewVersion=$(curl -fs https://www.mozilla.org/en-US/firefox/releases/ | grep '<html' | grep -o -i -e "data-latest-firefox=\"[0-9.]*\"" | cut -d '"' -f2) expectedTeamID="43AQ936H96" blockingProcesses=( firefox ) ;; diff --git a/fragments/labels/firefox_intl.sh b/fragments/labels/firefox_intl.sh index 2ff94a8..0218c04 100644 --- a/fragments/labels/firefox_intl.sh +++ b/fragments/labels/firefox_intl.sh @@ -17,7 +17,7 @@ firefox_intl) printlog "Download not found for that language. Using en-US" downloadURL="https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" fi - appNewVersion=$(/usr/bin/curl -sl https://www.mozilla.org/en-US/firefox/releases/ | /usr/bin/grep '<html' | /usr/bin/awk -F\" '{ print $8 }') # Credit: William Smith (@meck) + appNewVersion=$(curl -fs https://www.mozilla.org/en-US/firefox/releases/ | grep '<html' | grep -o -i -e "data-latest-firefox=\"[0-9.]*\"" | cut -d '"' -f2) expectedTeamID="43AQ936H96" blockingProcesses=( firefox ) ;; diff --git a/fragments/labels/flowjo.sh b/fragments/labels/flowjo.sh index 6ddb9b1..b713914 100644 --- a/fragments/labels/flowjo.sh +++ b/fragments/labels/flowjo.sh @@ -5,4 +5,4 @@ flowjo) appNewVersion=$(echo "${downloadURL}" | tr "-" "\n" | grep dmg | sed -E 's/([0-9.]*)\.dmg/\1/g') expectedTeamID="C79HU5AD9V" appName="FlowJo.app" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/inkscape.sh b/fragments/labels/inkscape.sh index 45f283f..41c91a5 100644 --- a/fragments/labels/inkscape.sh +++ b/fragments/labels/inkscape.sh @@ -2,7 +2,8 @@ inkscape) # credit: Søren Theilgaard (@theilgaard) name="Inkscape" type="dmg" - downloadURL="https://inkscape.org$(curl -fs https://inkscape.org$(curl -fsJL https://inkscape.org/release/ | grep "/release/" | grep en | head -n 1 | cut -d '"' -f 6)mac-os-x/1010-1015/dl/ | grep "click here" | cut -d '"' -f 2)" - #appNewVersion=$(curl -fsJL https://inkscape.org/release/ | grep "<h2>Inkscape" | cut -d '>' -f 3 | cut -d '<' -f 1 | sed 's/[^0-9.]*//g') # Can't figure out where exact new version is found. Currently returns 1.0, but version is "1.0.0 (4035a4f)" + downloadURL="https://inkscape.org$(curl -fs https://inkscape.org$(curl -fsJL https://inkscape.org/release/ | grep "/release/" | grep en | head -n 1 | cut -d '"' -f 6)mac-os-x/dmg/dl/ | grep "click here" | cut -d '"' -f 2)" + appCustomVersion() { /Applications/Inkscape.app/Contents/MacOS/inkscape --version | cut -d " " -f2 } + appNewVersion=$(curl -fsJL https://inkscape.org/release/ | grep "<title>" | grep -o -e "[0-9.]*") expectedTeamID="SW3D6BB6A6" ;; diff --git a/fragments/labels/insomnia.sh b/fragments/labels/insomnia.sh index 6d8922a..9de4706 100644 --- a/fragments/labels/insomnia.sh +++ b/fragments/labels/insomnia.sh @@ -4,4 +4,4 @@ insomnia) downloadURL=$(downloadURLFromGit kong insomnia) appNewVersion=$(versionFromGit kong insomnia) expectedTeamID="FX44YY62GV" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/installomator.sh b/fragments/labels/installomator.sh new file mode 100644 index 0000000..f6d51b0 --- /dev/null +++ b/fragments/labels/installomator.sh @@ -0,0 +1,10 @@ +installomator|\ +installomator_theile) + name="Installomator" + type="pkg" + packageID="com.scriptingosx.Installomator" + downloadURL=$(downloadURLFromGit Installomator Installomator ) + appNewVersion=$(versionFromGit Installomator Installomator ) + expectedTeamID="JME5BW3F3R" + blockingProcesses=( NONE ) + ;; diff --git a/fragments/labels/installomator_theile.sh b/fragments/labels/installomator_theile.sh deleted file mode 100644 index e531055..0000000 --- a/fragments/labels/installomator_theile.sh +++ /dev/null @@ -1,11 +0,0 @@ -installomator_theile) - # credit: Søren Theilgaard (@theilgaard) - name="Installomator" - type="pkg" - packageID="dk.theilgaard.pkg.Installomator" - downloadURL=$(downloadURLFromGit theile Installomator ) - appNewVersion=$(versionFromGit theile Installomator ) - #appCustomVersion(){/usr/local/bin/Installomator.sh version | tail -1 | awk '{print $4}'} - expectedTeamID="FXW6QXBFW5" - blockingProcesses=( NONE ) - ;; diff --git a/fragments/labels/jabradirect.sh b/fragments/labels/jabradirect.sh index ce025ea..4359ac6 100644 --- a/fragments/labels/jabradirect.sh +++ b/fragments/labels/jabradirect.sh @@ -1,7 +1,8 @@ jabradirect) name="Jabra Direct" - type="dmg" + type="pkgInDmg" + packageID="com.jabra.directonline" downloadURL="https://jabraxpressonlineprdstor.blob.core.windows.net/jdo/JabraDirectSetup.dmg" + appNewVersion=$(curl -fs https://www.jabra.com/Support/release-notes/release-note-jabra-direct | grep -oe "Release version:.*[0-9.]*<" | head -1 | cut -d ">" -f2 | cut -d "<" -f1 | sed 's/ //g') expectedTeamID="55LV32M29R" - appNewVersion=$(curl -fs https://www.jabra.com/Support/release-notes/release-note-jabra-direct | grep -o "Jabra Direct macOS:*.*<" | head -1 | cut -d ":" -f2 | cut -d " " -f2 | cut -d "<" -f1) ;; diff --git a/fragments/labels/jamfconnectconfiguration.sh b/fragments/labels/jamfconnectconfiguration.sh new file mode 100644 index 0000000..7237f2e --- /dev/null +++ b/fragments/labels/jamfconnectconfiguration.sh @@ -0,0 +1,6 @@ +jamfconnectconfiguration) + name="Jamf Connect Configuration" + type="dmg" + downloadURL="https://files.jamfconnect.com/JamfConnect.dmg" + expectedTeamID="483DWKW443" + ;; diff --git a/fragments/labels/jetbrainsclion.sh b/fragments/labels/jetbrainsclion.sh new file mode 100644 index 0000000..5a193a4 --- /dev/null +++ b/fragments/labels/jetbrainsclion.sh @@ -0,0 +1,12 @@ +jetbrainsclion) + name="CLion" + type="dmg" + jetbrainscode="CL" + jetbrainsdistribution="mac" + if [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) + expectedTeamID="2ZEFAR8TH3" + ;; diff --git a/fragments/labels/jetbrainsdatagrip.sh b/fragments/labels/jetbrainsdatagrip.sh index 87a77f3..adb8dba 100644 --- a/fragments/labels/jetbrainsdatagrip.sh +++ b/fragments/labels/jetbrainsdatagrip.sh @@ -1,11 +1,13 @@ jetbrainsdatagrip) name="DataGrip" type="dmg" - appNewVersion=$(curl -fs "https://data.services.jetbrains.com/products/releases?code=DG&latest=true&type=release" | grep -o 'version*.*,' | cut -d '"' -f3) - if [[ $(arch) == "arm64" ]]; then - downloadURL=$(curl -fs "https://data.services.jetbrains.com/products/releases?code=DG&latest=true&type=release" | grep -o 'macM1*.*,' | cut -d '"' -f5) - elif [[ $(arch) == "i386" ]]; then - downloadURL=$(curl -fs "https://data.services.jetbrains.com/products/releases?code=DG&latest=true&type=release" | grep -o 'mac*.*,' | cut -d '"' -f5) + jetbrainscode="DG" + if [[ $(arch) == i386 ]]; then + jetbrainsdistribution="mac" + elif [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) expectedTeamID="2ZEFAR8TH3" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/jetbrainsintellijidea.sh b/fragments/labels/jetbrainsintellijidea.sh index 233eda9..262298b 100644 --- a/fragments/labels/jetbrainsintellijidea.sh +++ b/fragments/labels/jetbrainsintellijidea.sh @@ -1,7 +1,13 @@ jetbrainsintellijidea) name="IntelliJ IDEA" type="dmg" - downloadURL="https://download.jetbrains.com/product?code=II&latest&distribution=mac" + jetbrainscode="II" + if [[ $(arch) == i386 ]]; then + jetbrainsdistribution="mac" + elif [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) expectedTeamID="2ZEFAR8TH3" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/jetbrainsintellijideace.sh b/fragments/labels/jetbrainsintellijideace.sh index 7675050..3beb6fd 100644 --- a/fragments/labels/jetbrainsintellijideace.sh +++ b/fragments/labels/jetbrainsintellijideace.sh @@ -2,7 +2,13 @@ jetbrainsintellijideace|\ intellijideace) name="IntelliJ IDEA CE" type="dmg" - downloadURL="https://download.jetbrains.com/product?code=IIC&latest&distribution=mac" + jetbrainscode="IIC" + if [[ $(arch) == i386 ]]; then + jetbrainsdistribution="mac" + elif [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) expectedTeamID="2ZEFAR8TH3" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/jetbrainsphpstorm.sh b/fragments/labels/jetbrainsphpstorm.sh index 98e7773..1a21310 100644 --- a/fragments/labels/jetbrainsphpstorm.sh +++ b/fragments/labels/jetbrainsphpstorm.sh @@ -1,7 +1,13 @@ jetbrainsphpstorm) name="PHPStorm" type="dmg" - downloadURL="https://download.jetbrains.com/product?code=PS&latest&distribution=mac" + jetbrainscode="PS" + if [[ $(arch) == i386 ]]; then + jetbrainsdistribution="mac" + elif [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) expectedTeamID="2ZEFAR8TH3" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/jetbrainspycharm.sh b/fragments/labels/jetbrainspycharm.sh index 18670a1..ca99389 100644 --- a/fragments/labels/jetbrainspycharm.sh +++ b/fragments/labels/jetbrainspycharm.sh @@ -2,11 +2,12 @@ jetbrainspycharm) # This is the Pro version of PyCharm. Do not confuse with PyCharm CE. name="PyCharm" type="dmg" - if [[ $(arch) == i386 ]]; then - downloadURL="https://download.jetbrains.com/product?code=PCP&latest&distribution=mac" - elif [[ $(arch) == arm64 ]]; then - downloadURL="https://download.jetbrains.com/product?code=PCP&latest&distribution=macM1" + jetbrainscode="PCP" + jetbrainsdistribution="mac" + if [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) expectedTeamID="2ZEFAR8TH3" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/jetbrainspycharmce.sh b/fragments/labels/jetbrainspycharmce.sh index 8d738a1..c571ebf 100644 --- a/fragments/labels/jetbrainspycharmce.sh +++ b/fragments/labels/jetbrainspycharmce.sh @@ -2,11 +2,12 @@ jetbrainspycharmce|\ pycharmce) name="PyCharm CE" type="dmg" - if [[ $(arch) == i386 ]]; then - downloadURL="https://download.jetbrains.com/product?code=PCC&latest&distribution=mac" - elif [[ $(arch) == arm64 ]]; then - downloadURL="https://download.jetbrains.com/product?code=PCC&latest&distribution=macM1" + jetbrainscode="PCC" + jetbrainsdistribution="mac" + if [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) expectedTeamID="2ZEFAR8TH3" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/jetbrainsrubymine.sh b/fragments/labels/jetbrainsrubymine.sh new file mode 100644 index 0000000..cd140e2 --- /dev/null +++ b/fragments/labels/jetbrainsrubymine.sh @@ -0,0 +1,13 @@ +jetbrainsrubymine) + name="RubyMine" + type="dmg" + jetbrainscode="RM" + if [[ $(arch) == i386 ]]; then + jetbrainsdistribution="mac" + elif [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) + expectedTeamID="2ZEFAR8TH3" + ;; diff --git a/fragments/labels/jetbrainstoolbox.sh b/fragments/labels/jetbrainstoolbox.sh index 16bef78..8bc695c 100644 --- a/fragments/labels/jetbrainstoolbox.sh +++ b/fragments/labels/jetbrainstoolbox.sh @@ -1,11 +1,12 @@ jetbrainstoolbox) name="JetBrains Toolbox" type="dmg" - if [[ $(arch) == i386 ]]; then - downloadURL="https://download.jetbrains.com/product?code=TB&latest&distribution=mac" - elif [[ $(arch) == arm64 ]]; then - downloadURL="https://download.jetbrains.com/product?code=TB&latest&distribution=macM1" + jetbrainscode="TBA" + jetbrainsdistribution="mac" + if [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) expectedTeamID="2ZEFAR8TH3" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/jetbrainswebstorm.sh b/fragments/labels/jetbrainswebstorm.sh new file mode 100644 index 0000000..c92caab --- /dev/null +++ b/fragments/labels/jetbrainswebstorm.sh @@ -0,0 +1,12 @@ +jetbrainswebstorm) + name="Webstorm" + type="dmg" + jetbrainscode="WS" + jetbrainsdistribution="mac" + if [[ $(arch) == arm64 ]]; then + jetbrainsdistribution="macM1" + fi + downloadURL="https://download.jetbrains.com/product?code=${jetbrainscode}&latest&distribution=${jetbrainsdistribution}" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "location" | tail -1 | sed -E 's/.*\/[a-zA-Z-]*-([0-9.]*).*[-.].*dmg/\1/g' ) + expectedTeamID="2ZEFAR8TH3" + ;; diff --git a/fragments/labels/lexarrecoverytool.sh b/fragments/labels/lexarrecoverytool.sh index 82816e8..f5c9345 100644 --- a/fragments/labels/lexarrecoverytool.sh +++ b/fragments/labels/lexarrecoverytool.sh @@ -1,8 +1,6 @@ lexarrecoverytool) - # credit: Søren Theilgaard (@theilgaard) name="Lexar Recovery Tool" type="appInDmgInZip" - downloadURL="https://www.lexar.com$( curl -fs "https://www.lexar.com/support/downloads/" | grep -i "mac" | grep -i "recovery" | head -1 | tr '"' '\n' | grep -i ".zip" )" - #appNewVersion="" + downloadURL="https://www.lexar.com/wp-content/uploads/product_images/Lexar-Recovery-Tool-Mac.zip" expectedTeamID="Y8HM6WR2DV" ;; diff --git a/fragments/labels/logitechoptions.sh b/fragments/labels/logitechoptions.sh index bcb32a6..48409a0 100644 --- a/fragments/labels/logitechoptions.sh +++ b/fragments/labels/logitechoptions.sh @@ -3,7 +3,7 @@ logitechoptions) 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/' ) + #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" expectedTeamID="QED4VVPZWA" ;; diff --git a/fragments/labels/logseq.sh b/fragments/labels/logseq.sh new file mode 100644 index 0000000..d51caff --- /dev/null +++ b/fragments/labels/logseq.sh @@ -0,0 +1,13 @@ +logseq) + name="Logseq" + type="dmg" + if [[ $(arch) == "arm64" ]]; then + archiveName="darwin-arm64-[0-9.]*.dmg" + downloadURL=$(downloadURLFromGit logseq logseq) + elif [[ $(arch) == "i386" ]]; then + archiveName="darwin-x64-[0-9.]*.dmg" + downloadURL=$(downloadURLFromGit logseq logseq) + fi + appNewVersion=$(versionFromGit logseq logseq) + expectedTeamID="3K44EUN829" + ;; diff --git a/fragments/labels/maccyapp.sh b/fragments/labels/maccyapp.sh new file mode 100644 index 0000000..7ea7be4 --- /dev/null +++ b/fragments/labels/maccyapp.sh @@ -0,0 +1,7 @@ +maccyapp) + name="Maccy" + type="zip" + downloadURL="$(downloadURLFromGit p0deje Maccy)" + appNewVersion="$(versionFromGit p0deje Maccy)" + expectedTeamID="MN3X4648SC" + ;; diff --git a/fragments/labels/macports.sh b/fragments/labels/macports.sh new file mode 100644 index 0000000..6a473a1 --- /dev/null +++ b/fragments/labels/macports.sh @@ -0,0 +1,23 @@ +macports) + name="MacPorts" + type="pkg" + #buildVersion=$(uname -r | cut -d '.' -f 1) + case $(uname -r | cut -d '.' -f 1) in + 21) + archiveName="Monterey.pkg" + ;; + 20) + archiveName="BigSur.pkg" + ;; + 19) + archiveName="Catalina.pkg" + ;; + *) + cleanupAndExit 1 "macOS 10.14 or earlier not supported by Installomator." + ;; + esac + downloadURL=$(downloadURLFromGit macports macports-base) + appNewVersion=$(versionFromGit macports macports-base) + appCustomVersion(){ if [ -x /opt/local/bin/port ]; then /opt/local/bin/port version | awk '{print $2}'; else "0"; fi } + expectedTeamID="QTA3A3B7F3" + ;; diff --git a/fragments/labels/marathon.sh b/fragments/labels/marathon.sh new file mode 100644 index 0000000..75f5799 --- /dev/null +++ b/fragments/labels/marathon.sh @@ -0,0 +1,8 @@ +marathon) + name="Marathon" + type="dmg" + archiveName="Marathon-[0-9.]*-Mac.dmg" + downloadURL="$(downloadURLFromGit Aleph-One-Marathon alephone)" + appNewVersion="$(versionFromGit Aleph-One-Marathon alephone)" + expectedTeamID="E8K89CXZE7" + ;; diff --git a/fragments/labels/marathon2.sh b/fragments/labels/marathon2.sh new file mode 100644 index 0000000..02440fa --- /dev/null +++ b/fragments/labels/marathon2.sh @@ -0,0 +1,8 @@ +marathon2) + name="Marathon 2" + type="dmg" + archiveName="Marathon2-[0-9.]*-Mac.dmg" + downloadURL="$(downloadURLFromGit Aleph-One-Marathon alephone)" + appNewVersion="$(versionFromGit Aleph-One-Marathon alephone)" + expectedTeamID="E8K89CXZE7" + ;; diff --git a/fragments/labels/marathoninfinity.sh b/fragments/labels/marathoninfinity.sh new file mode 100644 index 0000000..a9b5165 --- /dev/null +++ b/fragments/labels/marathoninfinity.sh @@ -0,0 +1,8 @@ +marathoninfinity) + name="Marathon Infinity" + type="dmg" + archiveName="MarathonInfinity-[0-9.]*-Mac.dmg" + downloadURL="$(downloadURLFromGit Aleph-One-Marathon alephone)" + appNewVersion="$(versionFromGit Aleph-One-Marathon alephone)" + expectedTeamID="E8K89CXZE7" + ;; diff --git a/fragments/labels/mattermost.sh b/fragments/labels/mattermost.sh index 86cd707..532a436 100644 --- a/fragments/labels/mattermost.sh +++ b/fragments/labels/mattermost.sh @@ -1,12 +1,9 @@ mattermost) name="Mattermost" type="dmg" - if [[ $(arch) == i386 ]]; then - archiveName="mac.dmg" - elif [[ $(arch) == arm64 ]]; then - archiveName="mac-m1.dmg" - fi + archiveName="mac-universal.dmg" downloadURL=$(downloadURLFromGit mattermost desktop) appNewVersion=$(versionFromGit mattermost desktop ) expectedTeamID="UQ8HT4Q2XM" + Mattermost Helper (Renderer).app app.asar ;; diff --git a/fragments/labels/microsoftcompanyportal.sh b/fragments/labels/microsoftcompanyportal.sh index 0676dc5..a75b495 100644 --- a/fragments/labels/microsoftcompanyportal.sh +++ b/fragments/labels/microsoftcompanyportal.sh @@ -5,6 +5,10 @@ microsoftcompanyportal) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.intunecompanyportal.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/CompanyPortal_.*pkg" | cut -d "_" -f 2 | cut -d "-" -f 1) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps IMCP01 ) ;; diff --git a/fragments/labels/microsoftdefenderatp.sh b/fragments/labels/microsoftdefenderatp.sh index 4358408..c73c090 100644 --- a/fragments/labels/microsoftdefenderatp.sh +++ b/fragments/labels/microsoftdefenderatp.sh @@ -5,6 +5,10 @@ microsoftdefenderatp) appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.defender.standalone"]/version' 2>/dev/null | sed -E 's/<version>([0-9.]*) .*/\1/') # No version number in download url expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps WDAV00 ) ;; diff --git a/fragments/labels/microsoftedge.sh b/fragments/labels/microsoftedge.sh index bc40bb3..46f726a 100644 --- a/fragments/labels/microsoftedge.sh +++ b/fragments/labels/microsoftedge.sh @@ -1,11 +1,16 @@ microsoftedge|\ -microsoftedgeconsumerstable) +microsoftedgeconsumerstable|\ +microsoftedgeenterprisestable) name="Microsoft Edge" type="pkg" - downloadURL="https://go.microsoft.com/fwlink/?linkid=2069148" + downloadURL="https://go.microsoft.com/fwlink/?linkid=2093504" #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.edge"]/cfbundleversion' 2>/dev/null | sed -E 's/<cfbundleversion>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/MicrosoftEdge.*pkg" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps EDGE01 ) ;; diff --git a/fragments/labels/microsoftedgeenterprisestable.sh b/fragments/labels/microsoftedgeenterprisestable.sh deleted file mode 100644 index 1866fb9..0000000 --- a/fragments/labels/microsoftedgeenterprisestable.sh +++ /dev/null @@ -1,10 +0,0 @@ -microsoftedgeenterprisestable) - name="Microsoft Edge" - type="pkg" - downloadURL="https://go.microsoft.com/fwlink/?linkid=2093438" - #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.edge"]/version' 2>/dev/null | sed -E 's/<version>([0-9.]*) .*/\1/') - appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/MicrosoftEdge.*pkg" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') - expectedTeamID="UBF8T346G9" - updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" - updateToolArguments=( --install --apps EDGE01 ) - ;; diff --git a/fragments/labels/microsoftexcel.sh b/fragments/labels/microsoftexcel.sh index d1b4f93..a27367e 100644 --- a/fragments/labels/microsoftexcel.sh +++ b/fragments/labels/microsoftexcel.sh @@ -5,6 +5,10 @@ microsoftexcel) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.excel.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps XCEL2019 ) ;; diff --git a/fragments/labels/microsoftoffice365.sh b/fragments/labels/microsoftoffice365.sh index 1318950..e7de7a7 100644 --- a/fragments/labels/microsoftoffice365.sh +++ b/fragments/labels/microsoftoffice365.sh @@ -7,6 +7,10 @@ microsoftoffice365) expectedTeamID="UBF8T346G9" # using MS PowerPoint as the 'stand-in' for the entire suite #appName="Microsoft PowerPoint.app" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi blockingProcesses=( "Microsoft AutoUpdate" "Microsoft Word" "Microsoft PowerPoint" "Microsoft Excel" "Microsoft OneNote" "Microsoft Outlook" "OneDrive" ) updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install ) diff --git a/fragments/labels/microsoftofficebusinesspro.sh b/fragments/labels/microsoftofficebusinesspro.sh index 48454f8..68f0cdb 100644 --- a/fragments/labels/microsoftofficebusinesspro.sh +++ b/fragments/labels/microsoftofficebusinesspro.sh @@ -6,6 +6,10 @@ microsoftofficebusinesspro) expectedTeamID="UBF8T346G9" # using MS PowerPoint as the 'stand-in' for the entire suite appName="Microsoft PowerPoint.app" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi blockingProcesses=( "Microsoft AutoUpdate" "Microsoft Word" "Microsoft PowerPoint" "Microsoft Excel" "Microsoft OneNote" "Microsoft Outlook" "OneDrive" "Teams") updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install ) diff --git a/fragments/labels/microsoftonedrive.sh b/fragments/labels/microsoftonedrive.sh index 373b7b3..d7df8d7 100644 --- a/fragments/labels/microsoftonedrive.sh +++ b/fragments/labels/microsoftonedrive.sh @@ -5,6 +5,10 @@ microsoftonedrive) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.onedrive.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | cut -d "/" -f 6 | cut -d "." -f 1-3) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps ONDR18 ) ;; diff --git a/fragments/labels/microsoftonenote.sh b/fragments/labels/microsoftonenote.sh index d254f6a..cb86c78 100644 --- a/fragments/labels/microsoftonenote.sh +++ b/fragments/labels/microsoftonenote.sh @@ -5,6 +5,10 @@ microsoftonenote) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.onenote.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps ONMC2019 ) ;; diff --git a/fragments/labels/microsoftoutlook.sh b/fragments/labels/microsoftoutlook.sh index e7fe89e..7b4b02c 100644 --- a/fragments/labels/microsoftoutlook.sh +++ b/fragments/labels/microsoftoutlook.sh @@ -5,6 +5,10 @@ microsoftoutlook) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.outlook.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps OPIM2019 ) ;; diff --git a/fragments/labels/microsoftpowerpoint.sh b/fragments/labels/microsoftpowerpoint.sh index be1257d..4798a96 100644 --- a/fragments/labels/microsoftpowerpoint.sh +++ b/fragments/labels/microsoftpowerpoint.sh @@ -5,6 +5,10 @@ microsoftpowerpoint) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.powerpoint.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps PPT32019 ) ;; diff --git a/fragments/labels/microsoftremotedesktop.sh b/fragments/labels/microsoftremotedesktop.sh index f2645a9..753ae13 100644 --- a/fragments/labels/microsoftremotedesktop.sh +++ b/fragments/labels/microsoftremotedesktop.sh @@ -5,6 +5,10 @@ microsoftremotedesktop) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.remotedesktop.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_Remote_Desktop.*pkg" | cut -d "_" -f 4) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps MSRD10 ) ;; diff --git a/fragments/labels/microsoftskypeforbusiness.sh b/fragments/labels/microsoftskypeforbusiness.sh index 046f3e1..1b2518c 100644 --- a/fragments/labels/microsoftskypeforbusiness.sh +++ b/fragments/labels/microsoftskypeforbusiness.sh @@ -5,6 +5,10 @@ microsoftskypeforbusiness) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.skypeforbusiness.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" && $DEBUG -eq 0 ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps MSFB16 ) ;; diff --git a/fragments/labels/microsoftteams.sh b/fragments/labels/microsoftteams.sh index b580758..d8377aa 100644 --- a/fragments/labels/microsoftteams.sh +++ b/fragments/labels/microsoftteams.sh @@ -8,6 +8,6 @@ microsoftteams) expectedTeamID="UBF8T346G9" blockingProcesses=( Teams "Microsoft Teams Helper" ) # Commenting out msupdate as it is not really supported *yet* for teams - # updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" + # updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate --list; /Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" # updateToolArguments=( --install --apps TEAM01 ) - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/microsoftvisualstudiocode.sh b/fragments/labels/microsoftvisualstudiocode.sh index 85a4e68..be06f44 100644 --- a/fragments/labels/microsoftvisualstudiocode.sh +++ b/fragments/labels/microsoftvisualstudiocode.sh @@ -2,7 +2,6 @@ microsoftvisualstudiocode|\ visualstudiocode) name="Visual Studio Code" type="zip" - #downloadURL="https://go.microsoft.com/fwlink/?LinkID=620882" # Intel only downloadURL="https://go.microsoft.com/fwlink/?LinkID=2156837" # Universal appNewVersion=$(curl -fsL "https://code.visualstudio.com/Updates" | grep "/darwin" | grep -oiE ".com/([^>]+)([^<]+)/darwin" | cut -d "/" -f 2 | sed $'s/[^[:print:] ]//g' | head -1 ) expectedTeamID="UBF8T346G9" diff --git a/fragments/labels/microsoftword.sh b/fragments/labels/microsoftword.sh index 9b72b39..801fb48 100644 --- a/fragments/labels/microsoftword.sh +++ b/fragments/labels/microsoftword.sh @@ -5,6 +5,10 @@ microsoftword) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/package[id="com.microsoft.word.standalone.365"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | grep -o "/Microsoft_.*pkg" | cut -d "_" -f 3 | cut -d "." -f 1-2) expectedTeamID="UBF8T346G9" + if [[ -x "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" && $INSTALL != "force" ]]; then + printlog "Running msupdate --list" + "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" --list + fi updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" updateToolArguments=( --install --apps MSWD2019 ) ;; diff --git a/fragments/labels/microsoftyammer.sh b/fragments/labels/microsoftyammer.sh index 3c9aa95..2fc47ee 100644 --- a/fragments/labels/microsoftyammer.sh +++ b/fragments/labels/microsoftyammer.sh @@ -5,6 +5,6 @@ microsoftyammer) #appNewVersion=$(curl -fs https://macadmins.software/latest.xml | xpath '//latest/oldpackage[id="com.microsoft.yammer.standalone"]/cfbundleshortversionstring' 2>/dev/null | sed -E 's/<cfbundleshortversionstring>([0-9.]*)<.*/\1/') appNewVersion=$(curl -fsIL "$downloadURL" | grep -i location: | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') expectedTeamID="UBF8T346G9" - #updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" + #updateTool="/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate --list; /Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/msupdate" #updateToolArguments=( --install --apps ?????? ) ;; diff --git a/fragments/labels/mowgliiitsycal.sh b/fragments/labels/mowgliiitsycal.sh new file mode 100644 index 0000000..b4c0ce2 --- /dev/null +++ b/fragments/labels/mowgliiitsycal.sh @@ -0,0 +1,8 @@ +mowgliiitsycal) + name="Itsycal" + type="zip" + downloadURL=$(curl -fs https://s3.amazonaws.com/itsycal/itsycal.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.xml | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2) + expectedTeamID="HFT3T55WND" + ;; + diff --git a/fragments/labels/muzzle.sh b/fragments/labels/muzzle.sh index 76091f7..9f2fa31 100644 --- a/fragments/labels/muzzle.sh +++ b/fragments/labels/muzzle.sh @@ -4,4 +4,4 @@ muzzle) downloadURL="https://muzzleapp.com/binaries/muzzle.zip" appNewVersion=$(curl -fs https://muzzleapp.com/updates/ | grep -io 'h2.*Version.* [0-9.]*.*h2' | head -1 | sed -E 's/.*ersion *([0-9.]*).*/\1/g') expectedTeamID="49EYHPJ4Q3" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/nudge.sh b/fragments/labels/nudge.sh new file mode 100644 index 0000000..804872d --- /dev/null +++ b/fragments/labels/nudge.sh @@ -0,0 +1,8 @@ +nudge) + name="Nudge" + type="pkg" + downloadURL=$(downloadURLFromGit macadmins Nudge ) + appNewVersion=$(versionFromGit macadmins Nudge ) + expectedTeamID="9GQZ7KUFR6" + archiveName="Nudge-[0-9.]*.pkg" + ;; diff --git a/fragments/labels/ottomatic.sh b/fragments/labels/ottomatic.sh new file mode 100644 index 0000000..f2e1c5a --- /dev/null +++ b/fragments/labels/ottomatic.sh @@ -0,0 +1,8 @@ +ottomatic) + name="Otto Matic" + type="dmg" + downloadURL=$(downloadURLFromGit jorio OttoMatic) + appNewVersion=$(versionFromGit jorio OttoMatic) + expectedTeamID="RVNL7XC27G" + ;; + diff --git a/fragments/labels/overflow.sh b/fragments/labels/overflow.sh new file mode 100644 index 0000000..6ca5eac --- /dev/null +++ b/fragments/labels/overflow.sh @@ -0,0 +1,8 @@ +overflow) + name="Overflow" + type="dmg" + downloadURL="$(curl -sL 'https://overflow.io/download/' | awk -F '"' '/app-updates.overflow.io\/packages\/updates\/osx_64/ { print $8; exit }')" + appNewVersion=$(echo "$downloadURL" | awk -F '-|[.]dmg' '{ print $(NF-1) }') + expectedTeamID="7TK7YSGJFF" + versionKey="CFBundleShortVersionString" + ;; diff --git a/fragments/labels/pandoc.sh b/fragments/labels/pandoc.sh new file mode 100644 index 0000000..154f4ff --- /dev/null +++ b/fragments/labels/pandoc.sh @@ -0,0 +1,9 @@ +pandoc) + name="Pandoc" + type="pkg" + packageID="net.johnmacfarlane.pandoc" + downloadURL=$(downloadURLFromGit jgm pandoc ) + appNewVersion=$(versionFromGit jgm pandoc ) + archiveName="mac.pkg" + expectedTeamID="5U2WKE6DES" + ;; diff --git a/fragments/labels/parsec.sh b/fragments/labels/parsec.sh index 68b3841..8b72a04 100644 --- a/fragments/labels/parsec.sh +++ b/fragments/labels/parsec.sh @@ -3,4 +3,4 @@ parsec) type="pkg" downloadURL="https://builds.parsecgaming.com/package/parsec-macos.pkg" expectedTeamID="Y9MY52XZDB" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/perimeter81.sh b/fragments/labels/perimeter81.sh new file mode 100644 index 0000000..2f05459 --- /dev/null +++ b/fragments/labels/perimeter81.sh @@ -0,0 +1,7 @@ +perimeter81) + name="Perimeter 81" + type="pkg" + downloadURL="https://static.perimeter81.com/agents/mac/snapshot/latest/Perimeter81.pkg" + appNewVersion="$(curl -fsIL "${downloadURL}" | grep -i ^x-amz-meta-version | sed -E 's/x-amz-meta-version: //' | cut -d"." -f1-3)" + expectedTeamID="924635PD62" + ;; diff --git a/fragments/labels/platypus.sh b/fragments/labels/platypus.sh index 62e2f41..257de1a 100644 --- a/fragments/labels/platypus.sh +++ b/fragments/labels/platypus.sh @@ -4,4 +4,4 @@ platypus) downloadURL=$(downloadURLFromGit sveinbjornt Platypus) appNewVersion=$(versionFromGit sveinbjornt Platypus) expectedTeamID="55GP2M789L" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/prism9.sh b/fragments/labels/prism9.sh index 9bdba3f..a94e5e9 100644 --- a/fragments/labels/prism9.sh +++ b/fragments/labels/prism9.sh @@ -3,4 +3,4 @@ prism9) type="dmg" downloadURL="https://cdn.graphpad.com/downloads/prism/9/InstallPrism9.dmg" expectedTeamID="YQ2D36NS9M" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/protonvpn.sh b/fragments/labels/protonvpn.sh new file mode 100644 index 0000000..99fb7f9 --- /dev/null +++ b/fragments/labels/protonvpn.sh @@ -0,0 +1,7 @@ +protonvpn) + name="ProtonVPN" + type="dmg" + downloadURL=$(curl -fs "https://protonvpn.com/download" | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*\.dmg" | head -1) + appNewVersion=$(echo $downloadURL | sed -e 's/^.*\/Proton.*_v\([0-9.]*\)\.dmg/\1/g') + expectedTeamID="J6S6Q257EK" + ;; diff --git a/fragments/labels/r.sh b/fragments/labels/r.sh index 3151eba..1c98852 100644 --- a/fragments/labels/r.sh +++ b/fragments/labels/r.sh @@ -1,8 +1,7 @@ r) - # credit: Tadayuki Onishi (@kenchan0130) name="R" type="pkg" - downloadURL=$( curl -fsL https://formulae.brew.sh/api/cask/r.json | sed -n 's/^.*"url":"\([^"]*\)".*$/\1/p' ) - appNewVersion=$(curl -fsL https://formulae.brew.sh/api/cask/r.json | sed -n 's/^.*"version":"\([^"]*\)".*$/\1/p') + downloadURL="https://cloud.r-project.org/bin/macosx/$( curl -fsL https://cloud.r-project.org/bin/macosx/ | grep -m 1 -o '<a href=".*pkg">' | sed -E 's/.+"(.+)".+/\1/g' )" + appNewVersion=$(echo "${downloadURL}" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)\..*/\1/g') expectedTeamID="VZLD955F6P" ;; diff --git a/fragments/labels/remotix.sh b/fragments/labels/remotix.sh new file mode 100644 index 0000000..4a095d3 --- /dev/null +++ b/fragments/labels/remotix.sh @@ -0,0 +1,7 @@ +remotix) + name="Remotix" + type="dmg" + downloadURL="https://remotix.com/downloads/latest-remotix-mac/" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "^location" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)-.*\.dmg/\1/g' ) + expectedTeamID="K293Y6CVN4" + ;; diff --git a/fragments/labels/remotixagent.sh b/fragments/labels/remotixagent.sh new file mode 100644 index 0000000..25539b5 --- /dev/null +++ b/fragments/labels/remotixagent.sh @@ -0,0 +1,8 @@ +remotixagent) + name="RemotixAgent" + type="pkg" + packageID="com.nulana.rxagentmac" + downloadURL="https://remotix.com/downloads/latest-agent-mac/" + appNewVersion=$( curl -fsIL "${downloadURL}" | grep -i "^location" | sed -E 's/.*\/[a-zA-Z]*-([0-9.]*)-.*\.pkg/\1/g' ) + expectedTeamID="K293Y6CVN4" + ;; diff --git a/fragments/labels/ringcentralclassicapp.sh b/fragments/labels/ringcentralclassicapp.sh index ef75cee..78d4186 100644 --- a/fragments/labels/ringcentralclassicapp.sh +++ b/fragments/labels/ringcentralclassicapp.sh @@ -5,4 +5,4 @@ ringcentralclassicapp) expectedTeamID="M932RC5J66" blockingProcesses=( "Glip" ) #blockingProcessesMaxCPU="5" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/royaltsx.sh b/fragments/labels/royaltsx.sh index af5082e..6ebc77a 100644 --- a/fragments/labels/royaltsx.sh +++ b/fragments/labels/royaltsx.sh @@ -4,4 +4,4 @@ royaltsx) downloadURL=$(curl -fs https://royaltsx-v5.royalapps.com/updates_stable | xpath '//rss/channel/item[1]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2) appNewVersion=$(curl -fs https://royaltsx-v5.royalapps.com/updates_stable | xpath '//rss/channel/item[1]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2) expectedTeamID="VXP8K9EDP6" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/screencloudplayer.sh b/fragments/labels/screencloudplayer.sh index e7c1604..07bb3bd 100644 --- a/fragments/labels/screencloudplayer.sh +++ b/fragments/labels/screencloudplayer.sh @@ -1,7 +1,7 @@ screencloudplayer) - # credit: AP Orlebeke (@apizz) name="ScreenCloud Player" type="dmg" - downloadURL=$(curl -sL "https://screencloud.com/download" | sed -n 's/^.*"url":"\([^"]*\)".*$/\1/p') + downloadURL=$(curl -fs "https://screencloud.com/download" | sed -n 's/^.*"url":"\(https.*\.dmg\)".*$/\1/p') + appNewVersion=$( echo $downloadURL | sed -e 's/.*\/ScreenCloud.*\-\([0-9.]*\)\.dmg/\1/g' ) expectedTeamID="3C4F953K6P" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/sequelpro.sh b/fragments/labels/sequelpro.sh new file mode 100644 index 0000000..9e7af69 --- /dev/null +++ b/fragments/labels/sequelpro.sh @@ -0,0 +1,7 @@ +sequelpro) + name="Sequel Pro" + type="dmg" + downloadURL="$(downloadURLFromGit sequelpro sequelpro)" + appNewVersion="$(versionFromGit sequelpro sequelpro)" + expectedTeamID="Media" + ;; diff --git a/fragments/labels/sketch.sh b/fragments/labels/sketch.sh index 637a5b6..7cf3b9a 100644 --- a/fragments/labels/sketch.sh +++ b/fragments/labels/sketch.sh @@ -4,4 +4,4 @@ sketch) downloadURL=$(curl -sf https://www.sketch.com/downloads/mac/ | grep 'href="https://download.sketch.com' | sed -E 's/.*href=\"(.*)\".?/\1/g') appNewVersion=$(curl -fs https://www.sketch.com/updates/ | grep "Sketch Version" | head -1 | sed -E 's/.*Version ([0-9.]*)<.*/\1/g') # version from update page expectedTeamID="WUGMZZ5K46" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/sketchupviewer.sh b/fragments/labels/sketchupviewer.sh new file mode 100644 index 0000000..6148d3b --- /dev/null +++ b/fragments/labels/sketchupviewer.sh @@ -0,0 +1,6 @@ +sketchupviewer) + name="SketchUpViewer" + type="dmg" + downloadURL="$(curl -fs https://www.sketchup.com/sketchup/SketchUpViewer-en-dmg | grep "<a href=" | sed 's/.*href="//' | sed 's/".*//')" + expectedTeamID="J8PVMCY7KL" + ;; diff --git a/fragments/labels/skype.sh b/fragments/labels/skype.sh index f14d15b..a689ffa 100644 --- a/fragments/labels/skype.sh +++ b/fragments/labels/skype.sh @@ -5,4 +5,4 @@ skype) appNewVersion=$(curl -is "https://get.skype.com/go/getskype-skypeformac" | grep ocation: | grep -o "Skype-.*dmg" | cut -d "-" -f 2 | cut -d "." -f1-2) expectedTeamID="AL798K98FX" Company="Microsoft" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/smartgit.sh b/fragments/labels/smartgit.sh index 347c402..7abb0ad 100644 --- a/fragments/labels/smartgit.sh +++ b/fragments/labels/smartgit.sh @@ -1,7 +1,11 @@ smartgit) name="SmartGit" type="dmg" - downloadURL="https://www.syntevo.com$(curl -fs "https://www.syntevo.com/smartgit/download/" | grep -i -o -E "/downloads/.*/smartgit.*\.dmg")" + if [[ $(arch) == "arm64" ]]; then + downloadURL="https://www.syntevo.com$(curl -fs "https://www.syntevo.com/smartgit/download/" | grep -i -o -E "/downloads/.*/smartgit.*\.dmg" | tail -1)" + elif [[ $(arch) == "i386" ]]; then + downloadURL="https://www.syntevo.com$(curl -fs "https://www.syntevo.com/smartgit/download/" | grep -i -o -E "/downloads/.*/smartgit.*\.dmg" | head -1)" + fi appNewVersion="$(curl -fs "https://www.syntevo.com/smartgit/changelog.txt" | grep -i -E "SmartGit *[0-9.]* *.*" | head -1 | awk '{print $2}')" expectedTeamID="PHMY45PTNW" ;; diff --git a/fragments/labels/snagit.sh b/fragments/labels/snagit.sh index f748e1b..2c65478 100644 --- a/fragments/labels/snagit.sh +++ b/fragments/labels/snagit.sh @@ -5,4 +5,4 @@ snagit2020) type="dmg" downloadURL="https://download.techsmith.com/snagitmac/releases/Snagit.dmg" expectedTeamID="7TQL462TU8" - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/sqlpropostgres.sh b/fragments/labels/sqlpropostgres.sh new file mode 100644 index 0000000..beb5af4 --- /dev/null +++ b/fragments/labels/sqlpropostgres.sh @@ -0,0 +1,7 @@ +sqlpropostgres) + name="SQLPro for Postgres" + type="zip" + downloadURL="https://macpostgresclient.com/download.php" + expectedTeamID="LKJB72232C" + blockingProcesses=( "SQLPro for Postgres" ) + ;; diff --git a/fragments/labels/sqlprostudio.sh b/fragments/labels/sqlprostudio.sh new file mode 100644 index 0000000..8ff5446 --- /dev/null +++ b/fragments/labels/sqlprostudio.sh @@ -0,0 +1,7 @@ +sqlprostudio) + name="SQLPro Studio" + type="zip" + downloadURL="https://www.sqlprostudio.com/download.php" + expectedTeamID="LKJB72232C" + blockingProcesses=( "SQLPro Studio" ) + ;; diff --git a/fragments/labels/steelseriesengine.sh b/fragments/labels/steelseriesengine.sh new file mode 100644 index 0000000..3c15545 --- /dev/null +++ b/fragments/labels/steelseriesengine.sh @@ -0,0 +1,7 @@ +steelseriesengine) + name="SteelSeries GG" + type="pkg" + downloadURL="https://steelseries.com/engine/latest/darwin" + appNewVersion="$(curl -fsIL "$downloadURL" | grep -i "^location" | sed -E 's/.*SteelSeriesGG([0-9.]*)\.pkg/\1/')" + expectedTeamID="6WGL6CHFH2" + ;; diff --git a/fragments/labels/strongsync.sh b/fragments/labels/strongsync.sh new file mode 100644 index 0000000..c96a32d --- /dev/null +++ b/fragments/labels/strongsync.sh @@ -0,0 +1,9 @@ +strongsync) + name="Strongsync" + type="dmg" + #downloadURL="https://updates.expandrive.com/apps/strongsync/download_latest" + downloadURL=$(curl -fs "https://updates.expandrive.com/appcast/strongsync.xml" | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2) + appNewVersion=$(curl -fs "https://updates.expandrive.com/appcast/strongsync.xml" | xpath '(//rss/channel/item/enclosure/@sparkle:version)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2) + versionKey="CFBundleVersion" + expectedTeamID="CH86M498V4" + ;; diff --git a/fragments/labels/superhuman.sh b/fragments/labels/superhuman.sh new file mode 100644 index 0000000..f64f8b8 --- /dev/null +++ b/fragments/labels/superhuman.sh @@ -0,0 +1,11 @@ +superhuman) + name="superhuman" + type="dmg" + if [[ $(arch) == "arm64" ]]; then + downloadURL="https://download.superhuman.com/Superhuman-arm64.dmg" + elif [[ $(arch) == "i386" ]]; then + downloadURL="https://download.superhuman.com/Superhuman.dmg" + fi + appNewVersion=$(curl -fs "https://storage.googleapis.com/download.superhuman.com/supertron-update/latest-mac.yml" | head -1 | cut -d " " -f2) + expectedTeamID="6XHFYUTQGX" + ;; diff --git a/fragments/labels/tageditor.sh b/fragments/labels/tageditor.sh new file mode 100644 index 0000000..666284c --- /dev/null +++ b/fragments/labels/tageditor.sh @@ -0,0 +1,7 @@ +tageditor) + name="Tag Editor" + type="dmg" + downloadURL="https://amvidia.com/downloads/tag-editor-mac.dmg" + appNewVersion=curl -sf "https://amvidia.com/tag-editor" | grep -o -E '"softwareVersion":.'"{8}" | sed 's/\"//g' | awk -F ': ' '{print $2}' + expectedTeamID="F2TH9XX9CJ" + ;; diff --git a/fragments/labels/talkdeskcallbar.sh b/fragments/labels/talkdeskcallbar.sh new file mode 100644 index 0000000..9487d44 --- /dev/null +++ b/fragments/labels/talkdeskcallbar.sh @@ -0,0 +1,7 @@ +talkdeskcallbar) + name="Callbar" + type="dmg" + downloadURL=https://downloadcallbar.talkdesk.com/Callbar-$(curl -fsL https://downloadcallbar.talkdesk.com/release_metadata.json | sed -n 's/^.*"version":"\([^"]*\)".*$/\1/p').dmg + appNewVersion=$(curl -fsL https://downloadcallbar.talkdesk.com/release_metadata.json | sed -n 's/^.*"version":"\([^"]*\)".*$/\1/p') + expectedTeamID="YGGJX44TB8" + ;; diff --git a/fragments/labels/tom4aconverter.sh b/fragments/labels/tom4aconverter.sh new file mode 100644 index 0000000..bfc2b77 --- /dev/null +++ b/fragments/labels/tom4aconverter.sh @@ -0,0 +1,7 @@ +tom4aconverter) + name="To M4A Converter" + type="dmg" + downloadURL="https://amvidia.com/downloads/to-m4a-converter-mac.dmg" + appNewVersion=curl -sf "https://amvidia.com/to-m4a-converter" | grep -o -E '"softwareVersion":.'"{8}" | sed 's/\"//g' | awk -F ': ' '{print $2}' + expectedTeamID="F2TH9XX9CJ" + ;; diff --git a/fragments/labels/typora.sh b/fragments/labels/typora.sh new file mode 100644 index 0000000..380843f --- /dev/null +++ b/fragments/labels/typora.sh @@ -0,0 +1,9 @@ +typora) + name="Typora" + type="dmg" + #downloadURL="https://www.typora.io/download/Typora.dmg" + downloadURL=$(curl -fs "https://www.typora.io/download/dev_update.xml" | xpath '(//rss/channel/item/enclosure/@url)[1]' 2>/dev/null | cut -d '"' -f2) + #appNewVersion="$(curl -fs "https://www.typora.io/dev_release.html" | grep -o -i "h4>[0-9.]*</h4" | head -1 | sed -E 's/.*h4>([0-9.]*)<\/h4.*/\1/')" + appNewVersion=$(curl -fs "https://www.typora.io/download/dev_update.xml" | xpath '(//rss/channel/item/enclosure/@sparkle:shortVersionString)[1]' 2>/dev/null | cut -d '"' -f2) + expectedTeamID="9HWK5273G4" + ;; diff --git a/fragments/labels/utm.sh b/fragments/labels/utm.sh new file mode 100644 index 0000000..92cd02e --- /dev/null +++ b/fragments/labels/utm.sh @@ -0,0 +1,7 @@ +utm) + name="UTM" + type="dmg" + downloadURL=$(downloadURLFromGit utmapp UTM ) + appNewVersion=$(versionFromGit utmapp UTM ) + expectedTeamID="WDNLXAD4W8" + ;; diff --git a/fragments/labels/vagrant.sh b/fragments/labels/vagrant.sh index a69e352..1e8bd8b 100644 --- a/fragments/labels/vagrant.sh +++ b/fragments/labels/vagrant.sh @@ -1,10 +1,8 @@ vagrant) - # credit: AP Orlebeke (@apizz) name="Vagrant" type="pkgInDmg" pkgName="vagrant.pkg" - downloadURL=$(curl -fs https://www.vagrantup.com/downloads | tr '><' '\n' | awk -F'"' '/x86_64.dmg/ {print $6}' | head -1) - #appNewVersion=$( curl -fs https://www.vagrantup.com/downloads.html | grep -i "Current Version" ) - appNewVersion=$(versionFromGit hashicorp vagrant) + downloadURL=$(curl -fs "https://www.vagrantup.com/downloads" | tr '"' '\n' | grep "^https.*\.dmg$" | head -1) + appNewVersion=$( echo $downloadURL | cut -d "/" -f5 ) expectedTeamID="D38WU7D763" ;; diff --git a/fragments/labels/vscodium.sh b/fragments/labels/vscodium.sh index 4d83db1..013139b 100644 --- a/fragments/labels/vscodium.sh +++ b/fragments/labels/vscodium.sh @@ -1,11 +1,8 @@ vscodium) - # credit: AP Orlebeke (@apizz) name="VSCodium" type="dmg" - downloadURL=$(curl -fs "https://api.github.com/repos/VSCodium/vscodium/releases/latest" | awk -F '"' "/browser_download_url/ && /dmg/ && ! /sig/ && ! /CLI/ && ! /sha256/ { print \$4 }") - #downloadURL=$(downloadURLFromGit VSCodium vscodium) # Too many versions - appNewVersion=$(versionFromGit VSCodium vscodium) + downloadURL="$(downloadURLFromGit VSCodium vscodium)" + appNewVersion="$(versionFromGit VSCodium vscodium)" expectedTeamID="C7S3ZQ2B8V" - appName="VSCodium.app" blockingProcesses=( Electron ) ;; diff --git a/fragments/labels/wacomdrivers.sh b/fragments/labels/wacomdrivers.sh new file mode 100644 index 0000000..32098be --- /dev/null +++ b/fragments/labels/wacomdrivers.sh @@ -0,0 +1,8 @@ +wacomdrivers) + name="Wacom Desktop Center" + type="pkgInDmg" + downloadURL="$(curl -fs https://www.wacom.com/en-us/support/product-support/drivers | grep -e "drivers/mac/professional.*dmg" | head -1 | sed -e 's/data-download-link="//g' -e 's/"//' | awk '{$1=$1}{ print }' | sed 's/\r//')" + expectedTeamID="EG27766DY7" + pkgName="Install Wacom Tablet.pkg" + appNewVersion="$(curl -fs https://www.wacom.com/en-us/support/product-support/drivers | grep mac/professional/releasenotes | head -1 | awk -F"|" '{print $1}' | awk -F"Driver" '{print $3}' | sed -e 's/ (.*//g' | tr -d ' ')" + ;; diff --git a/fragments/labels/xink.sh b/fragments/labels/xink.sh index 62b7fa2..ee3a39d 100644 --- a/fragments/labels/xink.sh +++ b/fragments/labels/xink.sh @@ -1,7 +1,8 @@ xink) name="Xink" - type="zip" - downloadURL="https://downloads.xink.io/macos/client" - #appNewVersion=$() # Cannot find version history or release notes on home page + type="pkg" + packageID="com.emailsignature.Xink" + downloadURL="https://downloads.xink.io/macos/pkg" + appNewVersion=$(curl -fs "https://downloads.xink.io/macos/appcast" | xpath '(//rss/channel/item/enclosure/@sparkle:version)[1]' 2>/dev/null | head -1 | cut -d '"' -f 2) expectedTeamID="F287823HVS" ;; diff --git a/fragments/labels/yed.sh b/fragments/labels/yed.sh new file mode 100644 index 0000000..2b5f504 --- /dev/null +++ b/fragments/labels/yed.sh @@ -0,0 +1,8 @@ +yed) + # This label assumes accept of these T&C’s: https://www.yworks.com/resources/yed/license.html + name="yEd" + type="dmg" + downloadURL="https://www.yworks.com"$(curl -fs "https://www.yworks.com/products/yed/download" | grep -o -e "/resources/.*\.dmg" | tr " " '\n' | grep -o -e "/resources/.*\.dmg") + appNewVersion=$(echo $downloadURL | sed -E 's/.*-([0-9.]*)_.*\.dmg/\1/') + expectedTeamID="JD89S887M2" + ;; diff --git a/fragments/labels/zohoworkdrivetruesync.sh b/fragments/labels/zohoworkdrivetruesync.sh new file mode 100644 index 0000000..aa0820e --- /dev/null +++ b/fragments/labels/zohoworkdrivetruesync.sh @@ -0,0 +1,11 @@ +zohoworkdrivetruesync) +# Using this label expects you to agree to these: +# License Areemant: https://www.zoho.com/workdrive/zohoworkdrive-license-agreement.html +# Privacy policy: https://www.zoho.com/privacy.html + name="Zoho WorkDrive TrueSync" + type="pkg" + #https://www.zoho.com/workdrive/truesync.html + #https://files-accl.zohopublic.com/public/tsbin/download/c488f53fb0fe339a8a3868a16d56ede6 + downloadURL=$(curl -fs "https://www.zoho.com/workdrive/truesync.html" | tr '<' '\n' | grep -B3 "For Mac" | grep -o -m1 "https.*\"" | cut -d '"' -f1) + expectedTeamID="TZ824L8Y37" + ;; diff --git a/fragments/labels/zoom.sh b/fragments/labels/zoom.sh index 5a2430e..d6cdade 100644 --- a/fragments/labels/zoom.sh +++ b/fragments/labels/zoom.sh @@ -1,9 +1,7 @@ zoom) - # credit: Isaac Ordonez, Mann consulting (@mannconsulting) - name="Zoom.us" + name="zoom.us" type="pkg" downloadURL="https://zoom.us/client/latest/ZoomInstallerIT.pkg" - appNewVersion=$(curl -fs -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15)" "https://zoom.us/download" | grep Version | head -n 1 | sed -E 's/.* ([0-9.]* \(.*\)).*/\1/') # credit: Søren Theilgaard (@theilgaard) + appNewVersion="$(curl -fsIL ${downloadURL} | grep -i ^location | cut -d "/" -f5)" expectedTeamID="BJ4HAAB9B3" - blockingProcesses=( zoom.us ) ;; diff --git a/fragments/labels/zoomclient.sh b/fragments/labels/zoomclient.sh index fa1b96a..4288a28 100644 --- a/fragments/labels/zoomclient.sh +++ b/fragments/labels/zoomclient.sh @@ -1,7 +1,7 @@ zoomclient) name="zoom.us" type="pkg" - packageID="us.zoom.pkg.videmeeting" + packageID="us.zoom.pkg.videomeeting" if [[ $(arch) == i386 ]]; then downloadURL="https://zoom.us/client/latest/Zoom.pkg" elif [[ $(arch) == arm64 ]]; then diff --git a/fragments/labels/zoomgov.sh b/fragments/labels/zoomgov.sh new file mode 100644 index 0000000..ef7eb47 --- /dev/null +++ b/fragments/labels/zoomgov.sh @@ -0,0 +1,7 @@ +zoomgov) + name="zoom.us" + type="pkg" + downloadURL="https://www.zoomgov.com/client/latest/ZoomInstallerIT.pkg" + appNewVersion="$(curl -fsIL ${downloadURL} | grep -i ^location | cut -d "/" -f5)" + expectedTeamID="BJ4HAAB9B3" + ;; diff --git a/fragments/labels/zoomrooms.sh b/fragments/labels/zoomrooms.sh index c3f87b7..37186be 100644 --- a/fragments/labels/zoomrooms.sh +++ b/fragments/labels/zoomrooms.sh @@ -6,4 +6,4 @@ zoomrooms) appNewVersion="$(curl -fsIL ${downloadURL} | grep -i location | cut -d "/" -f5)" expectedTeamID="BJ4HAAB9B3" blockingProcesses=( "ZoomPresence" ) - ;; \ No newline at end of file + ;; diff --git a/fragments/labels/zulujdk8.sh b/fragments/labels/zulujdk8.sh index 5581ffa..0a10e49 100644 --- a/fragments/labels/zulujdk8.sh +++ b/fragments/labels/zulujdk8.sh @@ -10,4 +10,4 @@ zulujdk8) expectedTeamID="TDTHCUPYFR" appCustomVersion(){ if [ -f "/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Info.plist" ]; then /usr/bin/defaults read "/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Info.plist" "CFBundleName" | sed 's/Zulu //'; fi } appNewVersion=$(echo "$downloadURL" | cut -d "-" -f 1 | sed -e "s/.*zulu//") # Cannot be compared to anything - ;; \ No newline at end of file + ;; diff --git a/fragments/main.sh b/fragments/main.sh index 2127145..82942e7 100644 --- a/fragments/main.sh +++ b/fragments/main.sh @@ -103,7 +103,7 @@ if [[ -z $blockingProcesses ]]; then fi # MARK: determine tmp dir -if [ "$DEBUG" -ne 0 ]; then +if [ "$DEBUG" -eq 1 ]; then # for debugging use script dir as working directory tmpDir=$(dirname "$0") else @@ -124,10 +124,14 @@ 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." + updateTool="" +fi if [[ -n $appNewVersion ]]; then printlog "Latest version of $name is $appNewVersion" if [[ $appversion == $appNewVersion ]]; then - if [[ $DEBUG -eq 0 ]]; then + if [[ $DEBUG -ne 1 ]]; then printlog "There is no newer version available." if [[ $INSTALL != "force" ]]; then message="$name, version $appNewVersion, is the latest version." @@ -136,26 +140,19 @@ if [[ -n $appNewVersion ]]; then displaynotification "$message" "No update for $name!" fi cleanupAndExit 0 "No newer version." - else - printlog "Using force to install anyway. Not using updateTool." - updateTool="" fi else - printlog "DEBUG mode enabled, not exiting, but there is no new version of app." + printlog "DEBUG mode 1 enabled, not exiting, but there is no new version of app." fi fi else printlog "Latest version not specified." - if [[ $INSTALL == "force" ]]; then - printlog "Using force to install, so not using updateTool." - updateTool="" - fi fi # MARK: check if this is an Update and we can use updateTool if [[ (-n $appversion && -n "$updateTool") || "$type" == "updateronly" ]]; then printlog "appversion & updateTool" - if [[ $DEBUG -eq 0 ]]; then + if [[ $DEBUG -ne 1 ]]; then if runUpdateTool; then finishing cleanupAndExit 0 @@ -164,26 +161,34 @@ if [[ (-n $appversion && -n "$updateTool") || "$type" == "updateronly" ]]; then cleanupAndExit 0 fi # otherwise continue else - printlog "DEBUG mode enabled, not running update tool" + printlog "DEBUG mode 1 enabled, not running update tool" fi fi # MARK: download the archive -if [ -f "$archiveName" ] && [ "$DEBUG" -ne 0 ]; then - printlog "$archiveName exists and DEBUG enabled, skipping download" +if [ -f "$archiveName" ] && [ "$DEBUG" -eq 1 ]; then + printlog "$archiveName exists and DEBUG mode 1 enabled, skipping download" else # download the dmg printlog "Downloading $downloadURL to $archiveName" if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then printlog "notifying" - displaynotification "Downloading $name update" "Download in progress …" + if [[ $updateDetected == "YES" ]]; then + displaynotification "Downloading $name update" "Download in progress …" + else + displaynotification "Downloading new $name" "Download in progress …" + fi fi if ! curl --location --fail --silent "$downloadURL" -o "$archiveName"; then printlog "error downloading $downloadURL" message="$name update/installation failed. This will be logged, so IT can follow up." if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then printlog "notifying" - displaynotification "$message" "Error installing/updating $name" + if [[ $updateDetected == "YES" ]]; then + displaynotification "$message" "Error updating $name" + else + displaynotification "$message" "Error installing $name" + fi fi cleanupAndExit 2 fi @@ -206,7 +211,17 @@ fi printlog "Installing $name" if [[ $currentUser != "loginwindow" && $NOTIFY == "all" ]]; then printlog "notifying" - displaynotification "Installing $name" "Installation in progress …" + if [[ $updateDetected == "YES" ]]; then + displaynotification "Updating $name" "Installation in progress …" + else + displaynotification "Installing $name" "Installation in progress …" + fi +fi + +if [ -n "$installerTool" ]; then + # installerTool defined, and we use that for installation + printlog "installerTool used: $installerTool" + appName="$installerTool" fi case $type in diff --git a/fragments/version.sh b/fragments/version.sh index 7cee47d..b3db12c 100644 --- a/fragments/version.sh +++ b/fragments/version.sh @@ -1 +1 @@ -0.7.0b1 \ No newline at end of file +9.0dev diff --git a/utils/assemble.sh b/utils/assemble.sh index 674ad43..016ff98 100755 --- a/utils/assemble.sh +++ b/utils/assemble.sh @@ -19,7 +19,7 @@ zparseopts -D -E -a opts r -run s -script p -pkg n -notarize h -help -labels+:=l if (( ${opts[(I)(-h|--help)]} )); then echo "usage: assemble.sh [--script|--pkg|--notarize] [-labels path/to/labels ...] [arguments...]" - echo + echo echo "builds and runs the installomator script from the fragements." echo "additional arguments are passed into the Installomator script for testing." exit @@ -68,7 +68,7 @@ labels_dir="$fragments_dir/labels" # add default labels_dir to label_paths label_paths+=$labels_dir -echo "label_paths: $label_paths" +#echo "label_paths: $label_paths" fragment_files=( header.sh version.sh functions.sh arguments.sh main.sh ) @@ -134,7 +134,7 @@ fi # build a pkg when flag is set if [[ buildPkg -eq 1 ]]; then echo "# building installer package" - + tmpfolder=$(mktemp -d) payloadfolder="${tmpfolder}/payload" @@ -185,4 +185,4 @@ if [[ $notarizePkg -eq 1 ]]; then # staple result echo "# Stapling $productpath" xcrun stapler staple "$productpath" -fi \ No newline at end of file +fi diff --git a/utils/buildLabel.sh b/utils/buildLabel.sh index e64f81e..6d74380 100755 --- a/utils/buildLabel.sh +++ b/utils/buildLabel.sh @@ -10,6 +10,94 @@ downloadURL=${1?:"need to provide a download URL."} # Usage # ./buildLabel.sh <URL to download software> +# Mark: Functions + +xpath() { + # 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) + #xmllint --xpath $@ - + else + /usr/bin/xpath $@ + fi +} +# will get the latest release download from a github repo +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 "$archiveDestinationName" ]; then + downloadURL=$(curl -sf "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }") + else + downloadURL=$(curl -sf "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") + fi + + echo "$downloadURL" + return 0 +} +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" + appNewVersion="" + else + echo "$appNewVersion" + return 0 + fi +} + +pkgInvestigation() { + echo "Package investigation." + teamID=$(spctl -a -vv -t install "$pkgPath" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' ) + if [[ -z $teamID ]]; then + echo "Error verifying PKG: $pkgPath" + echo "No TeamID found." + exit 4 + fi + echo "Team ID found for PKG: $teamID" + + echo "For PKGs it's advised to find packageID for version checking, so extracting those" + pkgutil --expand "$pkgPath" "$archiveName"_pkg + if [[ -a "$archiveName"_pkg/Distribution ]] ; then + 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)" + elif [[ -a "$archiveName"_pkg/PackageInfo ]] ; then + cat "$archiveName"_pkg/PackageInfo | xpath '//pkg-info/@version' 2>/dev/null + packageID="$(cat "$archiveName"_pkg/PackageInfo | xpath '//pkg-info/@identifier' 2>/dev/null | cut -d '"' -f2 )" + fi + 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##*/} + name=${appName%.*} + echo "Application investigation." + + # verify with spctl + teamID=$(spctl -a -vv "$appPath" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()' ) + if [[ -z $teamID ]]; then + echo "Error verifying app: $appPath" + echo "No TeamID found." + exit 4 + fi + echo "Team ID found for app: $teamID" +} + +# Mark: Code # Use working directory as download folder tmpDir="$(pwd)/$(date "+%Y-%m-%d-%H-%M-%S")" # Create a n almost unique folder name @@ -23,57 +111,48 @@ if ! cd "$tmpDir"; then fi echo "Working dir: $(pwd)" -# download the URL +# investigate and download the URL echo "Downloading $downloadURL" -echo "Redirecting to (maybe this can help us with version):\n$(curl -fsIL "$downloadURL" | grep -i ^location)" +echo $(basename $downloadURL) +# First trying to find redirection headers on the download, as those can contain version numbers +echo "Redirecting to (maybe this can help us with version):\n$(curl -fsIL -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" | grep -i "^[location|x\-amz\-meta\-version]*")" +# Now downloading without extra headers if ! downloadOut="$(curl -fL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then - echo "error downloading $downloadURL" - exit 2 + echo "error downloading $downloadURL using standard headers." + 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 + fi + fi + fi fi -xpath() { - # 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) - #xmllint --xpath $@ - - else - /usr/bin/xpath $@ - fi -} +# Now we have downloaded the archive, and we need to analyze this +# The download have returned both {filename_effective} and {url_effective} -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:\n${downloadOut}" archiveTempName=$( echo "${downloadOut}" | head -1 ) echo "archiveTempName: $archiveTempName" archivePath=$( echo "${downloadOut}" | tail -1 ) echo "archivePath: $archivePath" +# The two fields retuurned can be exchanged, so some servers return the filename on the other variable. Don't know why. +# So we want to investigate which one has the filename try1archiveName=${${archiveTempName##*/}%%\?*} try2archiveName=${${archivePath##*/}%%\?*} -fileName_re='^([a-zA-Z0-9\_.%-]*)\.(dmg|pkg|zip|tbz)$' +fileName_re='^([a-zA-Z0-9\_.%-]*)\.(dmg|pkg|zip|tbz)$' # regular expression for matching if [[ "${try1archiveName}" =~ $fileName_re ]]; then archiveName=${try1archiveName} elif [[ "${try2archiveName}" =~ $fileName_re ]]; then @@ -81,22 +160,26 @@ elif [[ "${try2archiveName}" =~ $fileName_re ]]; then else echo "Could not determine archiveName from “$try1archiveName” and “$try2archiveName”" #echo "Extensions $archiveTempName:t:e $archivePath:t:e" - exit + exit 1 fi +# So we found a filename, and now we want to detect the extension and other information echo "Calculated archiveName: $archiveName" mv $archiveTempName $archiveName name=${archiveName%.*} echo "name: $name" archiveExt=${archiveName##*.} +type=$archiveExt echo "archiveExt: $archiveExt" -identifier=${name:l} -identifier=${identifier//\%[0-9a-fA-F][0-9a-fA-F]} -identifier=${identifier//[,._*@$\(\)\-]} +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 pkgPath="$archiveName" + echo "PKG found: $pkgPath" pkgInvestigation elif [ "$archiveExt" = "dmg" ]; then echo "Diskimage found" @@ -108,15 +191,20 @@ elif [ "$archiveExt" = "dmg" ]; then fi echo "Mounted: $dmgmount" - # check if app og pkg exists + # 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" @@ -125,43 +213,141 @@ elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then # unzip the archive tar -xf "$archiveName" - # check if app og pkg exists + # check if app og pkg exists after expanding appPath=$(find "$tmpDir" -name "*.app" -maxdepth 2 -print ) pkgPath=$(find "$tmpDir" -name "*.pkg" -maxdepth 2 -print ) if [[ $appPath != "" ]]; then + echo "App found: $appPath" appInvestigation elif [[ $pkgPath != "" ]]; then + echo "PKG found: $pkgPath" archiveExt="pkgInZip" pkgInvestigation + else + echo "Nothing found in compressed archive." + exit 9 fi fi -echo -echo "**********" -echo -echo "Labels should be named in small caps, numbers 0-9, “-”, and “_”. No other characters allowed." -echo -echo "appNewVersion is often difficult to find. Can sometimes be found in the filename, sometimes as part of the download redirects, but also on a web page. See redirect and archivePath above if link contains information about this. That is a good place to start" -echo -echo "$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" + githubAuthor=$(echo "$downloadURL" | cut -d "/" -f4) + githubRepo=$(echo "$downloadURL" | cut -d "/" -f5) + if [[ ! -z $githubAuthor && $githubRepo ]] ; then + githubError=9 + echo "Github place: $githubAuthor $githubRepo" + originalDownloadURL="$downloadURL" + githubDownloadURL=$(downloadURLFromGit "$githubAuthor" "$githubRepo") + githubAppNewVersion=$(versionFromGit "$githubAuthor" "$githubRepo") + downloadURL=$originalDownloadURL + echo "Latest URL on github: $githubDownloadURL \nLatest version: $githubAppNewVersion" + if [[ "$originalDownloadURL" == "$githubDownloadURL" ]]; then + echo "GitHub calculated URL matches entered URL." + githubError=0 + downloadURL="\$(downloadURLFromGit $githubAuthor $githubRepo)" + appNewVersion="\$(versionFromGit $githubAuthor $githubRepo)" + else + if [[ "$( echo $originalDownloadURL | cut -d "/" -f1-7)" == "$( echo $githubDownloadURL | cut -d "/" -f1-7)" ]]; then + echo "Calculated GitHub URL almost identical, only this diff:" + echo "“$( echo $originalDownloadURL | cut -d "/" -f8-)” and “$( echo $githubDownloadURL | cut -d "/" -f8-)”" + echo "Could be version difference or difference in archiveName for a given release." + echo "Testing for version difference." + #Investigate if these strings match if numbers are removed. + if [[ "$( echo $originalDownloadURL | cut -d "/" -f8- | sed 's/[0-9.]*//g')" == "$( echo $githubDownloadURL | cut -d "/" -f8- | sed 's/[0-9.]*//g')" ]]; then + # In this if..then we found out if the end parts of the URL was mathing after removinger numbers and dots (and then assuming that only a version was different + echo "“$( echo $originalDownloadURL | cut -d "/" -f8- | sed 's/[0-9.]*//g')” and “$( echo $githubDownloadURL | cut -d "/" -f8- | sed 's/[0-9.]*//g')”" + echo "Matching without numbers in string.\nVERY LIKELY a version difference." + githubError=1 + echo "Try running again with URL: ${githubDownloadURL}" + else + # If we are here more than numbers and dots didn't match, so maybe this repo has software for several software titles + echo "Not a version problem.\nTesting for difference in archiveName." + tempName=$(echo ${archiveName%.*} | grep -o "[0-9.]*" ) + # if archiveName contains several sections of numbers and/or dots, like "Marathon2-20210408-Mac.dmg" that will return 2 and 20210408 so we want to find the longest of these two (or more), assuming that the longest is the version + tempName=( $tempName ) # make it an array + i=0; max=0; tempString="" + echo $tempName | while read tempLine; do + ((i++)) + length[$i]=${#tempLine} + if [[ $max -lt $length[$i] ]] ; then + max=$length[$i] + tempString=$tempLine + fi + done + # Now tempString will have the longest string returned before. So I use that in a search-replace to remove that part and insert regular expression "[0-9.]*" instead as that will match the removed part + archiveDestinationName="$(echo $archiveName | sed -E "s/^(.*)$tempString(.*)$/\1[0-9.]*\2/g")" + echo "archiveName=\"$archiveDestinationName\"" + # Now we want to test if the archiveName is working + githubDownloadURL=$(downloadURLFromGit "$githubAuthor" "$githubRepo") + githubAppNewVersion=$(versionFromGit "$githubAuthor" "$githubRepo") + downloadURL=$originalDownloadURL + echo "Latest URL on github: $githubDownloadURL \nLatest version: $githubAppNewVersion" + # Final evaluation of our result + if [[ "$originalDownloadURL" == "$githubDownloadURL" ]]; then + echo "GitHub calculated URL matches entered URL." + githubError=0 + downloadURL="\$(downloadURLFromGit $githubAuthor $githubRepo)" + appNewVersion="\$(versionFromGit $githubAuthor $githubRepo)" + else + githubError=2 + echo "Not solved by using archiveName." + echo "Not sure what this can be." + archiveDestinationName="" + fi + fi + else + echo "GitHub URL not matching" + fi + fi + fi +fi + +# We are finished downloading and analyzing, so now we need to present the data +echo "\n**********" +echo "\nLabels should be named in small caps, numbers 0-9, “-”, and “_”. No other characters allowed." + +if [[ -z $githubError || $githubError != 0 ]]; then +echo "\nappNewVersion is often difficult to find. Can sometimes be found in the filename, sometimes as part of the download redirects, but also on a web page. See redirect and archivePath above if link contains information about this. That is a good place to start" +fi + +# Here the label is built, for easy copy and paste +echo "\n$identifier)" echo " name=\"$name\"" echo " type=\"$archiveExt\"" -if [ "$packageID" != "" ]; then +if [ -n "$packageID" ]; then echo " packageID=\"$packageID\"" fi +if [ -n "$archiveDestinationName" ]; then +echo " archiveName=\"$archiveDestinationName\"" +fi echo " downloadURL=\"$downloadURL\"" -echo " appNewVersion=\"\"" +echo " appNewVersion=\"$appNewVersion\"" echo " expectedTeamID=\"$teamID\"" if [ -n "$appName" ] && [ "$appName" != "${name}.app" ]; then echo " appName=\"$appName\"" fi echo " ;;" -echo -echo "Above should be saved in a file with exact same name as label, and given extension “.sh”." -echo "Put this file in folder “fragments/labels”." -echo +case $githubError in +0) + echo "\nLabel converted to GitHub label without errors." + echo "Details can be seen above." + ;; +1) + echo "\nFound Github place in this URL: $githubAuthor $githubRepo" + echo "But version has a problem." + echo "Try running again with URL: ${githubDownloadURL}" + echo "See details above." + ;; +2) + echo "\nFound Github place in this URL: $githubAuthor $githubRepo" + echo "But it could not be resolved." + echo "Can be from a hidden repository, or the software title has a number in it." + ;; +esac -exit 0 +echo "\nAbove should be saved in a file with exact same name as label, and given extension “.sh”." +echo "Put this file in folder “fragments/labels”.\n" diff --git a/utils/checkLabels.sh b/utils/checkLabels.sh index 4dde7c6..f9fdef1 100755 --- a/utils/checkLabels.sh +++ b/utils/checkLabels.sh @@ -16,14 +16,14 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin # MARK: Constants -pathToLabels="fragments/labels" -if [[ ! -d ${pathToLabels} ]]; then - echo "This script should be called from Installomator directory as working directory with this command:" - echo "utils/checkLabels.sh" - echo - exit 99 -fi +#setup some folders +script_dir=$(dirname ${0:A}) +repo_dir=$(dirname $script_dir) +build_dir="$repo_dir/build" +destination_file="$build_dir/Installomator.sh" +fragments_dir="$repo_dir/fragments" +labels_dir="$fragments_dir/labels" # MARK: Check minimal macOS requirement if [[ $(sw_vers -buildVersion ) < "18" ]]; then @@ -98,11 +98,11 @@ BLUE='\033[1;34m' NC='\033[0m' # No Color # Labels with the $(arch) call for different versions for Intel and Apple Silicon should be listed here: -archLabels=( $(grep "\$(arch)" ${pathToLabels}/* | awk '{print $1}' | sed -E 's/.*\/([a-z0-9\_-]*)\..*/\1/g'| uniq ) ) +archLabels=( $(grep "\$(arch)" ${labels_dir}/* | awk '{print $1}' | sed -E 's/.*\/([a-z0-9\_-]*)\..*/\1/g'| uniq ) ) echo "${BLUE}Labels with \"\$(arch)\" call:${NC}\n${archLabels}\n" if [[ $# -eq 0 ]]; then - allLabels=( $(grep -h -E '^([a-z0-9\_-]*)(\)|\|\\)$' ${pathToLabels}/*.sh | tr -d ')|\\' | sort) ) + allLabels=( $(grep -h -E '^([a-z0-9\_-]*)(\)|\|\\)$' ${labels_dir}/*.sh | tr -d ')|\\' | sort) ) else allLabels=( ${=@} ) fi @@ -122,7 +122,7 @@ for label in $allLabels; do name=""; type=""; downloadURL=""; appNewVersion=""; expectedTeamID=""; blockingProcesses=""; updateTool=""; updateToolArguments=""; archiveName="" #caseLabel - if cat "${pathToLabels}/${label}.sh" | grep -v -E '^[a-z0-9\_-]*(\)|\|\\)$' | grep -v ";;" > checkLabelCurrent.sh; then + if cat "${labels_dir}/${label}.sh" | grep -v -E '^[a-z0-9\_-]*(\)|\|\\)$' | grep -v ";;" > checkLabelCurrent.sh; then source checkLabelCurrent.sh echo "Name: $name"