[RESOLVED] Detection of a new version of an executable (upgrade_package)
Published: September 9, 2022 - 8:14 AM
Good morning,
I am running a WAPT Enterprise 2.2.2.12388 server under Ubuntu.
My question concerns the upgrade_package functionality available in WAPT packages. I understand that this function allows you to define how the package should be updated; however, I don't understand how version detection is performed in the console.
For example, I took the tis-powertoys package and modified it, so I currently have two versions. The original version (0.61.1-7) correctly shows that an update is available from the publisher (the PowerToys Git repository) by displaying the text in red, but my slightly modified version (0.61.1-8) does not report any update, even though it is the same executable. Can you tell me how this version detection mechanism works and how I can configure it to react to the release of a new version of the executable?
I don't believe I've modified the upgrade_package code, but just in case, I'll put it here:
I am running a WAPT Enterprise 2.2.2.12388 server under Ubuntu.
My question concerns the upgrade_package functionality available in WAPT packages. I understand that this function allows you to define how the package should be updated; however, I don't understand how version detection is performed in the console.
For example, I took the tis-powertoys package and modified it, so I currently have two versions. The original version (0.61.1-7) correctly shows that an update is available from the publisher (the PowerToys Git repository) by displaying the text in red, but my slightly modified version (0.61.1-8) does not report any update, even though it is the same executable. Can you tell me how this version detection mechanism works and how I can configure it to react to the release of a new version of the executable?
I don't believe I've modified the upgrade_package code, but just in case, I'll put it here:
Code: Select all
def update_package():
# Declaring local variables
result = False
proxies = get_proxies()
architecture = control.architecture
if not proxies:
proxies = get_proxies_from_wapt_console()
app_name = control.name
git_repo = "microsoft/PowerToys"
url_api = "https://api.github.com/repos/%s/releases/latest" % git_repo
bin_name_sub = "PowerToysSetup%s.exe"
# Getting latest version information from official sources
print("API used is: %s" % url_api)
json_load = json.loads(wgets(url_api, proxies=proxies))
for download in json_load["assets"]:
if bin_contains in download["name"] and architecture in download["name"]:
url_dl = 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" % url_dl)
# Downloading latest binaries
if not isfile(latest_bin):
print("Downloading: %s" % latest_bin)
wget(url_dl, latest_bin, proxies=proxies)
# Changing version of the package
if Version(version) > control.get_software_version():
print("Software version updated from: %s to: %s" % (control.get_software_version(), Version(version)))
result = True
control.version = "%s-%s" % (Version(version), control.version.split("-", 1)[-1])
# control.set_software_version(Version(version))
control.save_control_to_wapt()
# Deleting outdated binaries
remove_outdated_binaries(version)
# Validating update-package-sources
return result