tis-remove-flashplayer

1.3-13
Remove all Adobe Flash Player versions
501 downloads
Download

  Description 

  • package : tis-remove-flashplayer
  • version : 1.3-13
  • architecture : all
  • categories : Internet,Media
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
  • description : Remove all Adobe Flash Player versions
  • locale : all
  • target_os : windows
  • min_os_version : 5.1
  • max_os_version :
  • min_wapt_version : 1.7
  • sources : https://fpdownload.macromedia.com/get/flashplayer/current/support/uninstall_flash_player.exe
  • installed_size :
  • impacted_process :
  • description_fr : Supprime toutes les versions d'Adobe Flash Player
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence :
  • signature_date : 2021-01-05T15:17:19.354680
  • Homepage : https://helpx.adobe.com/flash-player/kb/uninstall-flash-player-windows.html
  • Conflicts :

  Setup.py 

# -*- coding: utf-8 -*-
from setuphelpers import *
import platform

uninstallkey = []

# Update for Removal of Adobe Flash Player for Windows (KB4577586)

""" 
Sources: 
https://helpx.adobe.com/flash-player/kb/uninstall-flash-player-windows.html
https://blogs.windows.com/msedgedev/2020/09/04/update-adobe-flash-end-support/
https://www.catalog.update.microsoft.com/search.aspx?q=4577586

"""

class WindowsVersions(object):
    """Helper class to get numbered windows version from windows name version

    ... versionadded:: 1.3.5

    .. versionchanged:: 1.9
        Adding Windows 10.0 and newer versions

    """
    # https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx
    # https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241(v=vs.85).aspx

    Windows10v20H2 = Version('10.0.19042',3)
    Windows10v2009 = Version('10.0.19042',3)
    Windows10v2004 = Version('10.0.19041',3)
    Windows10v1909 = Version('10.0.18363',3)
    Windows10v1903 = Version('10.0.18362',3)
    Windows10v1809 = Version('10.0.17763',3)
    Windows10v1803 = Version('10.0.17134',3)
    Windows10v1709 = Version('10.0.16299',3)
    Windows10v1703 = Version('10.0.15063',3)
    Windows10v1607 = Version('10.0.14393',3)
    Windows10v1511 = Version('10.0.10586',3)
    Windows10v1507 = Version('10.0.10240',3)
    Windows10 = Version('10.0',2)

    WindowsServer2019 = Version('10.0.17763',3)
    WindowsServer2016 = Version('10.0.14393',3)
    WindowsServer2016TechnicalPreview = Version('10.0',2)

    Windows81 = Version('6.3', 2)
    WindowsServer2012R2 = Version('6.3', 2)

    Windows8 = Version('6.2', 2)
    WindowsServer2012 = Version('6.2', 2)

    Windows7 = Version('6.1', 2)
    WindowsServer2008R2 = Version('6.1', 2)

    WindowsServer2008 = Version('6.0', 2)
    WindowsVista = Version('6.0', 2)

    WindowsServer2003R2 = Version('5.2', 2)
    WindowsServer2003 = Version('5.2', 2)
    WindowsXP64 = Version('5.2', 2)

    WindowsEmbeddedStandard2009 = WindowsXP = Version('5.1', 2)
    WindowsXP = Version('5.1', 2)

    Windows2000 = Version('5.0', 2)


