Skip to main content
Solved

PPAPI version check / update script?


Forum|alt.badge.img+7
  • Contributor
  • 94 replies

Anyone know of a PPAPI check / update script? I've searched all over with no luck.

Best answer by Wakko

Robert,

Try this out, it's what I've been using on my JumpStarts. It's something we found JAMFNation and been updating as needed.

By default, it will not install flash on a machine that does not have it so you can scope to All if you wish without worrying installing on a system which Flash is purposely kept off. If you would like to override this behavior and install Flash as part of a thin-imaging policy, then edit the script and remove the ## on the following lines.

Line 93 ##
Update_Flash
Line 116 ##
Update_Flash

Also, Lines 119-161, will set System Preferences > Flash > Updates to “Never Check for Updates".

1#!/bin/sh
2## Created by Ariel Peralta - Carbon Technologies, 31-May-2016
3## Original by Peter Loobuyck, 26-Jan-2016
4## Inspired by https://jamfnation.jamfsoftware.com/discussion.html?id=7658
5## Update 15-Jan-2017
6## This scripts take into consideration new Adobe download URLs as per https://www.jamf.com/jamf-nation/discussions/7658/flash-update-script
7## Removed old download URLs, shortver variable, and updated fileURL variables
8
9## Name of the temporary dmg that will be created when Adobe Flash Installer is downloaded.
10## This file will be automatically created and deleted after installation
11flash_dmg="/tmp/FlashInstaller.dmg"
12
13# Specify a /tmp/flash_update.XXXX mountpoint for the disk image
14TMPMOUNT=`/usr/bin/mktemp -d /tmp/flash_update.XXXX`
15
16## This Function will take defined variables and install Flash
17Update_Flash () {
18 ## Compare the two versions, if they are different of Flash download and install the new version.
19 if [ "${currentinstalledver}" != "${latestver}" ]; then
20 /bin/echo "`date`: Current Flash ${FlashType} version: ${currentinstalledver}"
21 /bin/echo "`date`: Available Flash ${FlashType} version: ${latestver}"
22 /bin/echo "`date`: Downloading newer ${FlashType} version."
23
24 # Download and Mount Flash Plugin disk image to /tmp/flash_update.XXXX mountpoint
25 /usr/bin/curl -S -# -o "$flash_dmg" "$fileURL"
26 /bin/echo "`date`: Mounting installer disk image."
27 hdiutil attach "$flash_dmg" -mountpoint "$TMPMOUNT" -nobrowse -noverify -noautoopen
28
29 # Before installation, the installer's developer certificate is checked to
30 # see if it has been signed by Adobe's developer certificate. Once the
31 # certificate check has been passed, the package is then installed.
32
33 if [[ "${pkg_path}" != "" ]]; then
34 signature_check=`/usr/sbin/pkgutil --check-signature "$pkg_path" | awk /'Developer ID Installer/{ print $5 }'`
35 if [[ ${signature_check} = "Adobe" ]]; then
36 # Install Flash from the installer package stored inside the disk image
37 /bin/echo "`date`: Installing..."
38 /usr/sbin/installer -pkg "${pkg_path}" -target "/"
39 fi
40 fi
41
42 # Clean-up
43
44 # Unmount the Flash disk image from /tmp/flash_update.XXXX
45 /bin/sleep 10
46 /bin/echo "`date`: Unmounting installer disk image."
47 /usr/bin/hdiutil detach -force "$TMPMOUNT"
48
49 # Remove the /tmp/flash_update.XXXX mountpoint
50 /bin/sleep 10
51 /bin/echo "`date`: Deleting disk image."
52 /bin/rm -rf "$TMPMOUNT"
53
54 # Remove the downloaded disk image
55 /bin/rm -rf "$flash_dmg"
56
57 # Check to see if update was successful
58 newlyinstalledver=`/usr/bin/defaults read "${plugincheck}" CFBundleShortVersionString`
59 if [ "${latestver}" = "${newlyinstalledver}" ]; then
60 /bin/echo "`date`: SUCCESS: Flash ${FlashType} has been updated to version ${newlyinstalledver}"
61 else
62 /bin/echo "`date`: ERROR: Flash ${FlashType} update unsuccessful, version remains at ${currentinstalledver}."
63 /bin/echo "--"
64 fi
65
66 ## If Flash is up to date already, just log it and exit.
67 else
68 /bin/echo "`date`: Flash ${FlashType} Plug-in is already up to date, running ${currentinstalledver}."
69 /bin/echo "--"
70 fi
71}
72
73## Set NPAPI Variables
74## Query Adobe Flash Updater XML page and return latest version in decimal form
75latestver=`/usr/bin/curl --silent http://fpdownload2.macromedia.com/get/flashplayer/update/current/xml/version_en_mac_pl.xml | awk -F " /"update version="/'{print $2}' | sed s/,/./g`
76fileURL=https://fpdownload.adobe.com/get/flashplayer/pdc/"${latestver}"/install_flash_player_osx.dmg
77plugincheck="/Library/Internet Plug-Ins/Flash Player.plugin/Contents/info"
78pkg_path=$TMPMOUNT/Install Adobe Flash Player.app/Contents/Resources/Adobe Flash Player.pkg
79FlashType=NPAPI
80
81## Check and get the version number of the currently-installed Flash Player NPAPI Plugin, if any.
82if
83 [ -e "${plugincheck}.plist" ]; then
84 currentinstalledver=`/usr/bin/defaults read "${plugincheck}" CFBundleShortVersionString`
85 ## Calling function to update NPAPI plugin
86 Update_Flash
87else
88 /bin/echo "`date`: No Flash NPAPI Plug-in Installed."
89 /bin/echo "--"
90 currentinstalledver=none
91 ## Remove ## From Line below if you want to force Flash Install on new systems during thin-imaging
92## Update_Flash
93
94fi
95
96## Set PPAPI Variables
97latestver=`/usr/bin/curl --silent http://fpdownload2.macromedia.com/get/flashplayer/update/current/xml/version_en_mac_pep.xml | awk -F " /"update version="/'{print $2}' | sed s/,/./g`
98fileURL=https://fpdownload.adobe.com/get/flashplayer/pdc/"${latestver}"/install_flash_player_osx_ppapi.dmg
99plugincheck="/Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin/Contents/info"
100pkg_path=$TMPMOUNT/Install Adobe Pepper Flash Player.app/Contents/Resources/Adobe Flash Player.pkg
101FlashType=PPAPI
102
103## Check and get the version number of the currently-installed Flash Player PPAPI (Pepper) Plugin, if any.
104if
105 [ -e "${plugincheck}.plist" ]; then
106 currentinstalledver=`/usr/bin/defaults read "${plugincheck}" CFBundleShortVersionString`
107 ## Find latest version of Flash
108 ## Calling function to update PPAPI plugin
109 Update_Flash
110else
111 /bin/echo "`date`: No Flash PPAPI Plug-in Installed."
112 /bin/echo "--"
113 currentinstalledver=none
114 ## Remove ## From Line below if you want to force Flash Install on new systems during thin-imaging
115## Update_Flash
116fi
117
118# Configure Adobe Flash to *not* update
119# This will set the preference for both NPAPI and PPAPI
120#
121# Modified by Ariel Peralta, 31-May-2016
122# Modified by Carlos Echevarria, 7-Apr-2016
123# Modified by Chris Jackson, 3-Mar-2016
124# Original by Dan K. Snelson, 7-Nov-2014
125#
126# Inspired by Lance Berrier
127# https://jamfnation.jamfsoftware.com/viewProfile.html?userID=12774
128
129directory="/Library/Application Support/Macromedia/"
130file="/Library/Application Support/Macromedia/mms.cfg"
131
132if [ -f "$file" ] ; then
133
134 # Flash Player is installed, has been launched and mms.cfg exists
135 # let's configure it to not update
136
137 grep -q -r "AutoUpdateDisable" "$file" && sed -i '' 's/AutoUpdateDisable=0|AutoUpdateDisable=1/AutoUpdateDisable=1/g' "$file" || echo "AutoUpdateDisable=1" >> "$file"
138 grep -q -r "SilentAutoUpdateEnable" "$file" && sed -i '' 's/SilentAutoUpdateEnable=0|SilentAutoUpdateEnable=1/SilentAutoUpdateEnable=0/g' "$file" || echo "SilentAutoUpdateEnable=0" >> "$file"
139 grep -q -r "DisableAnalytics" "$file" && sed -i '' 's/DisableAnalytics=0|DisableAnalytics=1/DisableAnalytics=1/g' "$file" || echo "DisableAnalytics=1" >> "$file"
140
141 RESULT="Configured Adobe Flash Update Preferences to Never Check for Updates"
142
143else
144 ## Only create update override if flash is installed. If no flash is installed by this point, then leave alone.
145 if [ -e "${plugincheck}.plist" ] ; then
146 # mms.cfg doesn't exsist, but flash is installed
147 mkdir "${directory}"
148
149 echo "AutoUpdateDisable=1" >> "$file"
150 echo "SilentAutoUpdateEnable=0" >> "$file"
151 echo "DisableAnalytics=1" >> "$file"
152
153 RESULT="Created and configured Adobe Flash Update Preferences to Never Check for Updates"
154
155 else
156 echo "No Plugin installed, no changes made to Adobe Flash Update Preferences"
157 fi
158fi
159
160echo "$RESULT"
View original
Did this topic help you find an answer to your question?

