tis-7zip
21.05-25
7-Zip is a free and open-source file archiver with a high compression ratio
95100 downloads
View on


Description
- package : tis-7zip
- version : 21.05-25
- architecture : x86
- categories : Utilities
- maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
- description : 7-Zip is a free and open-source file archiver with a high compression ratio
- locale : all
- target_os : windows
- min_wapt_version : 1.7
- sources : https://www.7-zip.org/download.html
- installed_size :
- impacted_process : 7zFM,7z,7zG
- description_fr : 7-Zip est un logiciel gratuit et open source d'archivage de fichiers avec un taux de compression élevé
- description_pl :
- description_de : 7-Zip ist ein Datenkompressionsprogramm mit einer hohen Kompressionsrate
- description_es : 7-Zip es un archivador de ficheros con una alta relación de compresión
- description_pt : O 7-Zip é um compactador de arquivos com alta taxa de compressão
- description_it :
- description_nl :
- description_ru : 7-Zip свободный файловый архиватор с высокой степенью сжатия данных
- editor : Igor Pavlov
- licence : LGPL
- signature_date : 2021-11-24T14:44:42.176948
- Homepage : https://www.7-zip.org/
Setup.py
# -*- coding: utf-8 -*-
from setuphelpers import *
import platform
import bs4 as BeautifulSoup
import time
"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()
"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
bin_contains = '7z'
ext_file_association = ('.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')
ukey = '7-Zip'
def install():
# Initializing variables
package_version = control.version.split('-',1)[0]
app_name = control.name
bin_name = glob.glob('*%s*.exe' % bin_contains)[0]
# Uninstalling others versions
for uninstall in installed_softwares(app_name):
if (Version(uninstall['version']) != Version(get_version_from_binary(bin_name))) or ('msiexec' in uninstall["uninstall_string"].lower()) or (iswin64() and (not "x64" in uninstall["name"].lower())):
print('Removing: %s (%s)' % (uninstall['name'], uninstall['version']))
run(uninstall_cmd(uninstall['key']))
if uninstall_key_exists(ukey):
if not isdir(makepath(programfiles, '7-zip')):
force = True
# Installing the package
print('Installing: %s' % bin_name)
install_exe_if_needed(bin_name,silentflags='/S',key=ukey,min_version=package_version)
uninstallkey.remove(ukey)
# File association for 7-Zip
for ext in (ext_file_association):
register_ext('7-zip',ext,'"%s" "%%1"' % (makepath(programfiles, '7-zip', '7zFM.exe')), icon="%s,1" % (makepath(programfiles, '7-zip', '7z.dll')))
def audit():
if not uninstall_key_exists(ukey):
print('Uninstallkey %s not found' % ukey)
return "ERROR"
else:
print('Uninstallkey %s found' % ukey)
return "OK"
def uninstall():
if uninstall_key_exists(ukey):
run(uninstall_cmd(ukey))
time.sleep(5)
if not isdir(makepath(programfiles, '7-zip')):
unregister_uninstall(ukey, win64app=iswin64())
else:
error('Failed Uninstall %s' % ukey)
def update_package():
# Declaring local variables
result = False
proxies = get_proxies()
if not proxies:
proxies = get_proxies_from_wapt_console()
app_name = control.name
url = 'https://www.7-zip.org/download.html'
if control.architecture == 'x64':
sub_bin_name = '7z%s-x64.exe'
else:
sub_bin_name = '7z%s.exe'
# Getting latest version from official website
print('URL used is: ' + url)
version = bs_find_all(url, 'b', proxies=proxies)[1].text.split('Zip ')[-1].split(' (')[0]
splitted_version = version.replace('.', '')
latest_bin = sub_bin_name % splitted_version
url_dl = 'https://www.7-zip.org/a/%s' % latest_bin
print("Latest %s version is: %s" % (app_name,version))
print("Download url is: %s" % url_dl)
# Downloading latest binaries
if not isfile(latest_bin):
print('Downloading: %s' % latest_bin)
wget(url_dl,latest_bin, proxies=proxies)
# Checking version from file
version_from_file = get_file_properties(latest_bin)['ProductVersion']
if Version(version) != Version(version_from_file) and version_from_file != '':
print("Changing version to the version number of the binary (from: %s to: %s)" % (version, version_from_file))
os.rename(latest_bin, sub_bin_name % version_from_file)
version = version_from_file
else:
print("Binary file version corresponds to online version")
# Changing version of the package
if Version(version) > Version(control.get_software_version()):
print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
result = True
else:
print("Software version up-to-date (%s)" % Version(version))
control.version = '%s-%s' % (Version(version), control.version.split('-', 1)[-1])
#control.set_software_version(version)
control.save_control_to_wapt()
# Deleting outdated binaries
remove_outdated_binaries(splitted_version)
# Validating update-package-sources
return result
Changelog
Changelog software url : https://www.7-zip.org/history.txt
No changelog.txt.