# Defining variables
kbs_dict = [
{
    "dl_url" : "http://download.windowsupdate.com/c/msdownload/update/software/updt/2020/10/windows10.0-kb4577586-x64_c9bb49df325c20ddc147137b3f769fa44d800dde.msu",
    "kb_name" : "windows10.0-kb4577586-x64_c9bb49df325c20ddc147137b3f769fa44d800dde.msu",
    "win_vers": WindowsVersions.Windows10v20H2,
    "arch" : "x64"
},
{
    "dl_url" : "http://download.windowsupdate.com/d/msdownload/update/software/updt/2020/10/windows10.0-kb4577586-x86_238da6b730a3f6a709f31980b87e2d8ecb0a8973.msu",
    "kb_name" : "windows10.0-kb4577586-x86_238da6b730a3f6a709f31980b87e2d8ecb0a8973.msu",
    "win_vers": WindowsVersions.Windows10v20H2,
    "arch" : "x86"
},
{
    "dl_url" : "http://download.windowsupdate.com/d/msdownload/update/software/updt/2020/10/windows10.0-kb4577586-x86_238da6b730a3f6a709f31980b87e2d8ecb0a8973.msu",
    "kb_name" : "windows10.0-kb4577586-x86_238da6b730a3f6a709f31980b87e2d8ecb0a8973.msu",
    "win_vers": WindowsVersions.Windows10v2004,
    "arch" : "x64"
},
{
    "dl_url" : "http://download.windowsupdate.com/c/msdownload/update/software/updt/2020/10/windows10.0-kb4577586-x64_ec16e118cd8b99df185402c7a0c65a31e031a6f0.msu",
    "kb_name" : "windows10.0-kb4577586-x64_ec16e118cd8b99df185402c7a0c65a31e031a6f0.msu",
    "win_vers": WindowsVersions.Windows10v1909,
    "arch" : "x64"
},
{
    "dl_url" : "http://download.windowsupdate.com/c/msdownload/update/software/updt/2020/10/windows10.0-kb4577586-x86_002b1ffa7fb31836aeaed74007a6949d31a96460.msu",
    "kb_name" : "windows10.0-kb4577586-x86_002b1ffa7fb31836aeaed74007a6949d31a96460.msu",
    "win_vers": WindowsVersions.Windows10v1909,
    "arch" : "x86"
},
{
    "dl_url" : "http://download.windowsupdate.com/c/msdownload/update/software/updt/2020/10/windows10.0-kb4577586-x64_ec16e118cd8b99df185402c7a0c65a31e031a6f0.msu",
    "kb_name" : "windows10.0-kb4577586-x64_ec16e118cd8b99df185402c7a0c65a31e031a6f0.msu",
    "win_vers": WindowsVersions.Windows10v1903,
    "arch" : "x64"
},
{
    "dl_url" : "http://download.windowsupdate.com/c/msdownload/update/software/updt/2020/10/windows10.0-kb4577586-x86_002b1ffa7fb31836aeaed74007a6949d31a96460.msu",
    "kb_name" : "windows10.0-kb4577586-x86_002b1ffa7fb31836aeaed74007a6949d31a96460.msu",
    "win_vers": WindowsVersions.Windows10v1903,
    "arch" : "x86"
},
{
    "dl_url" : "http://download.windowsupdate.com/c/msdownload/update/software/updt/2020/10/windows10.0-kb4577586-x64_d0f434327db9e3308b86591c248c825c03687632.msu",
    "kb_name" : "windows10.0-kb4577586-x64_d0f434327db9e3308b86591c248c825c03687632.msu",
    "win_vers": WindowsVersions.Windows10v1809,
    "arch" : "x64"
},
{
    "dl_url" : "http://download.windowsupdate.com/d/msdownload/update/software/updt/2020/10/windows10.0-kb4577586-x86_947f151a8bb5a0b0797702e53431c52d56c02c32.msu",
    "kb_name" : "windows10.0-kb4577586-x86_947f151a8bb5a0b0797702e53431c52d56c02c32.msu",
    "win_vers": WindowsVersions.Windows10v1809,
    "arch" : "x86"
},



{
    "dl_url" : "http://download.windowsupdate.com/d/msdownload/update/software/updt/2020/10/windows8.1-kb4577586-x64_1c039dbdafaf12e9163e8d56cf578cc998306ecd.msu",
    "kb_name" : "windows8.1-kb4577586-x64_1c039dbdafaf12e9163e8d56cf578cc998306ecd.msu",
    "win_vers": WindowsVersions.Windows81,
    "arch" : "x64"
},
{
    "dl_url" : "http://download.windowsupdate.com/d/msdownload/update/software/updt/2020/10/windows8.1-kb4577586-x86_d81dcb42a9b91d279c0b7510669bc0d556288fd3.msu",
    "kb_name" : "windows8.1-kb4577586-x86_d81dcb42a9b91d279c0b7510669bc0d556288fd3.msu",
    "win_vers": WindowsVersions.Windows81,
    "arch" : "x86"
}


]
bin_name_uninstaller = 'uninstall_flash_player.exe'
silent_uninst_args = '-uninstall'
app_name = 'Adobe Flash Player'
schtasks_to_delete = ['Adobe Flash Player Updater','Adobe Flash Player PPAPI Notifier']
services_to_delete = ['AdobeFlashPlayerUpdateSvc']
processes_to_kill = ['firefox.exe','iexplore.exe','opera.exe','chrome.exe']


