tis-chrome 60.0.3112.78-2

  • package : tis-chrome
  • version : 60.0.3112.78-2
  • description : Google Chrome 32 / 64 bits (Google, Inc.)
  • maintainer : Hubert TOUVET
  • date : 2017-07-26 00:05:37
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170726-000515
  • min_os_version :
  • min_wapt_version :

setup.py

# -*- coding: utf-8 -*-
from setuphelpers import *
import inspect

uninstallkey = []

def install():
    print('installing tis-chrome')


    def getversionchrome(key):
        return get_file_properties(makepath(programfiles32,'Google','Chrome','Application','chrome.exe'))['ProductVersion']

    versionpaquet = control['version'].split('-',1)[0]

    if iswin64():
        install_msi_if_needed('GoogleChromeStandaloneEnterprise64-fr.msi',min_version=versionpaquet,killbefore='chrome.exe',get_version=getversionchrome)
    else:
        install_msi_if_needed('GoogleChromeStandaloneEnterprise32-fr.msi',min_version=versionpaquet,killbefore='chrome.exe',get_version=getversionchrome)




def update_package():

    import time

    wget('https://dl.google.com/tag/s/appguid={8A69D345-D564-463C-AFF1-A69D9E530F96}&iid={00000000-0000-0000-0000-000000000000}&lang=fr&browser=3&usagestats=0&appname=Google%2520Chrome&needsadmin=prefers/edgedl/chrome/install/GoogleChromeStandaloneEnterprise.msi','GoogleChromeStandaloneEnterprise32-fr.msi')
    wget('https://dl.google.com/tag/s/appguid={00000000-0000-0000-0000-000000000000}&iid={00000000-0000-0000-0000-000000000000}&lang=fr&browser=4&usagestats=0&appname=Google Chrome&needsadmin=true/dl/chrome/install/googlechromestandaloneenterprise64.msi','GoogleChromeStandaloneEnterprise64-fr.msi')

    if iswin64():
        chrome = 'GoogleChromeStandaloneEnterprise32-fr.msi'
    else:
        chrome = 'GoogleChromeStandaloneEnterprise64-fr.msi'

    run(r'msiexec /norestart /q /i "%s" ' % chrome)



    os.chdir(os.path.dirname(__file__))

    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())


    pe.version = get_file_properties(makepath(programfiles32,'Google','Chrome','Application','chrome.exe'))['ProductVersion'] + '-0'
    pe.save_control_to_wapt(os.getcwd())

def need_install(key,min_version=None,force=False,get_version=None):
    """Return True if the software with key can be found in uninstall registry
        and the registred version is equal or greater than min_version

    Args:
        key (str) : uninstall key
        min_version (str) : minimum version or None if don't check verion (like when key is specific for each soft version)
        get_version (callable) : optional func to get installed software version from one installed_softwares item
            if not provided, version is taken from 'version' attribute in uninstall registry
    Returns:
        boolean

    """
    if force or key is None:
        return True
    else:
        current = installed_softwares(uninstallkey=key)
        for soft in current:
            if min_version is None:
                return False
            if get_version is not None:
                installed_version = get_version(soft)
            else:
                installed_version = soft['version']
            if Version(min_version) <= installed_version:
                return False
        return True

def install_msi_if_needed(msi,min_version=None,killbefore=[],accept_returncodes=[0,3010],timeout=300,properties={},get_version=None):
    """Install silently the supplied msi file, and add the uninstall key to
    global uninstall key list

    uninstall key, min_version and silent flags are guessed from msi file.

    Raises an error if, after the msi install, the uninstall key is not found in registry.

    The matching is done on key

    .. versionchanged:: 1.3.12
        removed 1603 error from default accepted return code

    Args:
        msi (str) : path to the MSI file
        min_version (str) : if installed version is equal or gretaer than this, don't install
                            if not provided (None), guess it from exe setup file properties.
                            if == '': ignore version check.
        kill_before (list of str) : processes to kill before setup, to avoid file locks
                                    issues.
        accept_returncodes (list of int) : return codes which are acceptable and don't raise exception
        timeout int) : maximum run time of command in seconds bfore the child is killed and error is raised.
        properties (dict) : map (key=value) of properties for specific msi installation.

    Returns:
        None

    """
    if not isfile(msi):
        error('msi file %s not found in package' % msi)
    key = get_msi_properties(msi)['ProductCode']
    caller_globals = inspect.stack()[1][0].f_globals
    WAPT = caller_globals.get('WAPT',None)
    force = WAPT and WAPT.options.force

    if min_version is None:
        min_version = getproductprops(msi)['version']
        print min_version

    if need_install(key,min_version=min_version or None,force=force,get_version=get_version):
        if killbefore:
            killalltasks(killbefore)
        props = ' '.join(["%s=%s" % (k,v) for (k,v) in properties.iteritems()])
        run(r'msiexec /norestart /q /i "%s" %s' % (msi,props),accept_returncodes=accept_returncodes,timeout=timeout)
        if key and not installed_softwares(uninstallkey=key):
            error('MSI %s has been installed but the uninstall key %s can not be found' % (msi,key))
        if key and min_version and need_install(key,min_version=min_version or None,force=False,get_version=get_version):
            error('MSI %s has been installed and the uninstall key %s found but version is not good' % (msi,key))
    else:
        print('MSI %s already installed. Skipping msiexec' % msi)
    if key:
        if 'uninstallkey' in caller_globals and not key in caller_globals['uninstallkey']:
            caller_globals['uninstallkey'].append(key)




if __name__ == '__main__':
    update_package()







    

manifest

Couldn't retrieve manifest.