tis-winmerge
2.16.18-1
automatic package for WinMerge (http://winmerge.org)
3075 downloads
See build result See VirusTotal scan

control
package : tis-winmerge
version : 2.16.18-1
architecture : x64
section : base
priority : optional
name : WinMerge
categories : Utilities
maintainer : Tranquil IT
description : automatic package for WinMerge (http://winmerge.org)
depends :
conflicts :
maturity : PROD
locale :
target_os : windows
min_wapt_version :
sources :
installed_size :
impacted_process :
description_fr :
description_pl :
description_de :
description_es :
description_pt :
description_it :
description_nl :
description_ru :
audit_schedule :
editor :
keywords : winmerge,merge,compare
licence :
homepage :
package_uuid : 28a53f07-c577-4ee2-9213-55addb82a873
valid_from :
valid_until :
forced_install_on :
changelog :
min_os_version :
max_os_version :
icon_sha256sum : 57671e8736c51c3c7fb97fc5f21adb7b8299f568c9b663df9e2b1a8988da88e4
signer : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature : Enw4xjIWEsSewcNiM1dqaPJ3ckAIjZXNd+SLUko0ID0sjzUffkvuLp+Y+7yjGSvxf0z0rZlaa1KIjojh3W2mjZLkUKYPl7R/vQzXl8pPNF8SzBSIUu9zmKZL00EiyBQFbah/9SGCqARYdAEmethDw/32urwcnFrfKXn+Nnnv63Rqfd4d+f28qeBlwleoTJ/UAemDvhb1PwRQVBW84bGytOjqoWFHKTP02YR9MHK/kjZWxTQw6Juz8JAfybcN/JsDoaglzhPuqKxOAGsM4DHqJakVUXM2Jzo4X1bI+4ZpXg2cpDSsbQeEVeItlArxprs71H2+7HDmrr+Xwvl1k/OR/w==
signature_date : 2022-02-01T17:07:19.632487
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
Setup.py
# -*- 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 platform
import json
# registry key(s) where WAPT will find how to remove the application(s)
bin_contains = "WinMerge-%s-x64-Setup.exe"
def install():
# Declaring local variables
package_version = control.get_software_version()
bin_name = glob.glob(bin_contains % package_version)[0]
# Uninstalling older versions of the software
for to_uninstall in installed_softwares(r"WinMerge_is1"):
if Version(to_uninstall["version"]) < Version(package_version) or force:
print("Removing: %s (%s)" % (to_uninstall["name"], to_uninstall["version"]))
killalltasks(control.impacted_process.split(","))
run(uninstall_cmd(to_uninstall["key"]))
wait_uninstallkey_absent(to_uninstall["key"])
# Installing the software
print("Installing: %s" % control.package)
install_exe_if_needed(
bin_name,
silentflags="/VERYSILENT /SUPPRESSMSGBOXES /NORESTART",
key="WinMerge_is1",
min_version=control.get_software_version(),
)
def update_package():
# Declaring local variables
result = False
proxies = get_proxies()
if not proxies:
proxies = get_proxies_from_wapt_console()
app_name = control.name
api_url = "https://api.github.com/repos/WinMerge/winmerge/releases/latest"
if control.architecture == "x64":
arch_contains = "x64"
## else:
## arch_contains = ".WINDOWS.msi"
# Getting latest version information from official sources
print("API used is: %s" % api_url)
json_load = json.loads(wgets(api_url, proxies=proxies))
version = json_load["tag_name"].replace("v", "")
for download in json_load["assets"]:
if bin_contains % version in download["name"]:
download_url = download["browser_download_url"]
version = json_load["tag_name"].replace("v", "")
latest_bin = download["name"]
break
print("Latest %s version is: %s" % (app_name, version))
print("Download URL is: %s" % download_url)
# Downloading latest binaries
if not isfile(latest_bin):
print("Downloading: %s" % latest_bin)
wget(download_url, latest_bin, proxies=proxies)
## # Checking version from file
## version_from_file = get_version_from_binary(latest_bin)
## # if not version_from_file.startswith(version) and version_from_file != '':
## if Version(version_from_file) != Version(version) and version_from_file != "":
## print("Changing version to the version number of the binary")
## os.rename(latest_bin, bin_contains + '-Setup.exe')
## 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(version)
# Validating update-package-sources
return result
def get_proxies():
r"""Return system proxy with the urllib python library
>>> get_proxies()
{'http': 'http://srvproxy.ad.domain.lan:8080',
'https': 'http://srvproxy.ad.domain.lan:8080'}
"""
if platform.python_version_tuple()[0] == "3":
from urllib.request import getproxies
else:
from urllib import getproxies
return getproxies()
def get_proxies_from_wapt_console():
r"""Return proxy information from the current user WAPT console
>>> get_proxies_from_wapt_console()
{'http': 'http://srvproxy.ad.domain.lan:8080',
'https': 'http://srvproxy.ad.domain.lan:8080'}
"""
proxies = {}
if platform.system() == "Windows":
waptconsole_ini_path = makepath(user_local_appdata(), "waptconsole", "waptconsole.ini")
else:
waptconsole_ini_path = makepath(user_home_directory(), ".config", "waptconsole", "waptconsole.ini")
if isfile(waptconsole_ini_path):
proxy_wapt = inifile_readstring(waptconsole_ini_path, "global", "http_proxy")
if proxy_wapt:
proxies = {"http": proxy_wapt, "https": proxy_wapt}
return proxies
def get_version_from_binary(filename, property_name="ProductVersion"):
r"""Get installer version from file informations, for now, only exe and msi files are compatibles
Args:
filename (str): path to the file
property_name (str): selected property
Returns:
str: version number
"""
if filename.endswith(".msi"):
return get_msi_properties(filename)[property_name]
else:
return get_file_properties(filename)[property_name]
def remove_outdated_binaries(version, filename_contains=None, list_extensions=["exe", "msi", "deb", "rpm", "dmg", "pkg"]):
r"""Remove files based on the version contained in his filename
Args:
version (str): version number of keeped files
filename_contains (str or list of str): Part of the filename that must be contained (useful for distinguishing architecture and os)
list_extensions (str or list of str): file extensions of verified files
Returns:
None
.. versionadded:: 2.0
"""
if type(list_extensions) != list:
list_extensions = [list_extensions]
if filename_contains:
if type(filename_contains) != list:
filename_contains = [filename_contains]
list_extensions = ["." + ext for ext in list_extensions if ext[0] != "."]
for file_ext in list_extensions:
for bin_in_dir in glob.glob("*%s" % file_ext):
if not version in bin_in_dir:
remove_file(bin_in_dir)
if filename_contains:
for filename_contain in filename_contains:
if not filename_contain in bin_in_dir:
remove_file(bin_in_dir)
ab23bfeedb013cf0bea19352b7ba14c16d84c713fe3d53c35b4e8765f3e227b3 : setup.py
67bfc32e2d9027f4e42606c790fc134cc20a400c6cb2d98188a508880b14d998 : WinMerge-2.16.18-x64-Setup.exe
57671e8736c51c3c7fb97fc5f21adb7b8299f568c9b663df9e2b1a8988da88e4 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
621ec0bdfbdb3c09df250fb732d313afbc407e594fc64704bb13b3a6cd64a3aa : luti.json
99d68095c0a35819384a178567ee87aa89470ef5b0369e4b02e57c6dbbf9376f : WAPT/control