tis-firefox-esr 52.2.0-12

  • package : tis-firefox-esr
  • version : 52.2.0-12
  • description : Navigateur Web Firefox ESR extended support
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • date : 2017-07-20 15:52:25
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170720-155224
  • min_os_version :
  • min_wapt_version : 1.3.5

setup.py

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

uninstallkey = []

def install_location(uninstallkey):
    """Return the install location of the software given its uninstall key
        or None if not found
    >>> install_location('winscp3_is1')
    u'C:\\Program Files\\WinSCP\\'
    """
    for soft in installed_softwares(uninstallkey=uninstallkey):
        return soft.get('install_location',None)


def install():
    version = control.version.split('-',1)[0]
    ukey = 'Mozilla Firefox %s ESR (x86 fr)'%version

    exe = 'Firefox Setup %sesr.exe'%version
    install_exe_if_needed(exe,'-ms',key=ukey,min_version=version,killbefore='firefox.exe')

    print("Disabling auto update")
    filecopyto("mozilla.cfg",makepath(install_location('Mozilla Firefox %s ESR (x86 fr)' %version )))
    filecopyto("local-settings.js",makepath(install_location('Mozilla Firefox %s ESR (x86 fr)' %version ),"defaults","pref"))

    print ("Disabling profile migration from ie")
    filecopyto("override.ini",makepath(install_location('Mozilla Firefox %s ESR (x86 fr)' %version ),"browser"))

    print ("Override User UI")
    ensure_dir(makepath(install_location('Mozilla Firefox %s ESR (x86 fr)' %version ),"browser","defaults","profile","chrome",""))
    filecopyto("userChrome.css",makepath(install_location('Mozilla Firefox %s ESR (x86 fr)' %version ),"browser","defaults","profile","chrome"))

    """
    print ("Deploy extensions")
    ensure_dir(makepath(programfiles32,"Mozilla Firefox","browser","extensions",""))
    copytree2("extensions",makepath(programfiles32,"Mozilla Firefox","browser","extensions"))
    """

def update_package():
    """updates the package / control version with the latest stable firefox version"""
    import re,requests,urlparse,glob

    # 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-esr-latest&os=win&lang=fr',proxies={}).headers['Location']
    filename = urlparse.unquote(url.rsplit('/',1)[1])

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

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

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

if __name__ == '__main__':
    update_package()


    

manifest

[["override.ini", "6cf83b6dcb57e3b08fc64a81c0bb1b2a0f65b4d0"], ["local-settings.js", "a18e82bed82bc9de6ab48dfdeb8cfbf364f1f34a"], ["Firefox Setup 52.2.0esr.exe", "22bddd80be3cfcb78d3a930223665f2d001d88dd"], ["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["WAPT/wapt.psproj", "557e60050809687d56525e6ac46df9c0e02ccae6"], ["WAPT/icon.png", "e9148eecf1132466e00621255540168529d53f2d"], ["setup.py", "a1186a4bd9a199e714a63759b57927d571f36ea2"], ["WAPT/changelog.txt", "7509afe969f313063000fcf4a599506d87846ec4"], ["userChrome.css", "b637e26f5c89b51a99bce1b8f3fab2c4163fb932"], ["WAPT/control", "46468fdb0eb7b08e06206b55873f245a6c4e43cf"], ["mozilla.cfg", "8edc75d421b27d317ca837962303565a42cdef1c"]]