diff --git a/fragments/functions.sh b/fragments/functions.sh index 446bbd5..6475479 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -369,7 +369,9 @@ 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" @@ -382,7 +384,6 @@ installAppWithPath() { # $1: path to app to install in $targetDir cleanupAndExit 7 "Error while copying" fi - # set ownership to current user if [ "$currentUser" != "loginwindow" ]; then printlog "Changing owner to $currentUser" @@ -391,6 +392,18 @@ installAppWithPath() { # $1: path to app to install in $targetDir 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 + + CLIoutput=$("$mountname/$CLIInstaller" "${CLIArguments[@]}" 2>&1) + CLIstatus=$(echo $?) + logoutput="$CLIoutput" # dedupliatelogs "$CLIoutput" + cleanupAndExit 3 "Error installing $mountname/$CLIInstaller $CLIArguments error: $logoutput" #ERROR + fi + printlog "Debugging enabled, update tool output was: $logoutput" #DEBUG + fi + } mountDMG() { diff --git a/fragments/labels/adobecreativeclouddesktop.sh b/fragments/labels/adobecreativeclouddesktop.sh new file mode 100644 index 0000000..9faef3f --- /dev/null +++ b/fragments/labels/adobecreativeclouddesktop.sh @@ -0,0 +1,16 @@ +adobecreativeclouddesktop) + appName="Install.app" + name="Creative Cloud" + 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) + CLIInstaller="Install.app/Contents/MacOS/Install" + CLIArguments=(--mode=silent) + expectedTeamID="JQ525L2MZD" + Company="Adobe" + ;;