We recently had a requirement to ensure all laptops were running the latest version v22 of Adobe Flash on our Windows 7 laptops, and a quick query in SCCM showed 95% were on version 21 which was good, but a number were stuck on version 10 and 11! A lot of troubleshooting later and it turns out that the uninstall of these versions was the cause, as it was leaving behind some registry entries that caused the new version to fail installation.
After combining a few vbs scripts I came up with the following vbs script that removes the registry entries in order for the uninstall to complete, and the install to work. If you need to alter it, locate the GUID HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\xxx where xxx is the adobe flash installation. the sub keys will tell you whether it is or not.
removeRegTraces.vbs
'this script removes remnants of flash player from SOFTWARE\Classes\Installer\Products\ On Error Resume Next Const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set objRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") 'adobe flash 10.3.183.5 strKeyPath = "SOFTWARE\Classes\Installer\Products\C4DD4D27947025346BE3A7C7296834E0" if KeyExists(HKEY_LOCAL_MACHINE, strKeyPath) = True then DeleteSubkeys HKEY_LOCAL_MACHINE, strKeypath end if 'adobe flash 11.0.1.152 strKeyPath = "SOFTWARE\Classes\Installer\Products\03797D32A1CEE534388FAABEEF25730B" if KeyExists(HKEY_LOCAL_MACHINE, strKeyPath) = True then DeleteSubkeys HKEY_LOCAL_MACHINE, strKeypath end if ' adobe flash 16.0.0.305 strKeyPath = "SOFTWARE\Classes\Installer\Products\0418CB86AAF391446BEECC6FB06EAD2B" if KeyExists(HKEY_LOCAL_MACHINE, strKeyPath) = True then DeleteSubkeys HKEY_LOCAL_MACHINE, strKeypath end if Sub DeleteSubkeys(HKEY_LOCAL_MACHINE, strKeyPath) objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys If IsArray(arrSubkeys) Then For Each strSubkey In arrSubkeys DeleteSubkeys HKEY_LOCAL_MACHINE, strKeyPath & "\" & strSubkey Next End If objRegistry.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath End Sub Function KeyExists(Key, KeyPath) Dim oReg: Set oReg = GetObject("winmgmts:!root/default:StdRegProv") If oReg.EnumKey(Key, KeyPath, arrSubKeys) = 0 Then KeyExists = True Else KeyExists = False End If End Function
Along with uninstall_flash_player.exe http://download.macromedia.com/get/flashplayer/current/support/uninstall_flash_player.exe
And an mms.cfg file to stop auto updates I managed to get it complete successfully, and now all 1000 windows 7 machines are upgrading fine 🙂
Here is the mms.cfg file contents
SilentAutoUpdateEnable=0 AutoUpdateDisable=1
And the batch file that is run that carries out all the above actions.
@echo off "%~dp0uninstall_flash_player.exe" -uninstall @call cscript "%~dp0removeRegTraces.vbs" msiexec /i "%~dp0install_flash_player_22_active_x.msi" /qn del /s c:\Windows\System32\Macromed\Flash\mms.cfg copy /y "%~dp0mms.cfg" c:\Windows\System32\Macromed\Flash
upgrade folder contents