Verify for “Adobe Installer” before running

Also added another option for getting current version that we could consider using. Removed some old stuff already commented out.
This commit is contained in:
Søren Theilgaard
2022-09-13 09:05:04 +02:00
parent 22170a89ae
commit cd2637d30f

View File

@@ -1,15 +1,19 @@
adobecreativeclouddesktop)
name="Adobe Creative Cloud"
#appName="Install.app"
type="dmg"
if pgrep -q "Adobe Installer"; then
printlog "Adobe Installer is running, not a good time to update." WARN
printlog "################## End $APPLICATION \n\n" INFO
exit 75
fi
adobeurl="https://helpx.adobe.com/download-install/kb/creative-cloud-desktop-app-download.html"
if [[ $(arch) == "arm64" ]]; then
downloadURL=$(curl -fs "$adobeurl" | xmllint -html -xpath "string(//a[contains(@href,'macarm64')][contains(text(),'Download')]/@href)" - 2> /dev/null)
elif [[ $(arch) == "i386" ]]; then
downloadURL=$(curl -fs "$adobeurl" | xmllint -html -xpath "string(//a[contains(@href,'osx10')][contains(text(),'Download')]/@href)" - 2> /dev/null)
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)
#appNewVersion=$(echo "$downloadURL" | grep -o '[^x]*$' | cut -d '.' -f 1 | sed 's/_/\./g')
installerTool="Install.app"
CLIInstaller="Install.app/Contents/MacOS/Install"
CLIArguments=(--mode=silent)