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)
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.
i cannot access adobe distribution to download flash player files. may you please share these files ? - mohammadravaghi 7 years ago
Do yourself a huge favor, don't try it in the production environment :) - emilchik 7 years ago
########################################
#Flash Player Preinstall Cleanup Script#
# Creation Date: 01/15/2017 #
# Version: 24 #
# Author: Stephen Wheeler #
########################################
$CurVer = "FlashPlayer_24.0.194"
Start-transcript -path C:\Log\SCRIPTS\FlashPlayer_DetailedLog.txt -noClobber -Append
#This is calling the "Flashutil" application to attempt to uninstall the currently installed version of Flash Player.
Write-Host "First Off we are going to politely ask Flash Player to remove itself.`r"
$Flashutil = (Get-Childitem C:\Windows\system32\Macromed\Flash\FlashUtil*ActiveX.exe -name)
$FlashTest = (Test-Path C:\Windows\system32\Macromed\Flash\FlashUtil*ActiveX.exe)
$Flashutil1 = (Get-Childitem C:\Windows\system32\Macromed\Flash\FlashUtil*Plugin.exe -name)
$FlashTest1 = (Test-Path C:\Windows\system32\Macromed\Flash\FlashUtil*Plugin.exe)
IF ($FlashTest -eq $True)
{
Start-Process -FilePath "C:\Windows\system32\Macromed\Flash\$Flashutil" -Argumentlist "-uninstall" -ErrorAction SilentlyContinue
Write-host "Successfully ran ActiveX Uninstaller`r"
}
ELSE
{
Write-Host "ActiveX Plugin is Not coming off nicely`r"
}
IF ($FlashTest1 -eq $True)
{
Start-Process -FilePath "C:\Windows\system32\Macromed\Flash\$Flashutil1" -Argumentlist "-uninstall" -ErrorAction SilentlyContinue
Write-host "Successfully ran NPAPI Uninstaller`r"
}
ELSE
{
Write-Host "NPAPI plugin is Not coming off nicely`r"
}
#When MSIEXEC is running it causes problems with the installation of Flash, there for I am having it forcivly end it, if it is running.
Write-Host "Attempting to Terminate msiexec.exe`r"
$Process = Get-Process msiexec -ErrorAction SilentlyContinue
if ($Process -eq $True) {Stop-Process - msiexec -Force -ErrorAction SilentlyContinue}
#These are the GUIDs of each version of FlashPlayer and they can be found by Searching "Flash Player" in this Key: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
#There is one for the ActiveX and one for NPAPI Plugin
#When Building a new Flash Plackage you just need to add the 2 new GUIDs to this list.
$GUID = @("{56680CC0-AA4D-47DB-A1A3-B26A97F1D3F1}",
"{22AF9D99-A980-4071-A0BD-1D0BB956B9EA}",
"{1D95F7C4-A547-4FC9-91A4-A35B19F597C0}",
"{D633DF27-FC9E-4FDA-A158-CB36AE83671D}",
"{58E533B1-9B29-432D-BB38-25B489C1D53B}",
"{9B0163AC-7E34-4A2F-A3E6-73440FF9549B}",
"{0A9A57A9-8D6E-4CBD-9434-A244E94D2154}",
"{559A2FA4-4858-46E7-BD02-68C15A31DF98}",
"{6E6D2BB7-B844-4842-B62D-0A7F0AA7884E}",
"{CE102F76-8858-4CA8-B500-030C9A735C8A}",
"{26E87568-C135-4C53-A3D9-62EC26C2D7A1}",
"{07ABFA96-7AFE-43C2-9BC2-1005C24D2316}",
"{3898EF12-76AA-4116-BFCE-EA063420B9E2}",
"{84562166-378E-40C3-8937-FEAB57BD34C1}",
"{CCF44D05-A254-49E9-A024-33D37C37962D}",
"{7754B002-6B0F-4343-AAB9-20615AE6D7E1}",
"{401B651E-4CCC-4177-B16D-1B88EC9FDFB3}",
"{B4A59659-1E69-4286-8885-3D0618B84894}",
"{37CFB473-A66E-490E-8ED2-07C984BC42F5}",
"{8C3EAB4F-199B-456B-9840-9A95FDBAE125}",
"{D0AFDE5A-16FE-40B0-908D-63A5F23A3E7F}",
"{B2239F96-D221-45C4-81C7-386E9DB84DEB}",
"{4B4910C8-4D59-4AC2-9E72-15B9D91CEBB2}",
"{87FB4D1F-413A-4F3F-AAD9-0B130A02BA61}",
"{1C1655A5-8B59-421E-ABCC-9182956510DC}",
"{A7DC9721-4986-4179-BB89-A3E99545584C}",
"{92C34178-B679-4C83-AC33-7EFCE6D36E01}",
"{0608F2B6-4E49-4AD0-9128-C122A34CFCE1}",
"{7B0961DB-15EB-41AF-85DA-C296924CA408}",
"{7898389E-2B8F-4CAC-A8CB-489B7B339C03}",
"{FB7D053D-9F6F-4E16-96BE-D2EF54C620AC}",
"{8B4393AD-53A8-4895-803D-3AEECD99D620}",
"{D21D7AFD-8DF3-4EF0-B81B-A2AA5AEFE713}",
"{0C942CD9-6F38-498A-808F-C76EDBBA1969}",
"{89D2A20B-74C2-4A70-B598-AA4F4DFC0EBF}",
"{1F427911-1A3C-4264-967B-7DE6070FD8FC}",
"{FDAF247B-4ADD-4089-A799-B08206B8E75C}",
"{AC08189D-DBCB-40DB-8B36-0AC5F1B115BD}",
"{70F0F88A-387B-40EB-93BD-9877DB9D668D}",
"{A186F2B3-64FC-4A3C-8096-B002A71F2A9B}",
"{EE56217C-B3F9-402B-B4EC-63F090F51D3D}",
"{2F881898-5300-4D68-AE46-F5FE074D59AA}",
"{44CF4DB9-707A-4395-839C-573FBC206CB9}",
"{A6FB0BFC-1F3F-42E0-BEAB-FA139FB54812}",
"{A580818A-6519-4120-AB1C-F4F6FCFAA7D0}",
"{A4488E5C-1022-432A-8066-72E1C4023310}",
"{9F5C6A1A-3B30-4AD5-B998-2885AA7C26A7}",
"{2448A347-6E10-4FDE-AD25-74804743D184}",
"{901E9B21-CDB1-4C4A-ABFC-61A554912BED}",
"{B0069674-D80C-48CB-852D-88AD36EAB0A5}",
"{57B3953E-BB96-418D-9228-57B7082B921A}",
"{76CF5170-31B4-490F-89CE-5820EF416822}",
"{B3DADA45-F0ED-48FD-946E-7E82C2229D59}",
"{448D7DEC-36F1-4091-B419-C5487BDEB867}",
"{7AF47D49-5F6B-4646-84FA-5802C635B082}",
"{DE3DB02A-3402-4CC4-AF65-B52AE8406739}",
"{D10AEF4A-DD94-4F6C-9CBF-580C1A1F6D05}",
"{9755D61E-3FC8-479D-BAD7-5516E0FE5281}",
"{AD6E9D76-C6AA-4F6E-8DAE-4EEE78B78743}",
"{8656EDBE-7C0A-4945-8D49-493FDBE7B5BD}",
"{521CCA6C-F8FD-47ED-AF9A-2461352E34DD}",
"{0699CBD6-FFF5-4211-97A7-9C32E744F5F4}",
"{BD2339D5-5609-4DB0-A89F-D427B7B353E1}",
"{63A147A7-55F5-4305-A09C-696781D58B8A}",
"{5682D3D7-0E22-4AC5-8DAD-5375A1F7B313}",
"{BABDDB46-341A-460E-8F65-83C9B0BF7329}",
"{AA4C5C0F-AE8D-4760-A513-F2F3109D8C9E}",
"{2755BEE9-F03B-4FB8-BB71-0BA3F2629F18}",
"{506B121D-1B93-484D-8241-6250BCB736C7}",
"{44C61B0B-3700-4AA6-AC7C-EE8F0BA9A907}",
"{4EF54F47-BD29-4049-AEAF-A80E494A6A45}",
"{F22C3C05-B1D9-47FF-AA17-4F9DCBFE850F}",
"{8C901387-B304-404D-93C0-E2E0C2D53D90}",
"{61F2FFE4-56BA-4F5E-91FB-BD34F92E44CE}",
"{B21D5938-6B90-408B-B827-92F6E0E11B48}",
"{70F97130-DBF6-4885-854C-CC7A80FC65E1}",
"{DC0C27E6-745B-4D0E-A2F7-47676BFAE25D}",
"{2BE0DC49-FA94-4853-A62A-F1E02ECAA67E}",
"{D901557E-8AF2-4F66-BE3C-B8C816397BD5}",
"{465571A6-29A2-4D39-B77D-3A1F6C964B65}",
"{1D55DE93-486D-40F7-88F3-CF08578F82AA}",
"{68BC8140-3FAA-4419-B6EE-CCF60BE6DAB2}",
"{10F0B906-1989-4F20-A93C-4C0F94C8DF9E}",
"{6CBBF19C-2B69-4143-81C4-D5B56D32088C}",
"{047904BA-C065-40D5-969A-C7D91CA93D62}",
"{BC8AC77D-6A6F-491F-BEED-2958F09C6CAE}",
"{AF82C1A9-56DC-4CCD-A36C-CAE56D541DFA}",
"{3CA17ADC-2146-49C2-A375-972BB57CF7F6}",
"{7C548501-3501-468A-A443-CC42F5B3626B}",
"{F1410A0A-8205-4D45-BF2B-9C7ACB2F4B24}",
"{C4B32291-F7B2-4BEC-BA4D-4195676A08CC}",
"{3FC9A6DE-C105-4576-8F63-656FFB1BF8EB}")
#These are the SIDs of each version of FlashPlayer and they can be found by Searching "Flash Player" in this Key: HKLM:\SOFTWARE\CLASSES\Installer\Features\.
#There is one for the ActiveX and one for NPAPI Plugin.
#When Building a new Flash Plackage you just need to add the 2 new SIDs to this list.
$SID = @("3958907FC4F2C234CAF8D696CDE9DF9C",
"4C7F59D1745A9CF4194A3AB5915F790C",
"68FB4E4C72E4B8B4B89F5AFBC157374A",
"88A5DA2B41709D446828DEEC7176C1FD",
"F2E02C08FE4B8E44FBA4A626A5A91F86",
"0CC08665D4AABD741A3A2BA6791F3D1F",
"99D9FA22089A17040ADBD1B09B659BAE",
"4C7F59D1745A9CF4194A3AB5915F790C",
"72FD336DE9CFADF41A85BC63EA3876D1",
"1B335E8592B9D234BB83524B981C5DB3",
"CA3610B943E7F2A43A6E3744F09F45B9",
"9A75A9A0E6D8DBC449432A449ED41245",
"7BB2D6E6448B24846BD2A0F7A07A88E4",
"67F201EC85888AC45B0030C0A937C5A8",
"86578E62531C35C43A9D26CE622C7D1A",
"69AFBA70EFA72C34B92C01502CD43261",
"67F201EC85888AC45B0030C0A937C5A8",
"21FE8983AA676114FBECAE6043029B2E",
"50D44FCC452A9E940A42333DC77369D2",
"66126548E8733C049873EFBA75DB431C",
"E156B104CCC477141BD6B188CEF9FD3B",
"200B4577F0B63434AA9B0216A56E7D1E",
"95695A4B96E168248858D360818B8449",
"374BFC73E66AE094E82D709C48CB245F",
"F4BAE3C8B991B6548904A959DFAB1E52",
"A5EDFA0DEF610B0409D8365A2FA3E3F7",
"8C0194B495D42CA4E927519B9DC1BE2B",
"69F9322B122D4C54187C83E6D98BD4BE",
"F1D4BF78A314F3F4AA9DB031A020AB16",
"5A5561C195B8E124BACC1928595601CD",
"0418CB86AAF391446BEECC6FB06EAD2B",
"1279CD7A68949714BB983A9E595485C4",
"19223B4C2B7FCEB4ABD4145976A680CC",
"1E36145BD4A3BEE4189FAF44B9E3831B",
"39ED55D1D6847F04883FFC8075F828AA",
"4769600BC08DBC8458D288DA63AE0B5A",
"4EFF2F16AB65E5F419BFDB439FE244EC",
"54ADAD3BDE0FDF8449E6E7282C22D995",
"5E8B1F381BB60934C9712D391F430FEB",
"609B0F01989102F49AC3C4F0498CFDE9",
"6B2F806094E40DA419821C223AC4CF1E",
"87143C29976B38C4CA33E7CF6E3DE610",
"898188F2003586D4EA645FEF70D495AA",
"9BD4FC44A707593438C975F3CB02C69B",
"9DC249C083F6A89408F87CE6BDAB9196",
"A818085A91560214BAC14F6FCFAF7A0D",
"B02A2D982C4707A45B89AAF4D4CFE0FB",
"B0B16C4400736AA4CAC7EEF8B09A9A70",
"C5E8844A2201A2340866271E4C203301",
"C71265EE9F3BB2044BCE360F095FD1D3",
"C91FBBC696B23414184C5D5BD62380C8",
"CED7D8441F6319044B915C84B7ED8B76",
"CFB0BF6AF3F10E24EBBAAF31F95B8421",
"D350D7BFF6F961E469EB2DFE456C02CA",
"DFA7D12D3FD80FE48BB12AAAA5FE7E31",
"ED6A9CF3501C6754F83656F6BFB18FBE")
#Removing all the records for any previous version.
Write-Host "Removing the Macromedia Key $(get-date -format `"yyyyMMdd_hhmmsstt`")`r"
$flash1 = (Test-Path -Path "HKLM:\SOFTWARE\Macromedia\FlashPlayer")
$Flash2 = (Test-Path -Path "HKLM:\SOFTWARE\WOW6432Node\Macromedia\FlashPlayer")
$Flash5 = (Test-Path -Path "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player ActiveX")
if ($Flash1 -eq $True) {Write-Host "Successfully Deleted HKLM:\SOFTWARE\Macromedia\FlashPlayer `r"
Remove-Item -path "HKLM:\SOFTWARE\Macromedia\FlashPlayer" -Recurse -ErrorAction SilentlyContinue}
if ($Flash2 -eq $True) {Write-Host "Successfully Deleted HKLM:\SOFTWARE\WOW6432Node\Macromedia\FlashPlayer`r"
Remove-Item -path "HKLM:\SOFTWARE\WOW6432Node\Macromedia\FlashPlayer" -Recurse -ErrorAction SilentlyContinue}
if ($Flash5 -eq $True) {Write-Host "Successfully Deleted HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player ActiveX`r"
Remove-Item -path "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player ActiveX" -Recurse -ErrorAction SilentlyContinue}
Write-Host "Searching for and deleting any previous version of Flash. $(get-date -format `"yyyyMMdd_hhmmsstt`")`r"
foreach ($GUIDS in $GUID)
{
$regPath2= "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$GUIDS"
$value2 = (Test-Path $regpath2)
$regPath64= "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$GUIDS"
$value64 = (Test-Path $regpath64)
if ($value2 -eq $True) {Write-Host "Successfully Deleted $Regpath2`r"
Remove-Item -path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$GUIDS" -Recurse -ErrorAction SilentlyContinue}
if ($value64 -eq $True) {Write-Host "Successfully Deleted $Regpath64`r"
Remove-Item -path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$GUIDS" -Recurse -ErrorAction SilentlyContinue}
#I couldnt get this one to check whether the file exists because its a value instead of a key, so I am just suppressing errors and having it try to delete any of the versions.
$UIPath = "C:\Windows\Installer\$GUIDS\"
Remove-ItemProperty -Path "hklm:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders" -name $UIPath -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "hklm:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Installer\Folders" -name $UIPath -ErrorAction SilentlyContinue
}
Write-Host "Deleted all the GUIDs that were present, now searching for and deleting SIDs. $(get-date -format `"yyyyMMdd_hhmmsstt`")`r"
foreach ($SIDS in $SID) {
$sidpath1 = "HKLM:\SOFTWARE\CLASSES\Installer\Features\$SIDS"
$Sidtest1 = (Test-Path $Sidpath1)
if ($sidtest1 -eq $True){Write-Host "Successfully Deleted $sidpath1`r"
Remove-Item -path $sidpath1 -Recurse -ErrorAction SilentlyContinue}
$Sidpath2 = "HKLM:\SOFTWARE\Classes\Installer\Products\$SIDS"
$Sidtest2 = (Test-Path $Sidpath2)
if ($sidtest2 -eq $True){Write-Host "Successfully Deleted $sidpath2`r"
Remove-Item -path $sidpath2 -Recurse -ErrorAction SilentlyContinue}
$Sidpath3 = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\$SIDS"
$SidTest3 = (Test-Path $Sidpath3)
if ($sidtest3 -eq $True){Write-Host "Successfully Deleted $sidpath3`r"
Remove-Item -path $sidpath3 -Recurse -ErrorAction SilentlyContinue}
$Sidpath4 = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\$SIDS"
$Sidtest4 = (Test-Path $Sidpath4)
if ($sidtest4 -eq $True){Write-Host "Successfully Deleted $sidpath4`r"
Remove-Item -path $sidpath4 -Recurse -ErrorAction SilentlyContinue}
$sidpath641 = "HKLM:\SOFTWARE\Wow6432Node\CLASSES\Installer\Features\$SIDS"
$Sidtest641 = (Test-Path $Sidpath1)
if ($sidtest641 -eq $True){Write-Host "Successfully Deleted $sidpath1`r"
Remove-Item -path $sidpath641 -Recurse -ErrorAction SilentlyContinue}
$Sidpath642 = "HKLM:\SOFTWARE\Wow6432Node\Classes\Installer\Products\$SIDS"
$Sidtest642 = (Test-Path $Sidpath642)
if ($sidtest642 -eq $True){Write-Host "Successfully Deleted $sidpath642`r"
Remove-Item -path $sidpath642 -Recurse -ErrorAction SilentlyContinue}
$Sidpath643 = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\$SIDS"
$SidTest643 = (Test-Path $Sidpath3)
if ($sidtest643 -eq $True){Write-Host "Successfully Deleted $sidpath643`r"
Remove-Item -path $sidpath643 -Recurse -ErrorAction SilentlyContinue}
$Sidpath644 = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\$SIDS"
$Sidtest644 = (Test-Path $Sidpath644)
if ($sidtest644 -eq $True){Write-Host "Successfully Deleted $sidpath644`r"
Remove-Item -path $sidpath644 -Recurse -ErrorAction SilentlyContinue}
}
#Now Just to run the installs
Write-Host "Flash is removed"
Stop-Transcript - swheeler911 7 years ago
Thanks for your post.
At one point I did use something similar to remove older versions, but it became too labor intensive to search up and maintain SIDs for each version of the Flash player Adobe releases.
That's why I decided to go with WMI query of the installed programs.
You're welcome to use anything you want in your deployments, but I found that simpler scripts work better, plus you don't have to maintain the list of those SIDs every time Adobe decides to spit out another version of the Flash player.
I also tried using Adobe provided "remover utility". But it didn't work for me because you can not specify the version of the software to keep. Since I was deploying two applications, first application was deployed fine, but once the second application started to run and Uninstall utility is running before Install of the new Flash player run, it removes the first application. In other words, If ActiveX version is installed first, then Add-on starts an installation, it removes the ActiveX version. - emilchik 7 years ago
Instantiate the windows installer object
Read in all the installed MSI apps
Search each app name for Adobe flash
Get the app guid
Run the msiexec uninstall using the guid
Rinse and repeat.
No code maintenance necessary. - EdT 7 years ago
https://helpx.adobe.com/flash-player/kb/uninstall-flash-player-windows.html
I have just a basic batch that calls this and then the Exe installer for flash (which you can find on the troubleshooting page) - doug.austin 7 years ago
One question though... is it absolutely mandatory to quit IE when installing the latest version.
In fact, i have been overinstalling for the longest now (up to version 24.0.0.194) and i do not have issue with old versions of flash. But we just got this new toy (SCCM) and i want to kick the tires.
Additionally we were not quitting IE and having positive results of the flash player being updated on next launch - soberone 7 years ago
I noticed two things while deploying flash. Ocasionally, if IE has page with flash elements, it will fail deployment, that's why I close it.
Another one, Adobe uninstall tool also corrupts other installation. If your plug-in version is installed first , ActiveX install with that tool running will corrupt it. And another way around.
Cheers - emilchik 7 years ago