tis-libreoffice64 5.0.0.5-19

  • package : tis-libreoffice64
  • version : 5.0.0.5-19
  • architecture : all
  • locale :
  • description : Suite Bureautique LibreOffice 64B + Aide. D√©sinstalle libreooffice 3.xx et OpenOffice 3.xx
  • maintainer : TIS <technique@tranquil-it-systems.fr>
  • date : 2018-02-27 19:01:50
  • min_os_version :
  • max_os_version :

setup.py

#!/usr/bin/python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------
#    This file is part of WAPT
#    Copyright (C) 2013  Tranquil IT Systems http://www.tranquil.it
#    WAPT aims to help Windows systems administrators to deploy
#    setup and update applications on users PC.
#
#    WAPT is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    WAPT is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with WAPT.  If not, see <http://www.gnu.org/licenses/>.
#
# -----------------------------------------------------------------------
import platform
from setuphelpers import *

uninstallkey = []

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

def find_msis():
    """Returns msi filename and properties"""
    allmsi = glob.glob('*.msi')

    result = []
    for msi in allmsi:
        # uninstallkey is in msi db
        props = get_msi_properties(msi)
        result.append((msi,props))
    return result


def update_control(entry):
    """Magic Callback to update control version data at build step"""
    (version,packaging) = entry.version.split('-',1)
    msis = find_msis()
    # use first msi's version for the package version
    for (msi,props) in msis:
        if not 'helppack' in msi:
            entry.version = "%s-%s"%(props['ProductVersion'],packaging)
            break

def install():
    """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)

    msis = find_msis()
    for (msi,props) in msis:
        # uninstallkey is in msi db
        msikey = props['ProductCode']
        print('Adding uninstall key : %s'%msikey)
        uninstallkey.append(msikey)

        # check if product is already installed
        if WAPT.options.force or not installed_softwares(msikey):
            killalltasks('soffice.bin')
            print("Installing %s..."%(props['ProductName']))
            args = ["msiexec /norestart /quiet /i %s"%msi]
            if not 'helppack' in msi:
                # don't register extensions if Office is installed
                if not file_assoc('.doc').startswith('word.'):
                    args.append('SELECT_WORD=1')
                if not file_assoc('.xls').startswith('excel'):
                    args.append('SELECT_EXCEL=1')
                if not file_assoc('.ppt').startswith('powerpoint'):
                    args.append('SELECT_POWERPOINT=1')

                args.append('CREATEDESKTOPLINK=0')
                args.append('RebootYesNo=No')
                args.append('ALLUSER=1')
                args.append('ISCHECKFORPRODUCTUPDATES=0')
                args.append('QUICKSTART=0')
            cmd = ' '.join(args)
            run(cmd,timeout=1200,accept_returncodes=[0,1601])
            print("Done install %s..."%(props['ProductName']))
        else:
            print("%s already installed, skipping..."%props['ProductName'])

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_x64.msi'.format(version=last_version),
        'LibreOffice_{version}_Win_x64_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_64/{fn}'.format(version=last_version,fn=fn),fn)

    # removes old msi
    if last_version:
        msis = glob.glob('*.msi')
        for fn in msis:
            if not last_version in fn:
                remove_file(fn)

if __name__ == '__main__':
    update_package()


    

Changelog

No changelog
    

manifest.sha256

WAPT/icon.png 3f684b7ed5fd1b380e8f796ddb42056eb7a44c4005c894a7c44711b064886cdc
WAPT/certificate.crt 79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4
WAPT/wapt.psproj 240f4f80d8743a057cf59ec314bf867fbebc09319d14a03f643902ba444b2b61
LibreOffice_5.0.0_Win_x64_helppack_fr.msi 4d645f74d116b1fe1ec6928dcb6eb42874e387a22b038c51865245df80b5b428
setup.py b9cc7aa34809b48dc4792222517868f0fb91ca02ca8af534b74a285e27491441
LibreOffice_5.0.0_Win_x64.msi 20e8373de8e9aadf9d194ea1d9b95b38fa54ecd4e91f3fe18df1fc02e036bd16
WAPT/control 96de96e0d39df4d15da57eeea1f9fef1fdf7d2cf7b75160f7059b2d15ecd6dbd