tis-libreoffice-stable 6.0.7.3-2

  • package : tis-libreoffice-stable
  • version : 6.0.7.3-2
  • architecture : x64
  • locale : fr
  • description : Office Suite LibreOffice stable Franch + Help. Uninstall libreooffice 3.xx and OpenOffice 3.xx
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • date : 2018-11-14 17:13:08
  • min_wapt_version : 1.5
  • min_os_version : 6.1
  • max_os_version :
  • impacted_process : soffice.exe,sbase.exe,scalc.exe,sdraw.exe,simpress.exe,smath.exe,swriter.exe

setup.py

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

import platform
from setuphelpers import *

uninstallkey = []


def install():

    diskfreespacebefore = get_disk_free_space(programfiles)

    """
    # 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)

    diskfreespaceafter = get_disk_free_space(programfiles)
    difffreespace = diskfreespacebefore - diskfreespaceafter
    print(ur"Espace disque necessaire pour l'installation : " + str(difffreespace))


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

def session_setup():

    s_libreoffice = {'LibreOffice':'soffice.exe', 'LibreOffice Base':'sbase.exe', 'LibreOffice Calc':'scalc.exe',
'LibreOffice Draw':'sdraw.exe', 'LibreOffice Impress':'simpress.exe', 'LibreOffice Math':'smath.exe', 'LibreOffice Writer':'swriter.exe' , 'LibreOffice (Safe Mode)':'soffice.exe'}

    for label,program in s_libreoffice.items():

        label_exist = makepath(user_desktop(),'%s.lnk' % label)

        if isfile(label_exist):
            remove_user_desktop_shortcut('%s' % label)
            create_user_desktop_shortcut('%s' % label,makepath(programfiles64,'LibreOffice','program','%s' %program))

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

    helpx64 = "LibreOffice_%s_Win_x64_helppack_fr.msi" % realversion
    msix64 = "LibreOffice_%s_Win_x64.msi" % realversion
    url = "http://download.documentfoundation.org/libreoffice/stable/%s/win/" % realversion


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

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


    lastest_version = get_msi_properties(msix64)['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

LibreOffice_6.0.7_Win_x64_helppack_fr.msi bfd1d4f70451b106ba841e9defb4ad88fcf3abdcc1ed56a2ecf550f26b9d2ff7
WAPT/icon.png 3f684b7ed5fd1b380e8f796ddb42056eb7a44c4005c894a7c44711b064886cdc
WAPT/certificate.crt 13fb474c5c23c135a77aba592eb8821b9ecbcc463f5b7312312b87b20eac6779
WAPT/wapt.psproj df3e2fa87fea9c7bdfcc22039b9ef7303f092898882d9f3f4233f5d92f90b3c7
LibreOffice_6.0.7_Win_x64.msi 851794df64168af694edd182af019a7579744945c22465f13599efd65d730cb2
setup.py b341ed944a619c1eb261ad9788109dc32c1bba15325530f1098c8ae6b9914d48
WAPT/control f1f5fd43d6dba8c40d07ccd2f3bc80e80831651b74ea7e30352064e9a879bbb2