9 replies

Wakko
Forum|alt.badge.img+19
  • Valued Contributor
  • 89 replies
  • Answer
  • March 29, 2017

Robert,

Try this out, it's what I've been using on my JumpStarts. It's something we found JAMFNation and been updating as needed.

By default, it will not install flash on a machine that does not have it so you can scope to All if you wish without worrying installing on a system which Flash is purposely kept off. If you would like to override this behavior and install Flash as part of a thin-imaging policy, then edit the script and remove the ## on the following lines.

Line 93 ##
Update_Flash
Line 116 ##
Update_Flash

Also, Lines 119-161, will set System Preferences > Flash > Updates to “Never Check for Updates".

1#!/bin/sh
2## Created by Ariel Peralta - Carbon Technologies, 31-May-2016
3## Original by Peter Loobuyck, 26-Jan-2016
4## Inspired by https://jamfnation.jamfsoftware.com/discussion.html?id=7658
5## Update 15-Jan-2017
6## This scripts take into consideration new Adobe download URLs as per https://www.jamf.com/jamf-nation/discussions/7658/flash-update-script
7## Removed old download URLs, shortver variable, and updated fileURL variables
8
9## Name of the temporary dmg that will be created when Adobe Flash Installer is downloaded.
10## This file will be automatically created and deleted after installation
11flash_dmg="/tmp/FlashInstaller.dmg"
12
13# Specify a /tmp/flash_update.XXXX mountpoint for the disk image
14TMPMOUNT=`/usr/bin/mktemp -d /tmp/flash_update.XXXX`
15
16## This Function will take defined variables and install Flash
17Update_Flash () {
18 ## Compare the two versions, if they are different of Flash download and install the new version.
19 if [ "${currentinstalledver}" != "${latestver}" ]; then
20 /bin/echo "`date`: Current Flash ${FlashType} version: ${currentinstalledver}"
21 /bin/echo "`date`: Available Flash ${FlashType} version: ${latestver}"
22 /bin/echo "`date`: Downloading newer ${FlashType} version."
23
24 # Download and Mount Flash Plugin disk image to /tmp/flash_update.XXXX mountpoint
25 /usr/bin/curl -S -# -o "$flash_dmg" "$fileURL"
26 /bin/echo "`date`: Mounting installer disk image."
27 hdiutil attach "$flash_dmg" -mountpoint "$TMPMOUNT" -nobrowse -noverify -noautoopen
28
29 # Before installation, the installer's developer certificate is checked to
30 # see if it has been signed by Adobe's developer certificate. Once the
31 # certificate check has been passed, the package is then installed.
32
33 if [[ "${pkg_path}" != "" ]]; then
34 signature_check=`/usr/sbin/pkgutil --check-signature "$pkg_path" | awk /'Developer ID Installer/{ print $5 }'`
35 if [[ ${signature_check} = "Adobe" ]]; then
36 # Install Flash from the installer package stored inside the disk image
37 /bin/echo "`date`: Installing..."
38 /usr/sbin/installer -pkg "${pkg_path}" -target "/"
39 fi
40 fi
41
42 # Clean-up
43
44 # Unmount the Flash disk image from /tmp/flash_update.XXXX
45 /bin/sleep 10
46 /bin/echo "`date`: Unmounting installer disk image."
47 /usr/bin/hdiutil detach -force "$TMPMOUNT"
48
49 # Remove the /tmp/flash_update.XXXX mountpoint
50 /bin/sleep 10
51 /bin/echo "`date`: Deleting disk image."
52 /bin/rm -rf "$TMPMOUNT"
53
54 # Remove the downloaded disk image
55 /bin/rm -rf "$flash_dmg"
56
57 # Check to see if update was successful
58 newlyinstalledver=`/usr/bin/defaults read "${plugincheck}" CFBundleShortVersionString`
59 if [ "${latestver}" = "${newlyinstalledver}" ]; then
60 /bin/echo "`date`: SUCCESS: Flash ${FlashType} has been updated to version ${newlyinstalledver}"
61 else
62 /bin/echo "`date`: ERROR: Flash ${FlashType} update unsuccessful, version remains at ${currentinstalledver}."
63 /bin/echo "--"
64 fi
65
66 ## If Flash is up to date already, just log it and exit.
67 else
68 /bin/echo "`date`: Flash ${FlashType} Plug-in is already up to date, running ${currentinstalledver}."
69 /bin/echo "--"
70 fi
71}
72
73## Set NPAPI Variables
74## Query Adobe Flash Updater XML page and return latest version in decimal form
75latestver=`/usr/bin/curl --silent http://fpdownload2.macromedia.com/get/flashplayer/update/current/xml/version_en_mac_pl.xml | awk -F " /"update version="/'{print $2}' | sed s/,/./g`
76fileURL=https://fpdownload.adobe.com/get/flashplayer/pdc/"${latestver}"/install_flash_player_osx.dmg
77plugincheck="/Library/Internet Plug-Ins/Flash Player.plugin/Contents/info"
78pkg_path=$TMPMOUNT/Install Adobe Flash Player.app/Contents/Resources/Adobe Flash Player.pkg
79FlashType=NPAPI
80
81## Check and get the version number of the currently-installed Flash Player NPAPI Plugin, if any.
82if
83 [ -e "${plugincheck}.plist" ]; then
84 currentinstalledver=`/usr/bin/defaults read "${plugincheck}" CFBundleShortVersionString`
85 ## Calling function to update NPAPI plugin
86 Update_Flash
87else
88 /bin/echo "`date`: No Flash NPAPI Plug-in Installed."
89 /bin/echo "--"
90 currentinstalledver=none
91 ## Remove ## From Line below if you want to force Flash Install on new systems during thin-imaging
92## Update_Flash
93
94fi
95
96## Set PPAPI Variables
97latestver=`/usr/bin/curl --silent http://fpdownload2.macromedia.com/get/flashplayer/update/current/xml/version_en_mac_pep.xml | awk -F " /"update version="/'{print $2}' | sed s/,/./g`
98fileURL=https://fpdownload.adobe.com/get/flashplayer/pdc/"${latestver}"/install_flash_player_osx_ppapi.dmg
99plugincheck="/Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin/Contents/info"
100pkg_path=$TMPMOUNT/Install Adobe Pepper Flash Player.app/Contents/Resources/Adobe Flash Player.pkg
101FlashType=PPAPI
102
103## Check and get the version number of the currently-installed Flash Player PPAPI (Pepper) Plugin, if any.
104if
105 [ -e "${plugincheck}.plist" ]; then
106 currentinstalledver=`/usr/bin/defaults read "${plugincheck}" CFBundleShortVersionString`
107 ## Find latest version of Flash
108 ## Calling function to update PPAPI plugin
109 Update_Flash
110else
111 /bin/echo "`date`: No Flash PPAPI Plug-in Installed."
112 /bin/echo "--"
113 currentinstalledver=none
114 ## Remove ## From Line below if you want to force Flash Install on new systems during thin-imaging
115## Update_Flash
116fi
117
118# Configure Adobe Flash to *not* update
119# This will set the preference for both NPAPI and PPAPI
120#
121# Modified by Ariel Peralta, 31-May-2016
122# Modified by Carlos Echevarria, 7-Apr-2016
123# Modified by Chris Jackson, 3-Mar-2016
124# Original by Dan K. Snelson, 7-Nov-2014
125#
126# Inspired by Lance Berrier
127# https://jamfnation.jamfsoftware.com/viewProfile.html?userID=12774
128
129directory="/Library/Application Support/Macromedia/"
130file="/Library/Application Support/Macromedia/mms.cfg"
131
132if [ -f "$file" ] ; then
133
134 # Flash Player is installed, has been launched and mms.cfg exists
135 # let's configure it to not update
136
137 grep -q -r "AutoUpdateDisable" "$file" && sed -i '' 's/AutoUpdateDisable=0|AutoUpdateDisable=1/AutoUpdateDisable=1/g' "$file" || echo "AutoUpdateDisable=1" >> "$file"
138 grep -q -r "SilentAutoUpdateEnable" "$file" && sed -i '' 's/SilentAutoUpdateEnable=0|SilentAutoUpdateEnable=1/SilentAutoUpdateEnable=0/g' "$file" || echo "SilentAutoUpdateEnable=0" >> "$file"
139 grep -q -r "DisableAnalytics" "$file" && sed -i '' 's/DisableAnalytics=0|DisableAnalytics=1/DisableAnalytics=1/g' "$file" || echo "DisableAnalytics=1" >> "$file"
140
141 RESULT="Configured Adobe Flash Update Preferences to Never Check for Updates"
142
143else
144 ## Only create update override if flash is installed. If no flash is installed by this point, then leave alone.
145 if [ -e "${plugincheck}.plist" ] ; then
146 # mms.cfg doesn't exsist, but flash is installed
147 mkdir "${directory}"
148
149 echo "AutoUpdateDisable=1" >> "$file"
150 echo "SilentAutoUpdateEnable=0" >> "$file"
151 echo "DisableAnalytics=1" >> "$file"
152
153 RESULT="Created and configured Adobe Flash Update Preferences to Never Check for Updates"
154
155 else
156 echo "No Plugin installed, no changes made to Adobe Flash Update Preferences"
157 fi
158fi
159
160echo "$RESULT"

