tis-libreoffice-stable 5.3.7.2-1

  • package : tis-libreoffice-stable
  • version : 5.3.7.2-1
  • description : Suite Bureautique LibreOffice Old stable + Aide. D√©sinstalle libreooffice 3.xx et OpenOffice 3.xx
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • date : 2018-02-27 19:02:14

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']

    for msi in glob.glob('*.msi'):
        if not 'helppack' in msi:
            versionsoft = get_msi_properties(msi)['ProductVersion']


    """Called by wapt-get or waptservice to install the package"""
    old_libreoff = installed_softwares('libreoffice')
    old_openoff = installed_softwares('openoffice')
    old_office = old_libreoff + old_openoff
    if old_office:
        for uninstall in old_office:
            if 'openoffice' in uninstall or Version(uninstall['version']) > Version(versionsoft) or uninstall['version'].startswith('3.'):
                cmd = WAPT.uninstall_cmd(uninstall['key'])
                killalltasks(libre_office_exe)
                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 file_assoc(ext):
    """Renvoie le type d'application associe à une extension (exemple : .doc)"""
    return registry_readstring(HKEY_CLASSES_ROOT,ext,None).lower()




def update_package():
    htmlSource = wgets("https://www.libreoffice.org/download/download/").splitlines()
    foundoffice = False
    found = False
    for line in htmlSource :
        if 'enterprise' in line:
            found = True
        if found == True:
            if 'http://download.documentfoundation.org/libreoffice/stable/' in line:
                start = line.find("/stable/")
                startversion = start + 8
                end = line.find("/win/")
                realversion = line[startversion:end]
                break

    helpx86 = "LibreOffice_%s_Win_x86_helppack_fr.msi" % realversion
    msix86 = "LibreOffice_%s_Win_x86.msi" % realversion
    url = "http://download.documentfoundation.org/libreoffice/stable/%s/win/" % realversion


    if not isfile(msix86):
        wget(url + "x86/" +msix86,msix86)
    else:
        print(msix86 + ' already exist')

    if not isfile(helpx86):
        wget(url + "x86/" +helpx86,helpx86)
    else:
        print(helpx86 + ' already exist')


    lastest_version = get_msi_properties(msix86)['ProductVersion']

    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())

if __name__ == '__main__':
    update_package()


    

Changelog

No changelog
    

manifest.sha256

[["WAPT/icon.png", "3f684b7ed5fd1b380e8f796ddb42056eb7a44c4005c894a7c44711b064886cdc"], ["WAPT/certificate.crt", "79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4"], ["WAPT/wapt.psproj", "795d36d10109ca85357285f79090fac2be856e5830ea31fa913cc55cb825807b"], ["LibreOffice_5.3.7_Win_x86_helppack_fr.msi", "8bd0c4a96e7ecc29fc0d161f6dc05e052917e4666a2c74009c3a47c6f4d6c26d"], ["LibreOffice_5.3.7_Win_x86.msi", "974a700c7fa77749506658c1e178927b6052d6d9d49dca9048921506cd593261"], ["setup.py", "39b9f030b0930b5fc17b42437687eea7f6314252934392f96d0a1d6b9ffbad5c"], ["WAPT/control", "68acb9638e60ce2f4c1021ab20f7b8577077a862c702441a7d70993c1a1cad3a"]]