Skip to content

Updates the three Windows Adobe Flash Players (NPAPI and PPAPI in any Windows machine and ActiveX in pre Windows 8.1 machines), if the Player(s) are deemed to be outdated (a Windows PowerShell script).

License

Notifications You must be signed in to change notification settings

auberginehill/update-adobe-flash-player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Update-AdobeFlashPlayer.ps1

OS: Windows
Type: A Windows PowerShell script
Language: Windows PowerShell
Description: Update-AdobeFlashPlayer downloads a list of the most recent Flash version numbers against which it compares the Flash version numbers found on the system and displays, whether a Flash update is needed or not. If a working Internet connection is not found, Update-AdobeFlashPlayer will exit at an early stage without displaying any info apart from what is found on the system. The actual update process naturally needs elevated rights, but if, however, all detected Flash Players seem to be up-to-date, Update-AdobeFlashPlayer will exit before checking, whether it is run elevated or not. Thus, if Update-AdobeFlashPlayer is run in a up-to-date machine in a "normal" PowerShell window, Update-AdobeFlashPlayer will just check that everything is OK and leave without further ceremony.

If Update-AdobeFlashPlayer is run without elevated rights (but with a working Internet connection) in a machine with old Flash versions, it will be shown that a Flash update is needed, but Update-AdobeFlashPlayer will exit with a fail before actually downloading any files or making any changes to the system. To perform an update with Update-AdobeFlashPlayer, PowerShell has to be run in an elevated window (run as an administrator).

If Update-AdobeFlashPlayer is run in an elevated PowerShell window and no Flash is detected, the script offers the option to install one specific version of Flash in two steps in the "Admin Corner", where, in contrary to the main autonomous nature of Update-AdobeFlashPlayer, an end-user input is required.

In the update procedure (if old Flash has been found and Update-AdobeFlashPlayer is run with administrative rights) Update-AdobeFlashPlayer downloads the Flash uninstaller from Adobe and (a) full Flash installer(s) for the type(s) of Flash Player(s) from Adobe, which it has deemed to be outdated and after stopping several Flash-related processes uninstalls the outdated Flash version(s) and installs the downloaded Flash Player(s). Adobe Flash Player is configured by creating a backup of the exisiting configuration file (mms.cfg) and overwriting new settings to the configuration file. After the installation a web page in the default browser is opened for verifying that the Flash Player has been installed correctly. The downloaded files are purged from the hard drive after a while. This script is based on Bob Ross' PowerShell script "Automated Adobe Flash Player Maintenance PowerScript for Public Computing Environment".
Homepage: https://github.com/auberginehill/update-adobe-flash-player
Short URL: http://tinyurl.com/gve9y8s
Version: 1.3
Sources:
Emojis: Emoji Table
Bob Ross: Automated Adobe Flash Player Maintenance PowerScript for Public Computing Environment (or one of the archive.org versions)
ps1: Test Internet connection (or one of the archive.org versions)
Tobias Weltner: PowerTips Monthly vol 8 January 2014 (or one of the archive.org versions)
alejandro5042: How to run exe with/without elevated privileges from PowerShell
Raven Hunter: A little powershell help, Flash Version Query
Kreloc: Get current versions of Adobe Products
chocolatey: Flash Player Plugin
JaredPar and Matthew Pirocchi: What's the best way to determine the location of the current PowerShell script?
lamaar75: Creating a Menu (or one of the archive.org versions)
Downloads: For instance Update-AdobeFlashPlayer.ps1. Or everything as a .zip-file.

Screenshot

        screenshot

Outputs

