tis-waptsetup
2.5.5.15602-6
Keep WAPTSetup up-to-date
3354 downloads
See build result See VirusTotal scan
![tis-waptsetup icon](/wapt/icons/6dc8f2da8919852f729d395f63b92a33a0304323c3535981d335a50a83273ca5.png)
Description
- package : tis-waptsetup
- name : WAPT Setup
- version : 2.5.5.15602-6
- categories : System and network
- maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
- installed_size : 427978752
- editor : Tranquil IT
- licence :
- signature_date : 2024-05-26T13:00:12.186034
- size : 45.67 Mo
- locale : all
- target_os : windows
- impacted_process :
- architecture : all
- Homepage : https://www.wapt.fr/
control
package : tis-waptsetup
version : 2.5.5.15602-6
architecture : all
section : base
priority : optional
name : WAPT Setup
categories : System and network
maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
description : Keep WAPTSetup up-to-date
depends :
conflicts :
maturity : PROD
locale : all
target_os : windows
min_wapt_version : 2.1
sources : https://wapt.tranquil.it/wapt/releases/latest
installed_size : 427978752
impacted_process :
description_fr : Maintient WAPTSetup à jour
description_pl : Aktualizuj WAPTSetup
description_de : WAPTSetup auf dem neuesten Stand halten
description_es : Mantén actualizado WAPTSetup
description_pt : Manter o WAPTSetup actualizado
description_it : Mantenere aggiornato WAPTSetup
description_nl : WAPTSetup up-to-date houden
description_ru : Поддерживайте WAPTSetup в актуальном состоянии
audit_schedule : 1d
editor : Tranquil IT
keywords :
licence :
homepage : https://www.wapt.fr/
package_uuid : a5057d3b-a750-4462-baa3-d0abe6740d67
valid_from :
valid_until :
forced_install_on :
changelog : https://www.wapt.fr/en/doc/wapt-changelog.html
min_os_version : 6.1
max_os_version :
icon_sha256sum : 6dc8f2da8919852f729d395f63b92a33a0304323c3535981d335a50a83273ca5
signer : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature : g8hlwU7MHa27pFLbwLC3DxEgccXOFqrhJFai32cKvXL7E4oLD5417Jy6oVD1+p/dsq0g0XZwiItev8ZIbqX4iqrZOPfw6Piwe9rk6sCP5F3c+/QrxMh0tdzGwCtqtXvZDTpUlVZO8hR425upeRifjyo1y6hHw+S4A4kAfUFC0MmHkTK3O5w3gVVio0bXruECJJRn4RKXHRjKIHuaXrvEYYGHvM+xxi2mqeI6XMMPT/JaFkTIu/oduTYY0qupskxeloEhP4vbzdKUVBLz/MTeQWEFGdbu4Bkh5euvGahGEu8EeS+yGwPIqo5j42OZmWNSrJ6844Pc8UXIQuH/D5LvXg==
signature_date : 2024-05-26T13:00:12.186034
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 -*-
from setuphelpers import *
import os
import tempfile
import codecs
import time
TASK_TEMPLATE = """\
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>%(created_on)s</Date>
<Author>WAPT</Author>
</RegistrationInfo>
<Triggers>
<TimeTrigger>
<StartBoundary>%(run_on)s</StartBoundary>
<EndBoundary>%(expired_on)s</EndBoundary>
<ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
<Enabled>true</Enabled>
</TimeTrigger>
<BootTrigger>
<StartBoundary>%(run_on)s</StartBoundary>
<EndBoundary>%(expired_on)s</EndBoundary>
<ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
<Enabled>true</Enabled>
</BootTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>S-1-5-18</UserId>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>true</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT1H</ExecutionTimeLimit>
<DeleteExpiredTaskAfter>PT0S</DeleteExpiredTaskAfter>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>%(cmd)s</Command>
<Arguments>%(parameters)s</Arguments>
</Exec>
</Actions>
</Task>
"""
def create_onetime_task(name, cmd, parameters=None, delay_minutes=2, max_runtime=10, retry_count=3, retry_delay_minutes=1):
"""creates a one time Windows scheduled task and activate it."""
run_time = time.localtime(time.time() + delay_minutes * 60)
# task
if windows_version(2) <= Version("5.2", 2):
# for win XP
system_account = r'"NT AUTHORITY\SYSTEM"'
# windows xp doesn't support one time startup task /Z nor /F
hour_min = time.strftime("%H:%M:%S", run_time)
run_notfatal('schtasks /Delete /TN "%s" /F' % name)
return run('schtasks /Create /SC ONCE /TN "%s" /TR "%s %s" /ST %s /RU %s' % (name, cmd, parameters, hour_min, system_account))
else:
system_account = "SYSTEM"
xmlfile = tempfile.mktemp(".xml")
created_on = time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime(time.time()))
run_on = time.strftime("%Y-%m-%dT%H:%M:%S", run_time)
expired_on = time.strftime("%Y-%m-%dT%H:%M:%S", time.localtime(time.time() + 90 * 24 * 3600))
codecs.open(xmlfile, "wb", encoding="utf8").write(TASK_TEMPLATE % locals())
result = run('schtasks /Create /F /TN "%s" /XML "%s"' % (name, xmlfile))
if isfile(xmlfile):
remove_file(xmlfile)
return result
def full_waptagent_install(min_version, packaged_wapt_version, at_startup=False):
# get it from
waptdeploy_path = makepath(tempfile.gettempdir(), "waptdeploy.exe")
if isfile(waptdeploy_path):
killalltasks("waptdeploy.exe")
remove_file(waptdeploy_path)
filecopyto(makepath("patchs", "waptdeploy.exe"), waptdeploy_path)
waptdeploy_version = get_file_properties(waptdeploy_path)["FileVersion"]
if waptdeploy_version != packaged_wapt_version:
raise Exception("waptdeploy version %s does not match packaged wapt version %s . aborting" % (waptdeploy_path, packaged_wapt_version))
# hash and setup filename is specified in first line of waptagent.sha256 file
# <hash> <setup filename>
(expected_sha256, setup_filename) = open("waptagent.sha256", "r").read().strip().split(" ", 1)
waptagent_path = makepath(tempfile.gettempdir(), "waptsetup.exe")
if isfile(waptagent_path):
killalltasks("waptsetup.exe")
remove_file(waptagent_path)
if isfile(setup_filename):
filecopyto(setup_filename, waptagent_path)
if at_startup or isrunning("waptexit.exe"):
cmd = "%s --hash=%s --waptsetupurl=%s --wait=15 --temporary --force --minversion=%s" % (
waptdeploy_path,
expected_sha256,
waptagent_path,
min_version,
)
if not at_startup:
print("waptexit is running, scheduling a one time task at system startup with command %s" % cmd)
# task at system startup
try:
print(run('schtasks /Create /RU SYSTEM /SC ONSTART /TN fullwaptsetupupgrade /TR "%s" /F /V1 /Z' % cmd))
except:
# windows xp doesn't support one time startup task /Z nor /F
run_notfatal("schtasks /Delete /TN fullwaptsetupupgrade /F")
print(run('schtasks /Create /RU SYSTEM /SC ONSTART /TN fullwaptsetupupgrade /TR "%s"' % cmd))
else:
# use embedded waptsetup.exe, wait 15 minutes for other tasks to complete.
print(
create_onetime_task(
"fullwaptsetupupgrade",
waptdeploy_path,
"--hash=%s --waptsetupurl=%s --wait=15 --temporary --force --minversion=%s" % (expected_sha256, waptagent_path, min_version),
delay_minutes=1,
)
)
time.sleep(2)
run_notfatal('SCHTASKS /Run /TN "fullwaptsetupupgrade"')
def install():
# if you want to modify the keys depending on environment (win32/win64... params..)
if installed_softwares("WAPT Server_is1"):
print("Wapt server is installed on this host. Aborting")
return "OK"
waptexe = os.path.join(WAPT.wapt_base_dir, "wapt-get.exe")
if os.path.isfile(waptexe):
installed_wapt_version = get_file_properties(waptexe)["FileVersion"]
else:
installed_wapt_version = "0.0.0.0"
# get upgrade package informations
(package_wapt_version, package_packaging) = control.version.split("-", 1)
package_packaging = int(package_packaging)
if not force and Version(installed_wapt_version, 4) >= Version(package_wapt_version, 4):
print(
"Your current wapt (%s) is same or more recent than the upgrade package (%s). Skipping agent reinstall..."
% (installed_wapt_version, control.version)
)
else:
print(
"Setting up upgrade from wapt version %s to %s. waptagent install planned for %s"
% (installed_wapt_version, package_wapt_version, time.ctime(time.time() + 1 * 60))
)
full_waptagent_install(str(Version(package_wapt_version, 4)), package_wapt_version)
def audit():
# Comparing installed WAPT agent version and package version
(package_wapt_version, package_packaging) = control.version.split("-", 1)
try:
with open(os.path.join(WAPT.wapt_base_dir, "version-full")) as fver:
installed_wapt_version = fver.read().split("-", 1)[0]
except:
installed_wapt_version = "0.0.0.0"
if Version(installed_wapt_version) < Version(package_wapt_version):
print(
"The installed version of the WAPT agent and the version of the package are not corresponding. The installation may have just finished. If this warning persists one day after installation, please take this into consideration."
)
return "WARNING"
else:
print("The installed version of the WAPT agent and the version of the package are corresponding.")
return "OK"
update_package.py
# -*- coding: utf-8 -*-
from setuphelpers import *
from waptutils import get_sha256
import json
def update_package():
# Declaring local variables
package_updated = False
proxies = get_proxies()
if not proxies:
proxies = get_proxies_from_wapt_console()
# Getting latest version information from WAPT API
url = "https://wapt.tranquil.it/wapt/releases/latest/wapt_agent_list.json"
json_load = json.loads(wgets(url, proxies=proxies))
for a in json_load:
if a["os_type"] == "debian": # Windows is not in the json but version is the same
version = a["wapt_version"]
# Deleting binaries
for f in glob.glob("*.exe") + glob.glob("*.msi"):
print("Removing: %s" % f)
remove_file(f)
if isdir("patchs"):
remove_tree("patchs")
mkdirs("patchs")
# Downloading latest binaries
download_url = "https://wapt.tranquil.it/wapt/releases/latest/bin/win32/waptdeploy.exe"
latest_bin = download_url.split("/")[-1]
print("Download URL is: %s" % download_url)
if not isfile(latest_bin):
print("Downloading: %s" % latest_bin)
wget(download_url, latest_bin, proxies=proxies)
else:
print("Binary is present: %s" % latest_bin)
shutil.move(latest_bin, "patchs")
download_url = "https://wapt.tranquil.it/wapt/releases/latest/waptsetup.exe"
latest_bin = download_url.split("/")[-1]
print("Download URL is: %s" % download_url)
if not isfile(latest_bin):
print("Downloading: %s" % latest_bin)
wget(download_url, latest_bin, proxies=proxies)
else:
print("Binary is present: %s" % latest_bin)
with open("waptagent.sha256", "w") as file:
file.write(get_sha256(latest_bin) + " " + latest_bin)
# 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 (from: %s to: %s)" % (version, version_from_file))
# os.rename(latest_bin, latest_bin.replace(version, version_from_file))
version = version_from_file
else:
print("Binary file version corresponds to online version")
# Changing version of the package
version = get_version_from_binary(latest_bin)
if Version(version) > Version(control.get_software_version()):
print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
package_updated = True
else:
print("Software version up-to-date (%s)" % Version(version))
control.set_software_version(version)
control.save_control_to_wapt()
# Validating or not update-package-sources
return package_updated
cbf0f5b8bea79b323c05e594b59f70c99deed2b3a147b9068c52eed5fe33d264 : setup.py
: __pycache__
6518d10269a2a90cc6a96b929c0074152b1a2776b1912646773cb1cd69dd074c : waptsetup.exe
e89537125c16842746fd1282dc6ada6624d17803874d9f08e6051f0b4456cff5 : update_package.py
84f7516adba6cf8064f36f1fd6f8a47031280801b8de8dae6285a55f1bdc98d1 : patchs/waptdeploy.exe
6dc8f2da8919852f729d395f63b92a33a0304323c3535981d335a50a83273ca5 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
fe37cc8f9d188e5ccef1a8d4ef21aad82ee1a1545447f8fc6c2f98478865c323 : luti.json
d6806ee6bd6e3ab5e25e6c9a4d9f856ebf1517a6c8f0a15dc8ba5dbca2ae604e : waptagent.sha256
d3b5ed8e913fe0b6220709abf31f0ce2cf3f392cc744708df94f995497f38a65 : WAPT/control