tis-7zip 18.5.0.0-4

  • package : tis-7zip
  • version : 18.5.0.0-4
  • description : package for 7-Zip (Igor Pavlov)
  • maintainer : TIS
  • date : 2018-05-03 10:27:29

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
import time
from setuphelpers import *

uninstallkey=[]

""" You can do a CTRL F9 in pyscripter to update the package """

def install():
    global uninstallkey
    from common import Wapt

    broken_7zip = [ soft for soft in installed_softwares('7-zip') if Version(soft['version']) < Version('16.0') ]
    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)

    allmsi = glob.glob('*-x64.msi')
    for msi in allmsi:
        if iswin64():
            install_msi_if_needed(msi,killbefore=['7zFM.exe'])
        else:
            install_msi_if_needed(msi.replace('-x64.msi','.msi'),killbefore=['7zFM.exe'])

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

""" You can do a CTRL F9 in pyscripter to update the package """









def update_sources():

    import urllib2
    import requests

    """I download the file >>>"""

    sock = urllib2.urlopen("http://www.7-zip.org/download.html",timeout=10)
    htmlSource = sock.readlines()
    sock.close()
    for line in htmlSource :
        if  'x64.msi'  in line :
            start = line.find('href=')
            end = line.find('">D')
            x64 = line[start + 6:end]
            x86 = x64.replace("-x64.msi",".msi")
            break

    allmsi = glob.glob('*.msi')
    for msi in allmsi:
        remove_file(msi)

    wget('http://www.7-zip.org/%s' % x64, x64.rsplit('/')[-1])
    wget('http://www.7-zip.org/%s' % x86, x86.rsplit('/')[-1])



    """I retrieve the current version from the msi """

    allmsi = glob.glob('*.msi')
    for msi in allmsi:
        vers = get_msi_properties(msi)['ProductVersion']
        break

    """I write the version in the control file >>>"""

    os.chdir(os.path.dirname(__file__))

    from waptpackage import PackageEntry
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())

    pe.version = vers + '-0'
    pe.save_control_to_wapt(os.getcwd())


if __name__ == '__main__':
    update_sources()





    

Changelog

No changelog
    

manifest.sha256

[["WAPT/icon.png", "9d386eca12e88b657e111f73c746efa43aa1f469e7accbc866b9cc688f1deeca"], ["WAPT/certificate.crt", "13fb474c5c23c135a77aba592eb8821b9ecbcc463f5b7312312b87b20eac6779"], ["WAPT/wapt.psproj", "79adab7ad1d3821b05c9d018c5c1a8949b4400aa9ddb54bfb62d829484739d1a"], ["7z1805-x64.msi", "898c1ca0015183fe2ba7d55cacf0a1dea35e873bf3f8090f362a6288c6ef08d7"], ["setup.py", "af636528ffde098cde12a9e3ef9b121fd3bcf27b334e6194333c079c6dbec546"], ["7z1805.msi", "c554238bee18a03d736525e06d9258c9ecf7f64ead7c6b0d1eb04db2c0de30d0"], ["WAPT/control", "88b43bea65f92812923a64a885b202ea45c5d17c771661b94736cb0514f5b8fd"]]