tis-flashplayer 26.0.0.131-1

  • package : tis-flashplayer
  • version : 26.0.0.131-1
  • description : Adobe Flashplayer pour Internet Explorer et autres navigateurs Firefox, Chrome (install closes all browsers)
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • date : 2017-07-20 11:20:29
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170720-112028
  • 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", "f70a3c5d751c934d05cb41122ef7a179557118ed"], ["install_flash_player_26_plugin.msi", "8dbd3914b41dc68681144cd6f416f6a72329e86e"], ["mms.cfg", "e981e649670e1fb6ae69e67b0f8186371ba6dede"], ["setup.py", "b5aa2fe39d12d293f1877c2eaf98a6629fdc7c8a"], ["uninstall_flash_player.exe", "53b9236692ea1476f182a61412e3871a1d704e8d"], ["install_flash_player_26_active_x.msi", "a1b5db1a5231740b64a8833b53f481b22402b430"], ["WAPT/control", "6dcfd2185b397f6cacf1792d9995d3149ff1f268"]]