tis-firefox 61.0.1-36

  • package : tis-firefox
  • version : 61.0.1-36
  • description : Firefox Web Browser French
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • date : 2018-07-10 12:07:34

setup.py

# -*- coding: UTF-8 -*-
from setuphelpers import *
import time

uninstallkey = []

def install():

    softname ='Mozilla Firefox'

    diskfreespacebefore = get_disk_free_space(programfiles)

    for uninstall in installed_softwares(softname):
        if 'x86' in uninstall['name']:
            if uninstall_key_exists(uninstall['key']):
                killalltasks('firefox.exe')
                cmd = WAPT.uninstall_cmd(uninstall['key'])
                run(cmd)
                time.sleep (5)

    for uninstall in installed_softwares(softname):
        if 'ESR' in uninstall['name']:
            if uninstall_key_exists(uninstall['key']):
                killalltasks('firefox.exe')
                cmd = WAPT.uninstall_cmd(uninstall['key'])
                run(cmd)
                time.sleep (5)

    version = control.version.split('-',1)[0]
    ukey = 'Mozilla Firefox %s (x86 fr)'%version
    exe = 'Firefox Setup %s.exe'%version
    install_exe_if_needed(exe,'-ms',key=ukey,min_version=version,killbefore='firefox.exe')

    diskfreespaceafter = get_disk_free_space(programfiles)

    difffreespace = diskfreespacebefore - diskfreespaceafter
    print (ur"Espace disque occupé :" + str(difffreespace))



def update_package():
    """updates the package / control version with the latest stable firefox version"""
    import re,requests,urlparse,glob
    proxy = {'http':'http://srvproxy:3128','https':'http://srvproxy:3128'}
    #proxy = {}
    # get index of all dowloads
    """
    #url_base = 'https://download-installer.cdn.mozilla.net/pub/firefox/releases/latest/win32/fr/'
    url_base = 'https://download-installer.cdn.mozilla.net/pub/firefox/releases/43.0/win32/fr/'
    index = wgets(url_base)

    # get list of lastest french versions
    re_setup = re.compile(r'<a href=".*/(Firefox%20Setup%20[0-9.]*.exe)">Firefox Setup .*</a>')
    filename = urlparse.unquote(re_setup.findall(index)[0])
    url = url_base+filename
    """
    url = requests.head('https://download.mozilla.org/?product=firefox-latest-ssl&os=win&lang=fr',proxies=proxy).headers['Location']
    filename = urlparse.unquote(url.rsplit('/',1)[1])

    if not isfile(filename):
        print('Downloading %s from %s'%(filename,url))
        wget(url,filename,proxies=proxy)

    # removes old exe
    if isfile(filename):
        exes = glob.glob('Firefox*.exe')
        for fn in exes:
            if fn != filename:
                remove_file(fn)

        # updates control version from filename, increment package version.
        control = PackageEntry().load_control_from_wapt ('.')
        control.version = '%s-%s'%(re.findall('Firefox Setup (.*)\.exe',filename)[0],int(control.version.split('-',1)[1])+1)
        control.save_control_to_wapt('.')


if __name__ == '__main__':
    update_package()

    

Changelog

No changelog
    

manifest.sha256

[["WAPT/icon.png", "948e4bf2f1c1595091315354eb9fd9fb8f77d6675a2dd24337e35d9b7a4966a1"], ["WAPT/certificate.crt", "13fb474c5c23c135a77aba592eb8821b9ecbcc463f5b7312312b87b20eac6779"], ["WAPT/wapt.psproj", "df3e2fa87fea9c7bdfcc22039b9ef7303f092898882d9f3f4233f5d92f90b3c7"], ["Firefox Setup 61.0.1.exe", "649e8e764faa264f3dbd290307e17f651b14108a0805e32d8c20c0c95673d0f3"], ["setup.py", "4dbe3f5b8f746391399303d50be89783acc3aed31f787a7458cd066c7d3777f7"], ["WAPT/control", "cadc805bd99c4d0d88622a302fbab0403218e16e5034b49727fa0ddf0bcdc768"]]