tis-flashplayer 26.0.0.151-2

  • package : tis-flashplayer
  • version : 26.0.0.151-2
  • description : Adobe Flashplayer pour Internet Explorer et autres navigateurs Firefox, Chrome (install closes all browsers)
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • date : 2017-09-13 10:18:46
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170913-101845
  • min_os_version :
  • min_wapt_version :

setup.py

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

# uninstall key retrieved from msi properties with 'ProductCode' key. See below
uninstallkey=[]

def windows_version():
    """see https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx"""
    try:
        return Version(platform.win32_ver()[1],3)
    except:
        return Version(platform.win32_ver()[1])

def install():
    for uninstall in installed_softwares('Adobe Flash Player'):
        if not 'MsiExec.exe' in uninstall['uninstall_string'] :
            if uninstall_key_exists(uninstall['key']):
                run_notfatal('"uninstall_flash_player.exe" -uninstall')


    print("Installing flash for firefox")
    major_version = control.version.split('.',1)[0]
    install_msi_if_needed('install_flash_player_%s_plugin.msi'%major_version,killbefore=['firefox.exe','chrome.exe'])

    print("Installing flash for internet explorer if < win10")
    if windows_version()<Version('6.2.0'):
        install_msi_if_needed('install_flash_player_%s_active_x.msi'%major_version,killbefore=['iexplore.exe'])

    print("Disable autoupdate")
    if iswin64():
        filecopyto("mms.cfg",makepath(os.environ['SYSTEMROOT'],"SysWOW64","Macromed","Flash"))
    else:
        filecopyto("mms.cfg",makepath(os.environ['SYSTEMROOT'],"System32","Macromed","Flash"))

    for task in ('Adobe Flash Player Updater',"Adobe Flash Player PPAPI Notifier"):
        if task_exists(task):
            delete_task(task)

    if service_installed('AdobeFlashPlayerUpdateSvc'):
        if service_is_running('AdobeFlashPlayerUpdateSvc'):
            service_stop('AdobeFlashPlayerUpdateSvc')
        run('sc delete AdobeFlashPlayerUpdateSvc')


def update_sources():
    """Update to current version from macromedia"""
    os.chdir(os.path.dirname(__file__))
    # find latest version
    import requests,BeautifulSoup
    page = requests.get('https://get.adobe.com/fr/flashplayer',headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'}).text
    bs = BeautifulSoup.BeautifulSoup(page)
    latest_version = bs.find(id="autoSelectedVersion").find(id="AUTO_ID_columnleft_p_version").text.replace('Version','').strip()
    print('Latest version: %s' % latest_version)

    major_version = latest_version.split('.',1)[0]

    allmsi = glob.glob('*.msi')
    for msi in allmsi:
        vers = get_msi_properties(msi)['ProductVersion']
        if vers != latest_version :
            remove_file(msi)

    if not isfile('install_flash_player_%s_active_x.msi' % major_version ) :
        wget('https://download.macromedia.com/get/flashplayer/pdc/%s/install_flash_player_%s_active_x.msi' % (latest_version,major_version),os.getcwd())
    if not isfile('install_flash_player_%s_plugin.msi' % major_version ) :
        wget('https://download.macromedia.com/get/flashplayer/pdc/%s/install_flash_player_%s_plugin.msi'  % (latest_version,major_version),os.getcwd())

    #if not isfile('install_flash_player_%s_ppapi.msi' % major_version ) :
    #    wget('https://download.macromedia.com/get/flashplayer/pdc/%s/install_flash_player_%s_ppapi.msi'  % (latest_version,major_version),os.getcwd())

    wget('https://fpdownload.macromedia.com/get/flashplayer/current/support/uninstall_flash_player.exe' ,os.getcwd())

    # change version of package
    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())
    pe.version = get_msi_properties('install_flash_player_%s_active_x.msi' % major_version)['ProductVersion']+'-0'
    pe.save_control_to_wapt(os.getcwd())

if __name__ == '__main__':
    update_sources()
    

manifest

[["WAPT/icon.png", "1b1026ef36fb904e5810f5f35c1febf9fc43595a"], ["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["WAPT/wapt.psproj", "7ccbe65afd42ee7794a86ed74eef48e3f5812c93"], ["install_flash_player_26_plugin.msi", "8d29973da148476f33f5bf02733b1e3c066689a1"], ["mms.cfg", "e981e649670e1fb6ae69e67b0f8186371ba6dede"], ["setup.py", "de128ed64052ec6ee69a064063b553e0057c9e22"], ["uninstall_flash_player.exe", "3f22b25fc33bb38603458894d2ec94da1f33382f"], ["install_flash_player_26_active_x.msi", "6ebfb96f7c4c4c3d54a183cffaaa712c799982a5"], ["WAPT/control", "610074cce08a70098aeed3e00f34517cfa636cda"]]