Update 10/10/2017: The script and instructions were updated to reflect latest versions of SCCM and Adobe Flash Player versions.


I have been managing software deployments and updates/patching with SCCM 2012 (latest version 1607) in our organization with about 5500 workstations in the production environment. We have 3rd party software (Shavlik) installed to manage software updates, but I noticed that it is not always perfect for situations where multiple major versions of the software are installed. During my testing, I tried to deploy Adobe Acrobat Reader DC to replace Reader 11 and Adobe Flash Player 27.0.0.130 replace older versions of Flash (we had some old ones like 13, 15, 18, 21, 22).  After the patches deployment, I noticed that it will bring up the patch level to the current one , given it's been approved and downloaded in Shavlik. In other words, it will not upgrade the major version of the product ( from Adobe Reader 11 to DC , or from Flash 18 to 27). Configuring SCCM application with just plain .msi installer also doesn't remove older major versions of the Flash players.

So, I had to come up with the solution to remove older version and install new one during the deployment process. 

   I decided to use powershell script to handle that installation/upgrade process, and then deploy it within an application (not the package or Task Sequence). 

Here are two scripts I used to deploy (ActiveX and Plug-in): 

Install_Flash_ActiveX.ps1:

if(!$PSScriptRoot){ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent } #In case if $PSScriptRoot is empty (Older version of powershell).  

#Close all open instances of Internet Explorer
Get-Process | ? { $_.ProcessName -match 'msiexec' } | Stop-Process -Force
Get-Process | ? { $_.ProcessName -match 'FlashUtil' } | Stop-Process -Force
(New-Object -COM "Shell.Application").Windows() | ? { $_.Name -like "*Internet Explorer*" } | % { $_.Quit()
     [Runtime.Interopservices.Marshal]::ReleaseComObject($_) }
[GC]::Collect()
[GC]::WaitForPendingFinalizers()
Get-Process | ? { $_.ProcessName -match 'iexplor' } | Stop-Process -Force

$PlugInUnInstallArgs="-uninstall","activex"
Start-Process -FilePath "$PSScriptRoot\uninstall_flash_player.exe" -ArgumentList $PlugInUnInstallArgs -Wait


#Installing Adobe Flash Player 27.0.0.130 ActiveX
Try    {
$FlushActiveXInstallArgs="/i","`"$PSScriptRoot\install_flash_player_27_active_x.msi`"","/qn","/L*v C:\Windows\Logs\Adobe_Flash_ActiveX_27.0.0.130_Install.log"
Start-Process msiexec.exe -ArgumentList $FlushActiveXInstallArgs -Wait -ErrorAction Stop -ErrorVariable ErrorDescription
$Result= [System.Environment]::ExitCode
If (!(Test-Path -Path 'C:\Program Files (x86)')) { Copy-Item -Path `"$PSScriptRoot\mms.cfg`" -Destination C:\Windows\System32\Macromed\Flash\mms.cfg -Force } Else {Copy-Item -Path `"$PSScriptRoot\mms.cfg`" -Destination C:\Windows\SysWow64\Macromed\Flash\mms.cfg -Force}
       }

Catch  {
        $Result = [System.Environment]::Exitcode
        [System.Environment]::Exit($Result)
       }

[System.Environment]::Exit($Result)

Install_Flash_PlugIn.ps1:
if(!$PSScriptRoot){ $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent } #In case if $PSScriptRoot is empty (Older version of powershell).  

#Close all open instances of MSIExec.exe and open Flash Player
Get-Process | ? { $_.ProcessName -match 'msiexec' } | Stop-Process -Force -ErrorAction SilentlyContinue
Get-Process | ? { $_.ProcessName -match 'FlashUtil' } | Stop-Process -Force -ErrorAction SilentlyContinue

$PlugInUnInstallArgs="-uninstall","plugin"
Start-Process -FilePath "$PSScriptRoot\uninstall_flash_player.exe" -ArgumentList $PlugInUnInstallArgs -Wait

