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 : 2018-02-27 18:59:58

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()
    

Changelog

No changelog
    

manifest.sha256

[["WAPT/icon.png", "6dabfc6f53a86814f1cf65b4cda5266a013809d8c05867c06c2f4f2e50bec914"], ["WAPT/certificate.crt", "79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4"], ["WAPT/wapt.psproj", "c5a1697bf6e134989a9870764995725626a8f5055b640e541b569d1a927363fc"], ["install_flash_player_26_plugin.msi", "28f692b79090178710fbf8b9c8403014d3ab5f1cff18b6f8fe41e853671e10b6"], ["mms.cfg", "490a4a0df021a58b3656609542e367af5997a0a3c7fcb0c1ae00a8f5c41ae17a"], ["setup.py", "1b95d514ef52595312faf85e5a740e3ba6867184cc4a061909e8f3729fe271f2"], ["uninstall_flash_player.exe", "f8d285927b9b59dbfcf0b73d0e53622dfcc7b21543c42ab5daee14900a1672e8"], ["install_flash_player_26_active_x.msi", "6e778f2e381e34e094cf04e3d8d1b8f806ab51f426f217b6422d5a9ea02b4297"], ["WAPT/control", "b0c46b3d496cfad2f556dbd9edf7ab9b70c08e5c551bf0a07ed95ec75ce0ca29"]]