➡️
  • Displays Flash related information in console. Tries to update outdated Adobe Flash Player(s) to its/their latest version(s), if old Flash Player(s) is/are found and if Update-AdobeFlashPlayer is run in an elevated Powershell window. In addition to that, if such an update procedure is initiated...

  • the Flash Player configuration file (mms.cfg) is overwritten with new parameters and the following backups are made:
    1. Configuration file:

      System File
      32-bit Windows %WINDIR%\System32\Macromed\Flash\mms.cfg
      64-bit Windows %WINDIR%\SysWow64\Macromed\Flash\mms.cfg

      "Original" file, which is created when the script tries to update something for the first time:

      System File
      32-bit Windows %WINDIR%\System32\Macromed\Flash\mms_original.cfg
      64-bit Windows %WINDIR%\SysWow64\Macromed\Flash\mms_original.cfg

      "Backup" file, which is created when the script tries to update something for the second time and which gets overwritten in each successive update cycle:

      System File
      32-bit Windows %WINDIR%\System32\Macromed\Flash\mms_backup.cfg
      64-bit Windows %WINDIR%\SysWow64\Macromed\Flash\mms_backup.cfg

      The %WINDIR% location represents the Windows system directory, such as C:\Windows and may be displayed in PowerShell with the $env:windir variable.

  • To see the actual values that are being written, please see the Step 6 in the script itself, where the original settings are overwritten with the following values:
    1. Value Description
      # [AssetCacheSize = 0 Disables storing the common Flash components]
      AutoUpdateDisable = 1 Disables the Automatic Flash Update
      LegacyDomainMatching = 0 Denies Flash Player 6 and earlier superdomain rules
      LocalFileLegacyAction = 0 Denies Flash Player 7 and earlier local-trusted sandbox
      # [LocalStorageLimit = 1 Disables persistent shared objects]
      SilentAutoUpdateEnable = 0 Disables background updates
      # [ThirdPartyStorage = 0 Denies third-party locally persistent shared objects]

      Most of the settings above may render some web pages broken.

      Lines marked with # are written only if the symbol # is removed from the beginning of the appropriate line inside the source code section (please see the Step 6 in the script itself, about at line ~1111).

      For a comprehensive list of available settings and a more detailed description of the values above, please see the Adobe Flash Player Administration Guide.

  • To open these file locations in a Resource Manager Window, for instance a command

    Invoke-Item $env:windir\System32\Macromed\Flash\

    or

    Invoke-Item $env:windir\SysWOW64\Macromed\Flash\

    may be used at the PowerShell prompt window [PS>].

Notes

⚠️
  • Requires a working Internet connection for downloading a list of the most recent Flash version numbers.

  • Also requires a working Internet connection for downloading a Flash uninstaller and a complete Flash installer(s) from Adobe (but this procedure is not initiated, if the system is deemed up-to-date).
  •             <p>
                    <li>For performing any actual updates with Update-AdobeFlashPlayer, it's mandatory to run this script in an elevated PowerShell window (where PowerShell has been started with the "run as an administrator" option). The elevated rights are needed for uninstalling Flash, installing Flash and for writing the mms.cfg file.</li>
                </p>
                <p>
                    <li>Please also notice that during the actual update phase Update-AdobeFlashPlayer closes a bunch of processes without any further notice in Step 3 and in Step 6 Update-AdobeFlashPlayer alters the Flash configuration file (mms.cfg) so, that for instance, the automatic Flash updates are turned off.</li>
                </p>
                <p>
                    <li>The Flash Player ActiveX control on Windows 8.1 and above is a component of Internet Explorer and Edge and is updated via Windows Update. By using the Flash Player ActiveX installer, Flash Player ActiveX control cannot be installed on Windows 8.1 and above systems. Also, the Flash Player uninstaller doesn't uninstall the ActiveX control on Windows 8.1 and above systems.</li>
                </p>
                <p>
                    <li>Please note that when run in an elevated PowerShell window and old Flash Player(s) is/are detected, Update-AdobeFlashPlayer will automatically try to download files from the Internet without prompting the end-user beforehand or without asking any confirmations (in Step 1 and Step 2).</li>
                </p>
                <p>
                    <li>Please note that the downloaded files are temporarily placed in a directory, which is specified with the <code>$path</code> variable (at line 41).</li>
                </p>
                <p>
                    <li>The <code>$env:temp</code> variable points to the current temp folder. The default value of the <code>$env:temp</code> variable is <code>C:\Users\&lt;username&gt;\AppData\Local\Temp</code> (i.e. each user account has their own separate temp folder at path <code>%USERPROFILE%\AppData\Local\Temp</code>). To see the current temp path, for instance a command
                    <br />
                    <br /><code>[System.IO.Path]::GetTempPath()</code>
                    <br />
                    <br />may be used at the PowerShell prompt window <code>[PS>]</code>. To change the temp folder for instance to <code>C:\Temp</code>, please, for example, follow the instructions at <a href="http://www.eightforums.com/tutorials/23500-temporary-files-folder-change-location-windows.html">Temporary Files Folder - Change Location in Windows</a>, which in essence are something along the lines:
                        <ol>
                           <li>Right click on Computer and click on Properties (or select Start → Control Panel → System). In the resulting window with the basic information about the computer...</li>
                           <li>Click on Advanced system settings on the left panel and select Advanced tab on the resulting pop-up window.</li>
                           <li>Click on the button near the bottom labeled Environment Variables.</li>
                           <li>In the topmost section labeled User variables both TMP and TEMP may be seen. Each different login account is assigned its own temporary locations. These values can be changed by double clicking a value or by highlighting a value and selecting Edit. The specified path will be used by Windows and many other programs for temporary files. It's advisable to set the same value (a directory path) for both TMP and TEMP.</li>
                           <li>Any running programs need to be restarted for the new values to take effect. In fact, probably also Windows itself needs to be restarted for it to begin using the new values for its own temporary files.</li>
                        </ol>
                    </li>
                </p>
            </ul>
        </td>
    </tr>
    

Examples

📖 To open this code in Windows PowerShell, for instance:

  1. ./Update-AdobeFlashPlayer
    Run the script. Please notice to insert ./ or .\ before the script name.
  2. help ./Update-AdobeFlashPlayer -Full
    Display the help file.
  3. Set-ExecutionPolicy remotesigned
    This command is altering the Windows PowerShell rights to enable script execution. Windows PowerShell has to be run with elevated rights (run as an administrator) to actually be able to change the script execution properties. The default value is "Set-ExecutionPolicy restricted".

    Parameters:

      Restricted Does not load configuration files or run scripts. Restricted is the default execution policy.
      AllSigned Requires that all scripts and configuration files be signed by a trusted publisher, including scripts that you write on the local computer.
      RemoteSigned Requires that all scripts and configuration files downloaded from the Internet be signed by a trusted publisher.
      Unrestricted Loads all configuration files and runs all scripts. If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs.
      Bypass Nothing is blocked and there are no warnings or prompts.
      Undefined Removes the currently assigned execution policy from the current scope. This parameter will not remove an execution policy that is set in a Group Policy scope.

    For more information, please type "help Set-ExecutionPolicy -Full" or visit Set-ExecutionPolicy.

  4. New-Item -ItemType File -Path C:\Temp\Update-AdobeFlashPlayer.ps1
    Creates an empty ps1-file to the C:\Temp directory. The New-Item cmdlet has an inherent -NoClobber mode built into it, so that the procedure will halt, if overwriting (replacing the contents) of an existing file is about to happen. Overwriting a file with the New-Item cmdlet requires using the Force.
    For more information, please type "help New-Item -Full".

Contributing

Find a bug? Have a feature request? Here is how you can contribute to this project:

contributing Bugs: Submit bugs and help us verify fixes.
Feature Requests: Feature request can be submitted by creating an Issue.
Edit Source Files: Submit pull requests for bug fixes and features and discuss existing proposals.

www

🌐 Script Homepage
Bob Ross: Automated Adobe Flash Player Maintenance PowerScript for Public Computing Environment (or one of the archive.org versions)
ps1: Test Internet connection (or one of the archive.org versions)
Tobias Weltner: PowerTips Monthly vol 8 January 2014 (or one of the archive.org versions)
alejandro5042: How to run exe with/without elevated privileges from PowerShell
Raven Hunter: A little powershell help, Flash Version Query
Kreloc: Get current versions of Adobe Products
chocolatey: Flash Player Plugin
JaredPar and Matthew Pirocchi: What's the best way to determine the location of the current PowerShell script?
lamaar75: Creating a Menu (or one of the archive.org versions)
Perfect Progress Bars for PowerShell
Adding a Simple Menu to a Windows PowerShell Script
Uninstall method of the Win32_Product class
ASCII Art: http://www.figlet.org/ and ASCII Art Text Generator

Related scripts

www Firefox Customization Files
Get-AsciiTable
Get-BatteryInfo
Get-ComputerInfo
Get-DirectorySize
Get-InstalledPrograms
Get-InstalledWindowsUpdates
Get-RAMInfo
Get-TimeDifference
Get-TimeZoneTable
Get-UnusedDriveLetters
Emoji Table
Java-Update
Rock-Paper-Scissors
Toss-a-Coin

About

Updates the three Windows Adobe Flash Players (NPAPI and PPAPI in any Windows machine and ActiveX in pre Windows 8.1 machines), if the Player(s) are deemed to be outdated (a Windows PowerShell script).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published