# Install install_flash_player_27_plugin.msi for all versions of Windows ( 7, 8, 8.1, 10 )
Try    {
$FlushPlugInInstallArgs="/i","`"$PSScriptRoot\install_flash_player_27_plugin.msi`"","/qn","/L*v C:\Windows\Logs\Adobe_Flash_PlugIn_Install_27.0.0.130.log"
Start-Process -FilePath msiexec.exe -ArgumentList $FlushPlugInInstallArgs -Wait -ErrorAction Stop
$Result= [System.Environment]::ExitCode

If (!(Test-Path -Path 'C:\Program Files (x86)')) { Copy-Item -Path `"$PSScriptRoot\mms.cfg`" -Destination C:\Windows\System32\Macromed\Flash\mms.cfg -Force } Else {Copy-Item -Path `"$PSScriptRoot\mms.cfg`" -Destination C:\Windows\SysWow64\Macromed\Flash\mms.cfg -Force}
 }

Catch  {
        $Result = [System.Environment]::Exitcode
        [System.Environment]::Exit($Result)
       }
       
[System.Environment]::Exit($Result)

I also have mms.cfg file (config file that disabled Auto-updates) and the uninstaller (can be downloaded here: https://helpx.adobe.com/flash-player/kb/uninstall-flash-player-windows.html ) in the same folders:

AutoUpdateDisable = 1  #Disables Auto-Update of Adobe Flash Player 


I created my source directories for these applications and placed all files in there. 

After downloading .msi installer files from Adobe distribution site and uninstaller into the source directories on the network source locations I  had 4 files in each folder:



Once all files and folders are ready, I created 2 applications: one for Adobe Flash Player ActiveX (for IE), and the second one for Adobe Flash Player Plug-In ( for Firefox, etc.). 

For each application, I started Create Application Wizard and followed all steps pointing to correct location and the .MSI installer (for ...Active_x.msi or ...Plugin.msi in the directories above). After its completed, I just modified  Application Catalog, User Experience, and Requirements (not to deploy on Windows 8.x or Windows 10 for ActiveX - Plug-In version can be deployed to Windows 8.x and 10) and Programs of the Deployment Type to start correct .ps1 scripts with powershell.  

Here how ActiveX app properties look like:



You can use your favorite search engine to look for and download Icon for your application to be displayed in the Software Center.



Here is how my Deployment type looks like:






As for the Installation program, I have this command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -file .\Install_Flash_ActiveX.ps1

Or for the PlugIn version: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -file .\Install_Flash_PlugIn.ps1

( Keep in mind, If your company policy for powershell execution is set for signed or remote signed, make sure to modify the install command to reflect that and sign those PS script files).

And for uninstall program: uninstall_flash_player.exe -uninstall activex   (or for the PlugIn version: uninstall_flash_player.exe -uninstall plugin  )


Detection Method was automatically generated during the Create Application Wizard. 






In the Requirements tab, I limit deployments only to those Operating Systems: Windows XP, Vista, 7, 8. 


Adobe Flash Player ActiveX cannot be installed on Windows 8.1 and Windows 10 with .msi installer. They should be upgraded with Windows Update.   


You can specify Application Supersedence If you have older versions of the Flash Player deployed with SCCM. Please note that this selection is irrelevant to which version will be uninstalled with the script. It will just mark this application as superseding one of those older versions you might have deployed prior. When you deploy that script, you don't have to worry about making sure that "Uninstall Program" of your old Applications Types works.  Powershell script removes all older versions of the apps, then installs new versions.

       


Above screenshots are for the creating ActiveX version of the Flash player. Create other versions of the Flash player with some modifications.


After applications are created, distribute content to your Distribution points, retire old versions of the Adobe Flash Player applications and deploy your new Applications. Also, If you install Flash Player during OS Deployment, don't forget to update your Task Sequences to install your latest applications. 


Feel free to use those scripts and techniques in your deployments. and let me know If you have better ways deploy those upgrades of older apps.