Forum|alt.badge.img+6
  • Contributor
  • 103 replies
  • March 30, 2017

Very nice!


Wakko
Forum|alt.badge.img+19
  • Valued Contributor
  • 89 replies
  • March 30, 2017

@KSchroeder it originated from JAMFNation. We just updated and tweaked it bit.


Forum|alt.badge.img+7
  • Author
  • Contributor
  • 94 replies
  • April 19, 2017

@Echevarria

Great script, thanks for sharing!


nvandam
Forum|alt.badge.img+9
  • Valued Contributor
  • 88 replies
  • May 8, 2017

How do you all have this scoped?


hunter990
Forum|alt.badge.img+8
  • Contributor
  • 38 replies
  • May 10, 2017

Awesome script, thank you. I do have a question, as of version 25.0.0.173 I am finding it is not disabling the settings for auto update. I have tinkered with it some, but I am still learning at scripting, and not sure what I am missing. Is anyone else having this issue?

@nvandam I have this scoped with 2 versions of the script. One I use a smart group based off of Patch Management to update when a new version comes out.

I have another edit of the script that sits in Self Service for users to install.


daniel_ross
Forum|alt.badge.img+18
  • Jamf Heroes
  • 199 replies
  • May 17, 2017

Just noticed the site is broken when it tries to go it fails to update.

Anyone know the new URL for downloads?


Forum|alt.badge.img+5
  • Contributor
  • 26 replies
  • December 14, 2017
2017-12-14 08:31:14.725 defaults[11300:2614099] The domain/default pair of (/Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin/Contents/info, CFBundleShortVersionString) does not exist

Forum|alt.badge.img+1
  • New Contributor
  • 3 replies
  • May 4, 2018

RESULT="Not Installed"

if [ -f "/Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin/Contents/Info.plist" ] ; then RESULT=$( /usr/bin/defaults read "/Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin/Contents/Info.plist" CFBundleVersion )
fi

echo "<result>$RESULT</result>"


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings