From c7b5f89a4cd00c8954d121d0f5853e4cd92b8210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Tue, 14 Dec 2021 15:42:49 +0100 Subject: [PATCH 01/16] Update depnotify.sh --- fragments/labels/depnotify.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fragments/labels/depnotify.sh b/fragments/labels/depnotify.sh index 50a7155..2f9f6b7 100644 --- a/fragments/labels/depnotify.sh +++ b/fragments/labels/depnotify.sh @@ -1,7 +1,8 @@ depnotify) name="DEPNotify" - type="zip" - downloadURL="https://files.nomad.menu/DEPNotify.zip" + type="pkg" + #packageID="menu.nomad.depnotify" + downloadURL="https://files.nomad.menu/DEPNotify.pkg" + #appNewVersion=$() expectedTeamID="VRPY9KHGX6" - targetDir="/Applications/Utilities" ;; From 9178cf8fe58e279ca89c8ce7c1002f46ec8be27e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Thu, 16 Dec 2021 09:15:43 +0100 Subject: [PATCH 02/16] Apple fonts --- fragments/labels/applenyfonts.sh | 2 +- fragments/labels/applesfcompact.sh | 2 +- fragments/labels/applesfpro.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fragments/labels/applenyfonts.sh b/fragments/labels/applenyfonts.sh index 16c7185..fe4f258 100644 --- a/fragments/labels/applenyfonts.sh +++ b/fragments/labels/applenyfonts.sh @@ -3,5 +3,5 @@ applenyfonts) type="pkgInDmg" downloadURL="https://devimages-cdn.apple.com/design/resources/download/NY.dmg" packageID="com.apple.pkg.NYFonts" - expectedTeamID="Development Update" + expectedTeamID="Software Update" ;; diff --git a/fragments/labels/applesfcompact.sh b/fragments/labels/applesfcompact.sh index aef7977..5f4bcf2 100644 --- a/fragments/labels/applesfcompact.sh +++ b/fragments/labels/applesfcompact.sh @@ -3,5 +3,5 @@ applesfcompact) type="pkgInDmg" downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg" packageID="com.apple.pkg.SanFranciscoCompact" - expectedTeamID="Development Update" + expectedTeamID="Software Update" ;; diff --git a/fragments/labels/applesfpro.sh b/fragments/labels/applesfpro.sh index 9d76895..fecd78a 100644 --- a/fragments/labels/applesfpro.sh +++ b/fragments/labels/applesfpro.sh @@ -3,5 +3,5 @@ applesfpro) type="pkgInDmg" downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg" packageID="com.apple.pkg.SanFranciscoPro" - expectedTeamID="Development Update" + expectedTeamID="Software Update" ;; From a4fe0d65ec548a3a5be3fd73ca01d6568b027a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Fri, 17 Dec 2021 14:48:24 +0100 Subject: [PATCH 03/16] Create ibarcoder.sh --- fragments/labels/ibarcoder.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 fragments/labels/ibarcoder.sh diff --git a/fragments/labels/ibarcoder.sh b/fragments/labels/ibarcoder.sh new file mode 100644 index 0000000..7752c92 --- /dev/null +++ b/fragments/labels/ibarcoder.sh @@ -0,0 +1,7 @@ +ibarcoder) + name="iBarcoder" + type="dmg" + downloadURL="https://cristallight.com/Downloads/mac/ibarcoder.dmg" + appNewVersion="$(curl -fs "https://cristallight.com/iBarcoder/" | grep -i version: | head -1 | awk '{print $2}')" + expectedTeamID="JAXVB9AH9M" + ;; From dac472f6d17f784e7fe88dd7b0156ac786b079ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Wed, 29 Dec 2021 13:28:29 +0100 Subject: [PATCH 04/16] Create applesfarabic.sh --- fragments/labels/applesfarabic.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 fragments/labels/applesfarabic.sh diff --git a/fragments/labels/applesfarabic.sh b/fragments/labels/applesfarabic.sh new file mode 100644 index 0000000..811d26c --- /dev/null +++ b/fragments/labels/applesfarabic.sh @@ -0,0 +1,7 @@ +applesfarabic) + name="San Francisco Arabic" + type="pkgInDmg" + downloadURL="https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg" + packageID="com.apple.pkg.SFArabicFonts" + expectedTeamID="Software Update" + ;; From 2c4bef35248297a4b1526afaa6294b165bc2ae1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Wed, 29 Dec 2021 13:37:16 +0100 Subject: [PATCH 05/16] Update applesfsymbols.sh --- fragments/labels/applesfsymbols.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fragments/labels/applesfsymbols.sh b/fragments/labels/applesfsymbols.sh index b4f2764..97b93de 100644 --- a/fragments/labels/applesfsymbols.sh +++ b/fragments/labels/applesfsymbols.sh @@ -2,7 +2,7 @@ applesfsymbols|\ sfsymbols) name="SF Symbols" type="pkgInDmg" - downloadURL=$( curl -fs "https://developer.apple.com/sf-symbols/" | grep -oe "https.*\.dmg" | head -1 ) - appNewVersion=$( echo "$downloadURL" | head -1 | sed -E 's/.*SF-Symbols-([0-9.]*)\..*/\1/g') + downloadURL=$( curl -fs "https://developer.apple.com/sf-symbols/" | grep -oe "https.*Symbols.*\.dmg" | head -1 ) + appNewVersion=$( echo "$downloadURL" | sed -E 's/.*SF-Symbols-([0-9.]*)\..*/\1/g') expectedTeamID="Software Update" ;; From 1a1ad30b66571b92f1c558b7c0d775aa1a9acf09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Thu, 30 Dec 2021 20:09:10 +0100 Subject: [PATCH 06/16] mightymike and ottomatic --- fragments/broken/mightymike.sh | 2 +- fragments/labels/ottomatic.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/fragments/broken/mightymike.sh b/fragments/broken/mightymike.sh index b241a6a..733fafa 100644 --- a/fragments/broken/mightymike.sh +++ b/fragments/broken/mightymike.sh @@ -1,5 +1,5 @@ mightymike) - name="Nanosaur" + name="Mighty Mike" type="dmg" downloadURL=$(downloadURLFromGit jorio MightyMike) appNewVersion=$(versionFromGit jorio MightyMike) diff --git a/fragments/labels/ottomatic.sh b/fragments/labels/ottomatic.sh index f2e1c5a..68ed521 100644 --- a/fragments/labels/ottomatic.sh +++ b/fragments/labels/ottomatic.sh @@ -5,4 +5,3 @@ ottomatic) appNewVersion=$(versionFromGit jorio OttoMatic) expectedTeamID="RVNL7XC27G" ;; - From 1fdbef74c183b45273900d8ef56bd45c6cfc5ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Sun, 2 Jan 2022 20:15:42 +0100 Subject: [PATCH 07/16] Update logitechoptions.sh --- fragments/labels/logitechoptions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fragments/labels/logitechoptions.sh b/fragments/labels/logitechoptions.sh index 48409a0..d0278d3 100644 --- a/fragments/labels/logitechoptions.sh +++ b/fragments/labels/logitechoptions.sh @@ -1,9 +1,9 @@ logitechoptions) - # credit: AP Orlebeke (@apizz) name="Logitech Options" type="pkgInZip" downloadURL=$(curl -fs -L https://www.logitech.com/en-us/product/options | grep -m 1 -o "https.*zip" | sed 's/\"//' | awk '{print $1}') #appNewVersion=$(curl -fs -L https://www.logitech.com/en-us/product/options | grep -m 1 -o "https.*zip" | sed 's/\"//' | awk '{print $1}' | sed -E 's/.*_([0-9\.]*)[-\.].*/\1/' ) - pkgName="LogiMgr Installer ${appNewVersion}.app/Contents/Resources/LogiMgr.pkg" + #pkgName="LogiMgr Installer ${appNewVersion}.app/Contents/Resources/LogiMgr.pkg" + pkgName="LogiMgr Installer [0-9.]*.app/Contents/Resources/LogiMgr.pkg" expectedTeamID="QED4VVPZWA" ;; From 61b05ff31e78f8cf3c7793c5d62af239808f6e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Mon, 3 Jan 2022 09:09:30 +0100 Subject: [PATCH 08/16] Update brave.sh This is a special construction of the `appNewVersion` variable. Not sure this is future proof, but the current one was not working. --- fragments/labels/brave.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fragments/labels/brave.sh b/fragments/labels/brave.sh index 44a3e90..afd3199 100644 --- a/fragments/labels/brave.sh +++ b/fragments/labels/brave.sh @@ -1,15 +1,14 @@ brave) - # credit: @securitygeneration name="Brave Browser" type="dmg" if [[ $(arch) != "i386" ]]; then printlog "Architecture: arm64 (not i386)" - downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osxarm64/release | grep -i "^location" | awk '{print $2}' | tr -d '\r\n') + downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osxarm64/release | grep -i "^location" | awk '{print $2}') else printlog "Architecture: i386" - downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osx/release | grep -i "^location" | awk '{print $2}' | tr -d '\r\n') + downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osx/release | grep -i "^location" | awk '{print $2}') fi -# downloadURL=$(curl --location --fail --silent "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2) - appNewVersion=$(curl --location --fail --silent "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2) +# downloadURL=$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2) + appNewVersion="96.$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 | cut -d "." -f1-3)" expectedTeamID="KL8N8XSYF4" ;; From c499327e7d1f60e84ad3b427b06ed9fa94191615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Mon, 3 Jan 2022 10:18:27 +0100 Subject: [PATCH 09/16] Update brave.sh --- fragments/labels/brave.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fragments/labels/brave.sh b/fragments/labels/brave.sh index afd3199..0b4301b 100644 --- a/fragments/labels/brave.sh +++ b/fragments/labels/brave.sh @@ -4,11 +4,12 @@ brave) if [[ $(arch) != "i386" ]]; then printlog "Architecture: arm64 (not i386)" downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osxarm64/release | grep -i "^location" | awk '{print $2}') + appNewVersion="96.$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable-arm64/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 | cut -d "." -f1-3)" else printlog "Architecture: i386" downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osx/release | grep -i "^location" | awk '{print $2}') + appNewVersion="96.$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 | cut -d "." -f1-3)" fi # downloadURL=$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2) - appNewVersion="96.$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 | cut -d "." -f1-3)" expectedTeamID="KL8N8XSYF4" ;; From 85c8fecc357fcc43f9bc3a7a83a7de7e6d8ffd4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Tue, 4 Jan 2022 10:52:53 +0100 Subject: [PATCH 10/16] Update brave.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Brave is now using “CFBundleVersion” for the version check. That can be compared to the sparkle-feed. --- fragments/labels/brave.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fragments/labels/brave.sh b/fragments/labels/brave.sh index 0b4301b..6e16d6d 100644 --- a/fragments/labels/brave.sh +++ b/fragments/labels/brave.sh @@ -4,12 +4,15 @@ brave) if [[ $(arch) != "i386" ]]; then printlog "Architecture: arm64 (not i386)" downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osxarm64/release | grep -i "^location" | awk '{print $2}') - appNewVersion="96.$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable-arm64/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 | cut -d "." -f1-3)" + appNewVersion="$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable-arm64/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2)" + #appNewVersion="96.$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable-arm64/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 | cut -d "." -f1-3)" else printlog "Architecture: i386" downloadURL=$(curl -fsIL https://laptop-updates.brave.com/latest/osx/release | grep -i "^location" | awk '{print $2}') - appNewVersion="96.$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 | cut -d "." -f1-3)" + appNewVersion="$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:version' 2>/dev/null | cut -d '"' -f 2)" + #appNewVersion="96.$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@sparkle:shortVersionString' 2>/dev/null | cut -d '"' -f 2 | cut -d "." -f1-3)" fi + versionKey="CFBundleVersion" # downloadURL=$(curl -fsL "https://updates.bravesoftware.com/sparkle/Brave-Browser/stable/appcast.xml" | xpath '//rss/channel/item[last()]/enclosure/@url' 2>/dev/null | cut -d '"' -f 2) expectedTeamID="KL8N8XSYF4" ;; From 21cee3a1ba35355c883b5bb21f5b6e3fd693fa6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Fri, 7 Jan 2022 10:35:57 +0100 Subject: [PATCH 11/16] signal is universal --- fragments/labels/signal.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fragments/labels/signal.sh b/fragments/labels/signal.sh index d9037ae..fa4585f 100644 --- a/fragments/labels/signal.sh +++ b/fragments/labels/signal.sh @@ -1,8 +1,7 @@ signal) - # credit: Søren Theilgaard (@theilgaard) name="Signal" type="dmg" - downloadURL=https://updates.signal.org/desktop/$(curl -fs https://updates.signal.org/desktop/latest-mac.yml | awk '/url/ && /dmg/ {print $3}') + downloadURL=https://updates.signal.org/desktop/$(curl -fs https://updates.signal.org/desktop/latest-mac.yml | awk '/url/ && /dmg/ {print $3}' | grep -i universal) appNewVersion=$(curl -fs https://updates.signal.org/desktop/latest-mac.yml | grep version | awk '{print $2}') expectedTeamID="U68MSDN6DR" ;; From c3ddd4f8c7d94387a8a658b0b075983a0d6ae635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Fri, 7 Jan 2022 19:40:51 +0100 Subject: [PATCH 12/16] Update buildLabel.sh Different set of headers. --- utils/buildLabel.sh | 102 +++++++++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 43 deletions(-) diff --git a/utils/buildLabel.sh b/utils/buildLabel.sh index 6d74380..87e6ded 100755 --- a/utils/buildLabel.sh +++ b/utils/buildLabel.sh @@ -82,6 +82,36 @@ pkgInvestigation() { echo "$packageID" echo "Above is the possible packageIDs that can be used, and the correct one is probably one of those with a version number. More investigation might be needed to figure out correct packageID if several are displayed." } + +dmgInvestigation() { + echo "DMG investigation." + # mount the dmg + echo "Mounting $archiveName" + if ! dmgmount=$(echo "Y"$'\n' | hdiutil attach "$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then + echo "Error mounting $archiveName" + exit 3 + fi + echo "Mounted: $dmgmount" + + # check if app og pkg exists on disk image + appPath=$(find "$dmgmount" -name "*.app" -maxdepth 1 -print ) + pkgPath=$(find "$dmgmount" -name "*.pkg" -maxdepth 1 -print ) + + if [[ $appPath != "" ]]; then + echo "App found: $appPath" + appInvestigation + elif [[ $pkgPath != "" ]]; then + echo "PKG found: $pkgPath" + archiveExt="pkgInDmg" + pkgInvestigation + else + echo "Nothing found on DMG." + exit 9 + fi + + hdiutil detach "$dmgmount" +} + appInvestigation() { appName=${appPath##*/} name=${appName%.*} @@ -122,19 +152,22 @@ if ! downloadOut="$(curl -fL "$downloadURL" --remote-header-name --remote-name - echo "result: $downloadOut" echo "Trying all headers…" # that I know of if ! downloadOut="$(curl -fL -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" -H "accept-encoding: gzip, deflate, br" -H "Referrer Policy: strict-origin-when-cross-origin" -H "upgrade-insecure-requests: 1" -H "sec-fetch-dest: document" -H "sec-gpc: 1" -H "sec-fetch-user: ?1" -H "accept-language: en-US,en;q=0.9" -H "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" -H "sec-fetch-mode: navigate" "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then - # we are only here if the download failed - echo "error downloading $downloadURL using all headers." - echo "result: $downloadOut" - # Sometimes a server will give some results to the downloaded output - if [[ -n $downloadOut ]]; then - echo "Trying output of this…" - downloadURL="$(echo $downloadOut | tail -1)" - # Last chance for succes on this download - if ! downloadOut="$(curl -fL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then - echo "error downloading $downloadURL using previous output." - echo "result: $downloadOut" - echo "No more tries. Cannot continue." - exit 1 + echo "Trying almost all headers…" # that I know of + if ! downloadOut="$(curl -fL -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15" -H "accept-encoding: gzip, deflate, br" -H "upgrade-insecure-requests: 1" -H "sec-fetch-dest: document" -H "sec-gpc: 1" -H "sec-fetch-user: ?1" -H "accept-language: en-US,en;q=0.9" -H "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" -H "sec-fetch-mode: navigate" "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then + # we are only here if the download failed + echo "error downloading $downloadURL using two different sets of headers." + echo "result: $downloadOut" + # Sometimes a server will give some results to the downloaded output + if [[ -n $downloadOut ]]; then + echo "Trying output of this…" + downloadURL="$(echo $downloadOut | tail -1)" + # Last chance for succes on this download + if ! downloadOut="$(curl -fL "$downloadURL" --remote-header-name --remote-name -w "%{filename_effective}\n%{url_effective}\n")"; then + echo "error downloading $downloadURL using previous output." + echo "result: $downloadOut" + echo "No more tries. Cannot continue." + exit 1 + fi fi fi fi @@ -171,10 +204,6 @@ echo "name: $name" archiveExt=${archiveName##*.} type=$archiveExt echo "archiveExt: $archiveExt" -identifier=${name:l} # making lower case -identifier=${identifier//\%[0-9a-fA-F][0-9a-fA-F]} # removing certain characters -identifier=${identifier//[,._*@$\(\)\-]} # removing more characters from label name -echo "identifier: $identifier" # Now figuring out the filename extension and handling those situations if [ "$archiveExt" = "pkg" ]; then @@ -183,31 +212,7 @@ if [ "$archiveExt" = "pkg" ]; then pkgInvestigation elif [ "$archiveExt" = "dmg" ]; then echo "Diskimage found" - # mount the dmg - echo "Mounting $archiveName" - if ! dmgmount=$(echo "Y"$'\n' | hdiutil attach "$archiveName" -nobrowse -readonly | tail -n 1 | cut -c 54- ); then - echo "Error mounting $archiveName" - exit 3 - fi - echo "Mounted: $dmgmount" - - # check if app og pkg exists on disk image - appPath=$(find "$dmgmount" -name "*.app" -maxdepth 1 -print ) - pkgPath=$(find "$dmgmount" -name "*.pkg" -maxdepth 1 -print ) - - if [[ $appPath != "" ]]; then - echo "App found: $appPath" - appInvestigation - elif [[ $pkgPath != "" ]]; then - echo "PKG found: $pkgPath" - archiveExt="pkgInDmg" - pkgInvestigation - else - echo "Nothing found on DMG." - exit 9 - fi - - hdiutil detach "$dmgmount" + dmgInvestigation elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then echo "Compressed file found" # unzip the archive @@ -216,6 +221,7 @@ elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then # check if app og pkg exists after expanding appPath=$(find "$tmpDir" -name "*.app" -maxdepth 2 -print ) pkgPath=$(find "$tmpDir" -name "*.pkg" -maxdepth 2 -print ) + archiveName=$(find "$tmpDir" -name "*.dmg" -maxdepth 2 -print ) if [[ $appPath != "" ]]; then echo "App found: $appPath" @@ -223,14 +229,24 @@ elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then elif [[ $pkgPath != "" ]]; then echo "PKG found: $pkgPath" archiveExt="pkgInZip" + echo "archiveExt: $archiveExt" pkgInvestigation + elif [[ $archiveName != "" ]]; then + echo "Disk image found: $archiveName" + archiveExt="dmgInZip" + echo "archiveExt: $archiveExt" + dmgInvestigation else echo "Nothing found in compressed archive." exit 9 fi - fi +identifier=${name:l} # making lower case +identifier=${identifier//\%[0-9a-fA-F][0-9a-fA-F]} # removing certain characters +identifier=${identifier//[,._*@$\(\)\-]} # removing more characters from label name +echo "identifier: $identifier" + # github-part to figure out if we can find author and repo, to use our github functions for the label if echo "$downloadURL" | grep -i "github.com.*releases/download"; then echo "\n**********\n\nFound GitHub path" From d80c76a4d3721534588cf1b00d15509af2ac9319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Fri, 7 Jan 2022 20:41:35 +0100 Subject: [PATCH 13/16] mocha-software and buildLabel.sh Improved buildLabel.sh to handle another set of headers when trying to download, and that can handle the mocha-software. But mocha-software has been disabled, as Installomator does not offer the headers when that is trying to download. --- fragments/{broken => disabled}/mightymike.sh | 0 fragments/disabled/mochakeyboard.sh | 7 +++++++ fragments/disabled/mochatelnet.sh | 7 +++++++ fragments/disabled/mochatn3270.sh | 7 +++++++ fragments/disabled/mochatn3812.sh | 7 +++++++ fragments/disabled/mochatn5250.sh | 7 +++++++ fragments/{broken => disabled}/nanosaur.sh | 0 utils/buildLabel.sh | 9 ++++++++- 8 files changed, 43 insertions(+), 1 deletion(-) rename fragments/{broken => disabled}/mightymike.sh (100%) create mode 100644 fragments/disabled/mochakeyboard.sh create mode 100644 fragments/disabled/mochatelnet.sh create mode 100644 fragments/disabled/mochatn3270.sh create mode 100644 fragments/disabled/mochatn3812.sh create mode 100644 fragments/disabled/mochatn5250.sh rename fragments/{broken => disabled}/nanosaur.sh (100%) diff --git a/fragments/broken/mightymike.sh b/fragments/disabled/mightymike.sh similarity index 100% rename from fragments/broken/mightymike.sh rename to fragments/disabled/mightymike.sh diff --git a/fragments/disabled/mochakeyboard.sh b/fragments/disabled/mochakeyboard.sh new file mode 100644 index 0000000..5f742a5 --- /dev/null +++ b/fragments/disabled/mochakeyboard.sh @@ -0,0 +1,7 @@ +mochakeyboard) + name="Mocha Keyboard" + type="appInDmgInZip" + downloadURL="https://mochasoft.dk/mochakeyboard.dmg.zip" + appNewVersion="" + expectedTeamID="RR9F5EPNVW" + ;; diff --git a/fragments/disabled/mochatelnet.sh b/fragments/disabled/mochatelnet.sh new file mode 100644 index 0000000..5eba112 --- /dev/null +++ b/fragments/disabled/mochatelnet.sh @@ -0,0 +1,7 @@ +mochatelnet) + name="Telnet" + type="appInDmgInZip" + downloadURL="https://mochasoft.dk/telnet.dmg.zip" + appNewVersion="" + expectedTeamID="RR9F5EPNVW" + ;; diff --git a/fragments/disabled/mochatn3270.sh b/fragments/disabled/mochatn3270.sh new file mode 100644 index 0000000..74ce410 --- /dev/null +++ b/fragments/disabled/mochatn3270.sh @@ -0,0 +1,7 @@ +mochatn3270) + name="TN3270" + type="appInDmgInZip" + downloadURL="https://mochasoft.dk/tn3270.dmg.zip" + appNewVersion="" + expectedTeamID="RR9F5EPNVW" + ;; diff --git a/fragments/disabled/mochatn3812.sh b/fragments/disabled/mochatn3812.sh new file mode 100644 index 0000000..54f3884 --- /dev/null +++ b/fragments/disabled/mochatn3812.sh @@ -0,0 +1,7 @@ +mochatn3812) + name="TN3812" + type="appInDmgInZip" + downloadURL="https://mochasoft.dk/tn3812.dmg.zip" + appNewVersion="" + expectedTeamID="Frydendal" + ;; diff --git a/fragments/disabled/mochatn5250.sh b/fragments/disabled/mochatn5250.sh new file mode 100644 index 0000000..ae8ccf2 --- /dev/null +++ b/fragments/disabled/mochatn5250.sh @@ -0,0 +1,7 @@ +mochatn5250) + name="TN5250" + type="appInDmgInZip" + downloadURL="https://mochasoft.dk/tn5250.dmg.zip" + appNewVersion="" + expectedTeamID="RR9F5EPNVW" + ;; diff --git a/fragments/broken/nanosaur.sh b/fragments/disabled/nanosaur.sh similarity index 100% rename from fragments/broken/nanosaur.sh rename to fragments/disabled/nanosaur.sh diff --git a/utils/buildLabel.sh b/utils/buildLabel.sh index 87e6ded..8f96e3c 100755 --- a/utils/buildLabel.sh +++ b/utils/buildLabel.sh @@ -99,10 +99,17 @@ dmgInvestigation() { if [[ $appPath != "" ]]; then echo "App found: $appPath" + if [[ $archiveExt = "dmgInZip" ]]; then + archiveExt="appInDmgInZip" + fi appInvestigation elif [[ $pkgPath != "" ]]; then echo "PKG found: $pkgPath" - archiveExt="pkgInDmg" + if [[ $archiveExt = "dmgInZip" ]]; then + archiveExt="pkgInDmgInZip not supported, yet!" + else + archiveExt="pkgInDmg" + fi pkgInvestigation else echo "Nothing found on DMG." From 6a9ffeb1016666aeea8289c1c0c6b69fca6fdc66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Sat, 8 Jan 2022 20:04:47 +0100 Subject: [PATCH 14/16] Create sdnotary.sh Great app for signing AppleScript and Automator Apps. ``` Installomator/utils/assemble.sh sdnotary DEBUG=0 2022-01-08 20:02:33 sdnotary setting variable from argument DEBUG=0 2022-01-08 20:02:33 sdnotary ################## Start Installomator v. 9.0dev 2022-01-08 20:02:33 sdnotary ################## sdnotary 2022-01-08 20:02:35 sdnotary BLOCKING_PROCESS_ACTION=tell_user 2022-01-08 20:02:35 sdnotary NOTIFY=success 2022-01-08 20:02:35 sdnotary LOGO=/System/Applications/App Store.app/Contents/Resources/AppIcon.icns 2022-01-08 20:02:35 sdnotary no blocking processes defined, using SD Notary as default 2022-01-08 20:02:35 sdnotary Changing directory to /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.Y3LciW3v 2022-01-08 20:02:35 sdnotary App(s) found: /Applications/SD Notary.app 2022-01-08 20:02:35 sdnotary found app at /Applications/SD Notary.app, version 1.4.9 2022-01-08 20:02:35 sdnotary appversion: 1.4.9 2022-01-08 20:02:35 sdnotary Latest version of SD Notary is 1.4.9 2022-01-08 20:02:35 sdnotary There is no newer version available. 2022-01-08 20:02:35 sdnotary Deleting /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.Y3LciW3v 2022-01-08 20:02:35 sdnotary App not closed, so no reopen. 2022-01-08 20:02:35 sdnotary ################## End Installomator, exit code 0 Installomator/utils/assemble.sh sdnotary DEBUG=0 INSTALL=force 2022-01-08 20:02:55 sdnotary setting variable from argument DEBUG=0 2022-01-08 20:02:55 sdnotary setting variable from argument INSTALL=force 2022-01-08 20:02:55 sdnotary ################## Start Installomator v. 9.0dev 2022-01-08 20:02:55 sdnotary ################## sdnotary 2022-01-08 20:02:57 sdnotary BLOCKING_PROCESS_ACTION=tell_user 2022-01-08 20:02:57 sdnotary NOTIFY=success 2022-01-08 20:02:57 sdnotary LOGO=/System/Applications/App Store.app/Contents/Resources/AppIcon.icns 2022-01-08 20:02:57 sdnotary no blocking processes defined, using SD Notary as default 2022-01-08 20:02:57 sdnotary Changing directory to /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.Pt3uud5W 2022-01-08 20:02:57 sdnotary App(s) found: /Applications/SD Notary.app 2022-01-08 20:02:57 sdnotary found app at /Applications/SD Notary.app, version 1.4.9 2022-01-08 20:02:57 sdnotary appversion: 1.4.9 2022-01-08 20:02:57 sdnotary Using force to install, so not using updateTool. 2022-01-08 20:02:57 sdnotary Latest version of SD Notary is 1.4.9 2022-01-08 20:02:57 sdnotary There is no newer version available. 2022-01-08 20:02:57 sdnotary Downloading https://s3.amazonaws.com/latenightsw.com/SDNotary1.4.9-65.zip to SD Notary.zip 2022-01-08 20:02:58 sdnotary no more blocking processes, continue with update 2022-01-08 20:02:58 sdnotary Installing SD Notary 2022-01-08 20:02:58 sdnotary Unzipping SD Notary.zip 2022-01-08 20:02:58 sdnotary Verifying: /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.Pt3uud5W/SD Notary.app 2022-01-08 20:02:59 sdnotary Team ID matching: Z7S6X96M3X (expected: Z7S6X96M3X ) 2022-01-08 20:02:59 sdnotary Downloaded version of SD Notary is 1.4.9, same as installed. 2022-01-08 20:02:59 sdnotary Using force to install anyway. 2022-01-08 20:02:59 sdnotary Removing existing /Applications/SD Notary.app 2022-01-08 20:02:59 sdnotary Copy /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.Pt3uud5W/SD Notary.app to /Applications 2022-01-08 20:02:59 sdnotary Changing owner to st 2022-01-08 20:02:59 sdnotary Finishing... 2022-01-08 20:03:09 sdnotary App(s) found: /Applications/SD Notary.app 2022-01-08 20:03:09 sdnotary found app at /Applications/SD Notary.app, version 1.4.9 2022-01-08 20:03:09 sdnotary Installed SD Notary, version 1.4.9 2022-01-08 20:03:09 sdnotary notifying 2022-01-08 20:03:09 sdnotary Deleting /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/tmp.Pt3uud5W 2022-01-08 20:03:09 sdnotary App not closed, so no reopen. 2022-01-08 20:03:09 sdnotary ################## End Installomator, exit code 0 ``` --- fragments/labels/sdnotary.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 fragments/labels/sdnotary.sh diff --git a/fragments/labels/sdnotary.sh b/fragments/labels/sdnotary.sh new file mode 100644 index 0000000..7eb7aeb --- /dev/null +++ b/fragments/labels/sdnotary.sh @@ -0,0 +1,7 @@ +sdnotary) + name="SD Notary" + type="zip" + downloadURL=$(curl -fs https://latenightsw.com/sd-notary-notarizing-made-easy/ | grep -io "https://.*/.*\.zip") + appNewVersion=$(echo "$downloadURL" | sed -E 's/.*\/[a-zA-Z]*([0-9.]*)-.*\.zip/\1/g') + expectedTeamID="Z7S6X96M3X" + ;; From 130764696ded3665454f4c8f5f001d68343d8c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Sun, 9 Jan 2022 10:05:03 +0100 Subject: [PATCH 15/16] New URL and version But Installomator does not handle regex in the pkgName, so this doesn't work, yet. --- fragments/labels/logitechoptions.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fragments/labels/logitechoptions.sh b/fragments/labels/logitechoptions.sh index d0278d3..bf7c088 100644 --- a/fragments/labels/logitechoptions.sh +++ b/fragments/labels/logitechoptions.sh @@ -1,9 +1,8 @@ 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/' ) - #pkgName="LogiMgr Installer ${appNewVersion}.app/Contents/Resources/LogiMgr.pkg" + downloadURL=$(curl -fs https://support.logi.com/api/v2/help_center/en-us/articles.json | tr "," "\n" | grep -A 10 "macOS" | grep -oie "https.*/.*/options.*\.zip") + appNewVersion=$(curl -fs https://support.logi.com/api/v2/help_center/en-us/articles.json | tr "," "\n" | grep -A 10 "macOS" | grep -B 5 -ie "https.*/.*/options.*\.zip" | grep "Software Version" | sed 's/\\u[0-9a-z][0-9a-z][0-9a-z][0-9a-z]//g' | grep -ioe "Software Version.*[0-9.]*" | tr "/" "\n" | grep -oe "[0-9.]*" | head -1) pkgName="LogiMgr Installer [0-9.]*.app/Contents/Resources/LogiMgr.pkg" expectedTeamID="QED4VVPZWA" ;; From 9b47ed2e3f6c5d4425931b626d1ab524a18d0655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Sun, 9 Jan 2022 10:42:45 +0100 Subject: [PATCH 16/16] `pkgName` can be searched for. In `logitechoptions` we do not know what the app-name is that contains the pkg in the bundle-package, so now we only give the name of the pkg, and then Installomator will find it. --- CHANGELOG.md | 1 + fragments/functions.sh | 32 ++++++++++++++++++++++++----- fragments/header.sh | 2 +- fragments/labels/logitechoptions.sh | 3 ++- 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f87508..065e838 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 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). +- `pkgName` can now be searched for. An example is logitechoptions. ## v8.0 diff --git a/fragments/functions.sh b/fragments/functions.sh index f5d5137..7a4664d 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -543,8 +543,19 @@ installPkgInDmg() { archiveName="${filearray[1]}" printlog "found pkg: $archiveName" else - # it is now safe to overwrite archiveName for installFromPKG - archiveName="$dmgmount/$pkgName" + if ls "$tmpDir/$pkgName" ; then + archiveName="$tmpDir/$pkgName" + else + # try searching for pkg + findfiles=$(find "$tmpDir" -iname "$pkgName") + filearray=( ${(f)findfiles} ) + if [[ ${#filearray} -eq 0 ]]; then + cleanupAndExit 20 "couldn't find pkg “$pkgName” in zip $archiveName" + fi + # it is now safe to overwrite archiveName for installFromPKG + archiveName="${filearray[1]}" + printlog "found pkg: $archiveName" + fi fi # installFromPkgs @@ -564,12 +575,23 @@ installPkgInZip() { if [[ ${#filearray} -eq 0 ]]; then cleanupAndExit 20 "couldn't find pkg in zip $archiveName" fi - archiveName="${filearray[1]}" # it is now safe to overwrite archiveName for installFromPKG + archiveName="${filearray[1]}" printlog "found pkg: $archiveName" else - # it is now safe to overwrite archiveName for installFromPKG - archiveName="$tmpDir/$pkgName" + if ls "$tmpDir/$pkgName" ; then + archiveName="$tmpDir/$pkgName" + else + # try searching for pkg + findfiles=$(find "$tmpDir" -iname "$pkgName") + filearray=( ${(f)findfiles} ) + if [[ ${#filearray} -eq 0 ]]; then + cleanupAndExit 20 "couldn't find pkg “$pkgName” in zip $archiveName" + fi + # it is now safe to overwrite archiveName for installFromPKG + archiveName="${filearray[1]}" + printlog "found pkg: $archiveName" + fi fi # installFromPkgs diff --git a/fragments/header.sh b/fragments/header.sh index c41879d..02a6e89 100644 --- a/fragments/header.sh +++ b/fragments/header.sh @@ -190,7 +190,7 @@ REOPEN="yes" # blockingProcesses=( NONE ) # # - pkgName: (optional, only used for pkgInDmg, dmgInZip, and appInDmgInZip) -# File name of the pkg/dmg file _inside_ the dmg or zip +# File name or path to the pkg/dmg file _inside_ the dmg or zip. # When not given the pkgName is derived from the $name # # - updateTool: diff --git a/fragments/labels/logitechoptions.sh b/fragments/labels/logitechoptions.sh index bf7c088..98bdf6b 100644 --- a/fragments/labels/logitechoptions.sh +++ b/fragments/labels/logitechoptions.sh @@ -3,6 +3,7 @@ logitechoptions) type="pkgInZip" downloadURL=$(curl -fs https://support.logi.com/api/v2/help_center/en-us/articles.json | tr "," "\n" | grep -A 10 "macOS" | grep -oie "https.*/.*/options.*\.zip") appNewVersion=$(curl -fs https://support.logi.com/api/v2/help_center/en-us/articles.json | tr "," "\n" | grep -A 10 "macOS" | grep -B 5 -ie "https.*/.*/options.*\.zip" | grep "Software Version" | sed 's/\\u[0-9a-z][0-9a-z][0-9a-z][0-9a-z]//g' | grep -ioe "Software Version.*[0-9.]*" | tr "/" "\n" | grep -oe "[0-9.]*" | head -1) - pkgName="LogiMgr Installer [0-9.]*.app/Contents/Resources/LogiMgr.pkg" + #pkgName="LogiMgr Installer "*".app/Contents/Resources/LogiMgr.pkg" + pkgName=LogiMgr.pkg expectedTeamID="QED4VVPZWA" ;;