tis-libreoffice-stable 5.4.7.2-2

  • package : tis-libreoffice-stable
  • version : 5.4.7.2-2
  • architecture : all
  • locale : all
  • description : Office Suite LibreOffice Old stable + Help. Uninstall libreooffice 3.xx and OpenOffice 3.xx
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • date : 2018-05-18 11:05:59
  • min_wapt_version : 1.3.5
  • min_os_version : 5.1
  • max_os_version :
  • impacted_process :

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 13fb474c5c23c135a77aba592eb8821b9ecbcc463f5b7312312b87b20eac6779
WAPT/wapt.psproj df3e2fa87fea9c7bdfcc22039b9ef7303f092898882d9f3f4233f5d92f90b3c7
LibreOffice_5.4.7_Win_x86.msi e13a0f266dbe1fe9763d0530e1ea0723df03a3f9b3d8974224066ca572b3e02b
setup.py 39b9f030b0930b5fc17b42437687eea7f6314252934392f96d0a1d6b9ffbad5c
LibreOffice_5.4.7_Win_x86_helppack_fr.msi 802dc2a5eba4067c5fabccceb5eaab5a110ef31c9fe3d5726c2c4ba2f71d7f98
WAPT/control e93605d98a407e429ecfb0b5cd33a2231045444eade57b1e6d96c4ed3d43859b