def install():
    # Initializing variables
    if iswin64():
        arch = "x64"
        app_dir = makepath(os.environ['SYSTEMROOT'],'SysWOW64','Macromed','Flash')
        app_macromed_dir = makepath(os.environ['SYSTEMROOT'],'SysWOW64','Macromed')
    else:
        arch = "x86"
        app_dir = makepath(os.environ['SYSTEMROOT'],'System32','Macromed','Flash')
        app_macromed_dir = makepath(os.environ['SYSTEMROOT'],'System32','Macromed')
    bin_app_path_w10 = makepath(app_dir, 'FlashUtil_ActiveX.exe')

    # Uninstalling Adobe Flash Player
    if installed_softwares(name=app_name):
        killalltasks(processes_to_kill)
    run('"%s" %s' % (makepath(basedir, bin_name_uninstaller), silent_uninst_args))

    # Deleting Scheduled Tasks
    for task in schtasks_to_delete:
        if task_exists(task):
            try:
                delete_task(task)
            except:
                print("Unable to delete the task: %s" % task)

    # Deleting Service
    for service in services_to_delete:
        if service_installed(service):
            try:
                service_delete(service)
            except:
                print("Unable to delete the service: %s" % service)

    # Uninstalling IE Adobe Flash Player on Windows 8+ with KB
    if windows_version() >= WindowsVersions.Windows8:
        for kb_dict in kbs_dict:
            if kb_dict['win_vers']  == windows_version(members_count=3) and kb_dict['arch'] == arch:
                kb_file = kb_dict['kb_name']
                kb_nb = kb_file.split('-')[1]
                break
        if kb_nb:
            with EnsureWUAUServRunning():
                if not is_kb_installed(kb_nb):
                    print("Installing {}".format(kb_file))
                    killalltasks('iexplore.exe')
                    run('wusa.exe "{}" /quiet /norestart'.format(kb_file),accept_returncodes=[0,3010,2359302,-2145124329],timeout=3600)
                else:
                    print("{} already installed".format(kb_file))
        else:
            print("This Windows 10 version is not handled, you have to complete this package (complete the kbs_dict)")

    # Removing remaining files if acceptable
    if isdir(app_dir):
        for binary_w7 in glob.glob(makepath(app_dir, '*')): # FlashPlayerPlugin_32_0_0_xxx.exe
            if binary_w7.startswith('FlashPlayerPlugin_') and binary_w7.endswith('.exe'):
                bin_app_path_w7 = binary_w7
                break
            else:
                bin_app_path_w7 = makepath(app_dir, 'filenotfound.exe')
        if isfile(bin_app_path_w10) or isfile(bin_app_path_w7):
            print("WARNING: %s seems not fully uninstalled" % app_name)
        else:
            remove_tree(app_macromed_dir)
    else:
        if isdir(app_macromed_dir):
            remove_tree(app_macromed_dir)


def audit():
    # Initializing variables
    if iswin64():
        app_dir = makepath(os.environ['SYSTEMROOT'],'SysWOW64','Macromed','Flash')
    else:
        app_dir = makepath(os.environ['SYSTEMROOT'],'System32','Macromed','Flash')

    # Auditing the package
    if installed_softwares(name=app_name):
        print("ERROR: %s is still installed" % app_name)
        return "ERROR"

    if isdir(app_dir):
        print("WARNING: The directory %s remain, Flash may not be uninstalled for IE" % app_dir)
        return "WARNING"

    if not installed_softwares(name=app_name):
        print("OK: %s is not detected on the system" % app_name)
        return "OK"


