Updated 2/8/2017: Just used the same script with minor modification of file names and log names in the script. It still worked as intended for latest version 24.0.0.194 both ActiveX and Plug-In.


I have been managing software deployments and updates/patching with SCCM 2012 (latest version 1607) in our organization with about 5300 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 is installed. During my testing I tried to deploy Adobe Acrobat Reader DC to replace Reader 11 and Adobe Flash Player 23.0.0.185 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 23). 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 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


#Uninstall older version of Flash ActiveX
Get-WmiObject -Class Win32_Product | Where-Object {($_.Name -LIKE "*Flash*ActiveX*") -And ($_.Vendor -LIKE "*Adobe*")} | Foreach-Object {
  $UninstallFlashArgs= "/x", "`"$($_.IdentifyingNumber)`"", "/qn", "/L*v `"C:\Windows\Logs\Adobe_Flash_ActiveX_Uninstall.log`""
  Start-Process msiexec.exe -ArgumentList $UninstallFlashArgs -Wait
  $UninstallFlashArgs=$Null 
  }

Try    {
$FlushActiveXInstallArgs="/i","`"$PSScriptRoot\install_flash_player_23_active_x.msi`"","/qn","/L*v C:\Windows\Logs\Adobe_Flash_ActiveX_23.0.0.205_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
Get-Process | ? { $_.ProcessName -match 'FlashUtil' } | Stop-Process -Force

#Un-Install all versions of Adobe Flash Players
Get-WmiObject -Class Win32_Product | Where-Object {($_.Name -LIKE "*Flash*NPAPI*") -And ($_.Vendor -LIKE "*Adobe*")} | Foreach-Object {
  $UninstallFlashArgs= "/x", "`"$($_.IdentifyingNumber)`"", "/qn", "/L*v `"C:\Windows\Logs\Adobe_Flash_PlugIn_Uninstall.log`""
  Start-Process msiexec.exe -ArgumentList $UninstallFlashArgs -Wait -ErrorAction Stop -ErrorVariable ErrorDescription
  $UninstallFlashArgs=$Null 
  } 

# Install_Flash_Player_22_plugin.msi for all versions of Windows ( 7, 8, 8.1, 10 )
Try    {
$FlushPlugInInstallArgs="/i","`"$PSScriptRoot\install_flash_player_23_plugin.msi`"","/qn","/L*v C:\Windows\Logs\Adobe_Flash_PlugIn_Install_23.0.0.205.log"
Start-Process -FilePath msiexec.exe -ArgumentList $FlushPlugInInstallArgs -Wait 
$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) in the same folder:

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


I created my source directory for this application and placed all files in there. 

After downloading .msi installer files from Adobe distribution site into the same source directory on your network source location I  had 5 files in the same folder:xDX7V4.bmp


Once all files are ready, I created 2 applications: one for Adobe Flash Player ActiveX (for IE), and 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 directory 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:

pwtBVt.bmp


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

k3Xpgu.bmp


Here is how my Deployment type looks like:

WkOiz3.bmp

net0qN.bmp


sNt6Y1.bmp

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

( 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: msiexec /x {6E6D2BB7-B844-4842-B62D-0A7F0AA7884E} /q (that code could change if you have different version of the installer .msi file or different language) - just browse to that .msi file during creation of the Application wizard to get correct code auto-generated here.     


Detection Method was automatically generated during the Create Application Wizard too. 

YDrwxD.bmp


MdZlDk.bmp

tz8y1s.bmp

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

Adobe Flash Player ActiveX cannot be installed on Windows 8.x 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 checks for all older versions of the apps, uninstalls them then installs new version.

r13ucw.bmp        


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


P.S. I use those powershell scripts with some minor modifications to deploy other software. It captures return code of the .msi installer and passes it the SCCM. Some installers (not those for Adobe Flash players described above) require computer reboot. By modifying return codes (which is passes on the script end), depending on that return code in the Application Deployment Type properties you can configure to let SCCM handle reboots during deployment configuration. 


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.