tis-libreoffice-evolution 5.4.1.2-31

  • package : tis-libreoffice-evolution
  • version : 5.4.1.2-31
  • description : Suite Bureautique LibreOffice Evolution + Aide. Désinstalle libreooffice 3.xx et OpenOffice 3.xx
  • maintainer : TIS
  • date : 2017-09-13 10:21:32
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170913-102128
  • min_os_version :
  • min_wapt_version :

setup.py

#!/usr/bin/python
# -*- coding: utf-8 -*-

import platform
from setuphelpers import *

uninstallkey = []

def install():

    """
    # FOR x64 install
    msis = glob.glob('*.msi')
    for (msi,name) in msis:
       if iswin64():
          if not 'x64' in msi:
             remove_file(msi)
       else:
          if not 'x86' in msi:
             remove_file(msi)
    """

    libre_office_exe = ['soffice.exe','sbase.exe','scalc.exe','sdraw.exe','simpress.exe','smath.exe','swriter.exe']

    """Called by wapt-get or waptservice to install the package"""
    # uninstall previous libreoffice or openoffice 3.xx
    old_libreoff = installed_softwares('libreoffice 3.')
    old_openoff = installed_softwares('openoffice')
    old_office = old_libreoff + old_openoff
    if old_office:
        for uninstall in old_office:
            if uninstall['version'].startswith('3.'):
                cmd = WAPT.uninstall_cmd(uninstall['key'])
                print(u'uninstalling %s' % (uninstall['name'],))
                run(cmd,timeout=1200)

    for msi in glob.glob('*.msi'):
        args = {}
        if not 'helppack' in msi:
            # don't register extensions if Office is installed
            if not file_assoc('.doc').startswith('word.'):
                args['SELECT_WORD']=1
            if not file_assoc('.xls').startswith('excel'):
                args['SELECT_EXCEL']=1
            if not file_assoc('.ppt').startswith('powerpoint'):
                args['SELECT_POWERPOINT']=1
            args['CREATEDESKTOPLINK']=0
            args['RebootYesNo']='No'
            args['ALLUSER']=1
            args['ISCHECKFORPRODUCTUPDATES']=0
            args['QUICKSTART']=0
        install_msi_if_needed(msi,properties=args,killbefore=libre_office_exe,timeout=1200)


def update_package():
    """updates the package with the latest stable libreoffice version"""
    import re
    # get list of stable versions
    re_versions = re.compile('<td><a href="([\d\.]*)/">')
    index = wgets('http://download.documentfoundation.org/libreoffice/stable/')
    # find latest
    last_version = sorted(re_versions.findall(index))[-1]
    for fn in (
        'LibreOffice_{version}_Win_x86.msi'.format(version=last_version),
        'LibreOffice_{version}_Win_x86_helppack_fr.msi'.format(version=last_version)):
        if not isfile(fn):
            print('Downloading %s'%fn)
            wget('http://download.documentfoundation.org/libreoffice/stable/{version}/win/x86/{fn}'.format(version=last_version,fn=fn),fn)
            #wget('http://download.documentfoundation.org/libreoffice/stable/{version}/win/x86_64/{fn}'.format(version=last_version,fn=fn),fn)
        if not 'helppack' in fn :
            lastest_version = get_msi_properties(fn)['ProductVersion']
            print "Lastest version is " + lastest_version

    # removes old msi
    allmsi = glob.glob('*.msi')
    for msi in allmsi:
        vers = get_msi_properties(msi)['ProductVersion']
        if vers != lastest_version :
            remove_file(msi)

    # change version of package
    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())
    pe.version = lastest_version +'-0'
    pe.save_control_to_wapt(os.getcwd())



def file_assoc(ext):
    """Renvoie le type d'application associe à une extension (exemple : .doc)"""
    return registry_readstring(HKEY_CLASSES_ROOT,ext,None).lower()



if __name__ == '__main__':
    update_package()


    

manifest

[["WAPT/icon.png", "0a9ff261834ddd1efd6b386e3253c00469ca9973"], ["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["LibreOffice_5.4.1_Win_x86_helppack_fr.msi", "a58045db641fa18bdeef45277b515e1c1a541855"], ["LibreOffice_5.4.1_Win_x86.msi", "9cce243979170dfbee25ee8257dac221b8f3eef8"], ["setup.py", "afb4d776876246086dfd72cc6480448de1e45dda"], ["WAPT/control", "f58032efe55a1e83d4d152379d5f58409ac1ebe4"], ["WAPT/wapt.psproj", "f70a3c5d751c934d05cb41122ef7a179557118ed"]]