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-08-08 10:14:17
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170808-101416
  • 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

Couldn't retrieve manifest.