[RESOLVED] Detection of a new version of an executable (upgrade_package)

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
alain17
Messages: 24
Registration: June 17, 2022 - 07:32

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.
powertoys-upgrade.png
powertoys-upgrade.png (13.63 KB) Viewed 3457 times
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
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

September 9, 2022 - 11:25

Hello,

the comparison is based on the packages referenced in the store selected in the console (by default https://store.wapt.fr). It does not use information from the update package. If you want to make comparisons against the source Git repository, the information can be retrieved from https://luti.tranquil.it/ , but it is not currently integrated into the console display.

If a new version of the package is available on the publisher's website, it may already be in the wapt-testing repository, https://wapt.tranquil.it/wapt-testing/ , which you should check.

Regards,

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
alain17
Messages: 24
Registration: June 17, 2022 - 07:32

September 9, 2022 - 2:00 PM

Hello,

thank you for your reply. It's a shame that it's not possible yet, but is it something that could be implemented in a future version? For example, via a function that could be implemented in the package?

Best regards
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

September 9, 2022 - 4:10 PM

For software version retrieval, there's always a bit of workaround involved, even for sites with JSON APIs (which don't adhere to their own format), and it requires regular patching. Many software programs don't even provide a consistent version on their website, and you have to monitor changes altogether...

The best solution would be to integrate the repository interface into LUTI, but if the package isn't yet available (because the developer has been more creative than usual with their website or software), that doesn't help much either. Normally, once the new software is listed in LUTI, the package is built, tested, validated, and then uploaded to wapt-testing, so it's already available.

Best regards,

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Locked