Go to http://www.adobe.com/ca/products/flashplayer/distribution3.html and download the windows ActiveX MSI installer, and the Plug in installer
Also download the latest uninstall_flash_player.exe.
Use the Powershell Application Deployment toolkit.
Create 2 folders for your files : Files and SupportFiles and add with the PSADT toolkit files.
Copy to the Files folder: install_flash_player_22_active_x.msi, install_flash_player_22_plugin.msi, and uninstall_flash_player.exe.
In the SupportFiles folder create and add an mms.cfg file with the following settings:
[box style=”1″]
AutoUpdateInterval=0
AutoUpdateDisable=1
SilentAutoUpdateEnable=0
[/box]
This is to stop auto updates.
Edit the Deploy-Application.ps1 powershell script.
Add the following sections:
[box style=”1″]
##*===============================================
##* VARIABLE DECLARATION
##*===============================================
## Variables: Application
[string]$appVendor = ‘Adobe’
[string]$appName = ‘Flash Player’
[string]$appVersion = ‘22.0.0.209’
[string]$appArch = ”
[string]$appLang = ‘EN’
[string]$appRevision = ’01’
[string]$appScriptVersion = ‘1.0.0’
[string]$appScriptDate = ’08/10/2016′
[string]$appScriptAuthor = ”
##*===============================================
##*===============================================
##* PRE-INSTALLATION
##*===============================================
[string]$installPhase = ‘Pre-Installation’
## Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install, and persist the prompt
Show-InstallationWelcome -CloseApps ‘iexplore,chrome,firefox’ -CloseAppsCountdown 120 -BlockExecution
## Show Progress Message (with the default message)
Show-InstallationProgress
## <Perform Pre-Installation tasks here>
## Uninstall the previous version
## Write-Log “Uninstalling previous version”
Execute-Process -Path ‘uninstall_flash_player.exe’ -Parameters ‘/uninstall’ -WindowStyle Hidden
Start-Sleep -Seconds 240
Remove-File -Path “C:\Windows\SysWOW64\Macromed\Flash\mms.cfg”
Remove-File -Path “C:\Windows\System32\Macromed\Flash\mms.cfg”
Remove-RegistryKey -Key HKLM:\SOFTWARE\Macromedia\FlashPlayer\SafeVersions -Recurse -ContinueOnError:$True
##*===============================================
##* INSTALLATION
##*===============================================
[string]$installPhase = ‘Installation’
## <Perform Installation tasks here>
Execute-MSI -Action Install -Path ‘install_flash_player_22_active_x.msi’
Execute-MSI -Action Install -Path ‘install_flash_player_22_plugin.msi’
##*===============================================
##* POST-INSTALLATION
##*===============================================
[string]$installPhase = ‘Post-Installation’
## <Perform Post-Installation tasks here>
## Execute-MSI -Action Install -Path ‘FlashConfig.msi’
Copy-File -Path “$dirSupportFiles\mms.cfg” -Destination “C:\Windows\SysWOW64\Macromed\Flash\mms.cfg”
Copy-File -Path “$dirSupportFiles\mms.cfg” -Destination “C:\Windows\System32\Macromed\Flash\mms.cfg”
##*===============================================
##* PRE-UNINSTALLATION
##*===============================================
[string]$installPhase = ‘Pre-Uninstallation’
## Show Welcome Message, close Internet Explorer with a 60 second countdown before automatically closing
Show-InstallationWelcome -CloseApps ‘iexplore,chrome,firefox’ -CloseAppsCountdown 60
## Show Progress Message (with the default message)
Show-InstallationProgress
##*===============================================
##* UNINSTALLATION
##*===============================================
[string]$installPhase = ‘Uninstallation’
# <Perform Uninstallation tasks here>
# Use the adobe uninstaller to avoid the 1603 error
Execute-Process -Path ‘uninstall_flash_player.exe’ -Parameters ‘/uninstall’ -WindowStyle Hidden
[/box]
In SCCM the Application is a script install:
Installation Program: “Deploy-Application.exe” -DeployMode “Silent”
Uninstall Program: “Deploy-Application.exe” -DeploymentType “Uninstall” -DeployMode “Silent”
Detection method is the msi of the activex.
Additional Notes:
If you try to uninstall the old version of Flash by using /x {GUID} the install of the new flash will fail with a 1722 error . There is a custom action in their install msi that looks for the HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\FlashPlayer\SafeVersions key and locks it. Adobe does this to stop you from trying to install older versions of Flash. The only way to uninstall it is to use the uninstall_flash_player.exe utility which unlocks the registry key. I have a powershell command added to the script to make sure the key gets deleted but the new msi installer will still display the 1722 error (1603 in SCCM).
Update: Suspecting there was a timing issue between the uninstall and the registry key still being locked, I added “Start-Sleep -Seconds 240” to the script which fixes the problem. Four minutes wait may be overkill but I wanted to be sure.
Leave a Reply