Skip to content

Instantly share code, notes, and snippets.

@jps3
Created April 12, 2024 16:09
Show Gist options
  • Save jps3/6b97e84fd73d5598d0c81b30c69e8097 to your computer and use it in GitHub Desktop.
Save jps3/6b97e84fd73d5598d0c81b30c69e8097 to your computer and use it in GitHub Desktop.
Given a version string, download the update DMGs for Acrobat DC and Acrobat Reader DC, and extract *.pkg files
#!/bin/zsh -eux
VERSION="$1" # ex. 24.002.20687
VERSION="${VERSION:gs/\./}" # ex --> 2400220687
curl -LO "https://ardownload2.adobe.com/pub/adobe/reader/mac/AcrobatDC/${VERSION}/AcroRdrDCUpd${VERSION}_MUI.dmg"
curl -LO "https://ardownload2.adobe.com/pub/adobe/acrobat/mac/AcrobatDC/${VERSION}/AcrobatDCUpd${VERSION}.dmg"
ADBTMP="$(mktemp -d)";
ls -1 Acro*.dmg \
| while read -r DMG; do
if [[ -e "$DMG" ]]; then
hdiutil attach -nobrowse -noautoopen -noverify -mountpoint $ADBTMP $DMG \
&& ditto -V $ADBTMP/*.pkg . \
&& hdiutil detach $ADBTMP;
else
echo "Unable to find DMG '$DMG'???";
fi;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment