Détails du package smp-flashplayer_32.0.0.142-1_all_all.wapt
retour Revenir à la liste des packages

smp-flashplayer

ATTENTION CE DÉPÔT n'est plus compatible 1.3 vous devez migrer en 1.5.1.21 !

Fichier control :

package           : smp-flashplayer
version           : 32.0.0.142-1
architecture      : all
section           : base
priority          : optional
maintainer        : Simon Fonteneau
description       : Adobe Flashplayer for Internet Explorer and other browsers
depends           : 
conflicts         : smp-flashplayer-esr
maturity          : 
locale            : all
target_os         : windows
min_os_version    : 
max_os_version    : 
min_wapt_version  : 
sources           : 
installed_size    : 229646336
impacted_process  : iexplorer.exe,firefox.exe,opera.exe
description_fr    : 
description_pl    : 
description_de    : 
description_es    : 
audit_schedule    : 
editor            : 
keywords          : 
licence           : 
homepage          : 
package_uuid      : 4a57627c-ff3e-4367-9cb3-ac694719a483
signer            : wapt.lesfourmisduweb.org
signer_fingerprint: 8da83ebdac1a25e820b186510d049f47407b11835b0664fdc5bacd3595b1671d
signature         : PwP7t+iSeP5fH8lWB8AGe+2Prb5vtFYslVWpiQH6qyrdgADZC1ZkAHqO3wCRX7sThoUciJv2YdBkklkakB9OO99eriIpdiZ2jMny+UPJtxSrnc6+J5iFQuCLZQ3s/ioZF1VB9LLXcFEWe3HIh8UlVtaimtU4EECzkMndbGH5cN3ylJUhZIEmIuVvTjrvRlTn1jBMEA378GpZLWjanVk817WXerjDEZfQuQo/uGlFkNyJ8kZ19scogTWG4fybBqY9udKxTCTn8R0WljJ1BmgyRMUx1P0vl+UAtK95bAVCH5UQ+9rx4/ETRLDLtyOs3E6Ocrrq8/MOLhvg1c5rSMGC4w==
signature_date    : 2019-02-12T08:45:46.431000
signed_attributes : package,version,architecture,section,priority,maintainer,description,depends,conflicts,maturity,locale,target_os,min_os_version,max_os_version,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,audit_schedule,editor,keywords,licence,homepage,package_uuid,signer,signer_fingerprint,signature_date,signed_attributes






Fichier setup.py :

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

uninstallkey=[]


def install():
    diskfreespacebefore = get_disk_free_space(programfiles)
    versionsoft = control['version'].split('-',1)[0]
    majeurversion = control['version'].split('.',1)[0]
    softname = 'Adobe Flash Player'
    check_installed_soft = installed_softwares(softname)

    if check_installed_soft:
        for uninstall in check_installed_soft:
            if not 'MsiExec.exe' in uninstall['uninstall_string'] :
                run('"uninstall_flash_player.exe" -uninstall')
            else :
                if not majeurversion in uninstall['name']:
                    if Version(uninstall['version']) < Version(versionsoft) :
                        print(u'remove old software' )
                        cmd = WAPT.uninstall_cmd(uninstall['key'])
                        run(cmd)

    print("Installing flash for firefox")
    install_msi_if_needed('install_flash_player_%s_plugin.msi' % majeurversion,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' % majeurversion,killbefore=['iexplore.exe'])

    print("Installing flash ppapi")
    install_msi_if_needed('install_flash_player_%s_ppapi.msi' % majeurversion,killbefore=['chromium.exe','opera.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"))

    print("delete task update")
    listtask = run('schtasks')
    if "Adobe Flash Player Updater" in listtask :
        run('schtasks /Delete /tn "Adobe Flash Player Updater" /f')

    if "Adobe Flash Player PPAPI Notifier" in listtask :
        run('schtasks /Delete /tn "Adobe Flash Player PPAPI Notifier" /f')

    if "Adobe Flash Player NPAPI Notifier" in listtask :
        run('schtasks /Delete /tn "Adobe Flash Player NPAPI Notifier" /f')

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

    diskfreespaceafter = get_disk_free_space(programfiles)
    difffreespace = diskfreespacebefore - diskfreespaceafter
    #print(ur"Disk space required for installation : " + str(difffreespace))












# Pour mettre a jour le paquet en un seul clique !  (cliquez sur play en haut)

def update_package():
    """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_package()