def update_package():
    # Initializing variables
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    version = control.version.split('-')[0]

    # Downloading latest binaries
    wget('https://fpdownload.macromedia.com/get/flashplayer/current/support/uninstall_flash_player.exe', bin_name_uninstaller, proxies=proxies)
    # Windows KB's
    for dl_kb in kbs_dict:
        if not isfile(dl_kb['kb_name']):
            wget(dl_kb['dl_url'], dl_kb['kb_name'], proxies=proxies)

    # Changing version of the package
    control.version = '%s-%s'%(version,int(control.version.split('-')[-1])+1)
    control.save_control_to_wapt()
    print('Changing package version to: %s in WAPT\\control' % control.version)




def get_proxies():
    if platform.python_version_tuple()[0] == '3':
        from urllib.request import getproxies
    else:
        from urllib import getproxies
    return getproxies()


def get_proxies_from_wapt_console():
    proxies = {}
    if platform.system() == 'Windows':
        waptconsole_ini_path = makepath(user_local_appdata(), 'waptconsole', 'waptconsole.ini')
    else:
        waptconsole_ini_path = makepath(user_home_directory(), '.config', 'waptconsole', 'waptconsole.ini')
    if isfile(waptconsole_ini_path):
        proxy_wapt = inifile_readstring(waptconsole_ini_path, 'global', 'http_proxy')
        if proxy_wapt:
            proxies = {'http': proxy_wapt, 'https': proxy_wapt}
    return proxies


def is_kb_installed(hotfixid):
    """Return True or False depending if a Windows update KB is installed.
    """
    installed_update = installed_windows_updates()
    if [kb for kb in installed_update if kb['HotFixID'].upper() == hotfixid.upper()]:
        return True
    return False


										

  Changelog 


Changelog software url : https://helpx.adobe.com/flash-player/flash-player-releasenotes.html

No changelog
  manifest.sha256 
[["setup.py","7a48ba3df615a413ca2c49e50a4a35a414f58b89e57807bbbf6e54214d068372"],["uninstall_flash_player.exe","3590bab42e7fc1cde971831c3f0c126c6e4f5de1a403b0136a345a553bd90149"],["WAPT/certificate.crt","a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf"],["WAPT/icon.png","281b20deb99b5aa039466aac2e0b02aea20d8674ee8505b64605d53a930194ea"],["windows10.0-kb4577586-x64_c9bb49df325c20ddc147137b3f769fa44d800dde.msu","aeb36b1da67941e8eaaabaf5810110ab522281d76c28bfa388cdb321e7690dd0"],["windows10.0-kb4577586-x64_d0f434327db9e3308b86591c248c825c03687632.msu","2bbc518b7799119d30198c01c0f708f8a4149e3acfbb41864e07a834df5f92e9"],["windows10.0-kb4577586-x64_ec16e118cd8b99df185402c7a0c65a31e031a6f0.msu","51d34dd037b548a2556107870d5688ddb0f1f8215d3c048bf983d9ea06bcd68c"],["windows10.0-kb4577586-x86_002b1ffa7fb31836aeaed74007a6949d31a96460.msu","5108ca0b7ae80645b20e079123d59c89cd28571f981625f8721714d73c40c12a"],["windows10.0-kb4577586-x86_238da6b730a3f6a709f31980b87e2d8ecb0a8973.msu","04d97db9ab06d6fc1c31bfd640a16475b886ba2dcf7e5379e68e2290619f43ff"],["windows10.0-kb4577586-x86_947f151a8bb5a0b0797702e53431c52d56c02c32.msu","5a581738c84d4585dfecd2f5bf22791951a0d80330c4f518a473af90cc458050"],["windows8.1-kb4577586-x64_1c039dbdafaf12e9163e8d56cf578cc998306ecd.msu","b18531e4e4ee622b4928b3398d844a306b8fa97cced00ab5d3ff1f311be289b1"],["windows8.1-kb4577586-x86_d81dcb42a9b91d279c0b7510669bc0d556288fd3.msu","a730a317580364dbe6f41b88d1036cc4e933f520325ea45ace081f19755b039b"],["WAPT/control","aaee3a68942807ce412ce1621aecfe70cb0fff362179bd8db9180912b0b7bdfe"]]