tis-7zip 16.4-8

  • package : tis-7zip
  • version : 16.4-8
  • description : compression archivage 7-zip pour x86 et x64
  • maintainer : TIS, Amelie LE JEUNE
  • date : 2017-07-20 11:18:11
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170720-111811
  • min_os_version :
  • min_wapt_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/>.
#
# -----------------------------------------------------------------------
from setuphelpers import *
import glob

uninstallkey=[]

product_version = '16.04'
setup_version = product_version.replace('.','')
setup_filename_x86 = '7z%s.msi' % setup_version
setup_filename_x64 = '7z%s-x64.msi' % setup_version

def install():
    broken_7zip = [ soft for soft in installed_softwares('7-zip') if Version(soft['version']) < Version(product_version) ]
    if broken_7zip:
        for uninstall in broken_7zip:
            cmd = WAPT.uninstall_cmd(uninstall['key'])
            print(u'uninstalling %s' % (uninstall['name'],))
            # on execute la commande de desinstallation
            run(cmd)


    print("Installing 7-Zip %s"%(control.version,))
    if iswin64():
        install_msi_if_needed(setup_filename_x64,killbefore=['7zFM.exe'])
    else:
        install_msi_if_needed(setup_filename_x86,killbefore=['7zFM.exe'])

    # association des extensions a 7ZIP
    for ext in ('.001','.7z','.arj','.bz2','.bzip2','.cab','.cpio','.deb','.dmg','.fat',
            '.gz','.gzip','.hfs','.iso','.lha','.lzh','.lzma','.ntfs','.rar','.rpm',
            '.squashfs','.swm','.tar','.taz','.tbz','.tbz2','.tgz','.tpz','.txz','.vhd',
            '.wim','.xar','.xz','.z','.zip', '.zipe'):
        register_ext('7-zip',ext,'"%s" "%%1"' % (makepath(programfiles,'7-zip','7zFM.exe'),),icon="%s,1" % (makepath(programfiles,'7-zip','7z.dll')))

def update_package(control):
    if not isfile(setup_filename_x86):
        wget('http://www.7-zip.org/a/%s' % setup_filename_x86,setup_filename_x86)
    if not isfile(setup_filename_x64):
        wget('http://www.7-zip.org/a/%s' % setup_filename_x64,setup_filename_x64)
    for fn in glob.glob('7z*.msi'):
        if not fn in (setup_filename_x86,setup_filename_x64):
            remove_file(fn)
    update_control(control)

def update_control(control):
    packaging = control.version.rsplit('-',1)
    if packaging:
        packaging = packaging[1]
    else:
        packaging = '0'
    control.version = product_version+'-'+packaging

if __name__ == '__main__':
    control = PackageEntry()
    control.load_control_from_wapt('.')
    update_package(control)
    control.save_control_to_wapt('.')




    

manifest

[["WAPT/icon.png", "b411f2dfcd1084966844ca40e7881c38a4c89e2e"], ["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["WAPT/wapt.psproj", "51728ec0b5578cc546ccacdf8ee0b6769ce6ff86"], ["7z1604-x64.msi", "bae316e5148d3b42efa1d3f272afc10d3ffa6f4b"], ["7z1604.msi", "e1ee28c92d74c7961da7e4d4e4420e242c2951b2"], ["setup.py", "4729707780a2fb2a691ec103f9ed09d09637e211"], ["WAPT/control", "02718bb67cb5948c742ce1df09c83f29f257831d"]]