Page 1 of 1

[SOLVED] Retrieve the version of a WAPT package installed on a machine

Published: March 18, 2023 - 10:08 AM
by brice73
Hello,
I would like to retrieve the version number of the WAPT package installed for software deployed on a machine (for use in the install() function of the new package version). Do you know how to do this?

Re: Retrieving the version of a WAPT package installed on a machine

Published: March 20, 2023 - 3:05 PM
by sfonteneau
To clarify the question:

Do you want to retrieve the currently installed software version?

Do you want to retrieve the version of the package you are currently installing?

Do you want to retrieve the previous version of the installed package?

Simon

Re: Retrieving the version of a WAPT package installed on a machine

Published: March 22, 2023 - 10:08 AM
by brice73
Hello Simon,

I would like to retrieve the version number of the package that is already installed on the machine (so in principle the previous version, but depending on the case there may be an additional increment), not the version number of the package that will be installed.

(Being able to retrieve the version of the software already installed would also be useful.)

Re: Retrieving the version of a WAPT package installed on a machine

Published: March 22, 2023 - 11:41
by sfonteneau
To retrieve the software version (i.e., what appears in appwiz.cpl):

Code: Select all

>>> installed_softwares('chrome')
[{'key': '{5F34DD8E-A9AA-35DA-A38D-EBB349D86957}', 'name': 'Google Chrome', 'version': '111.0.5563.111', 'install_date': '2023-03-21 00:00:00', 'install_location': '', 'uninstall_string': 'MsiExec.exe /X{5F34DD8E-A9AA-35DA-A38D-EBB349D86957}', 'publisher': 'Google LLC', 'system_component': 0, 'win64': True}]
The advantage is that we can see what is installed regardless of whether it was installed by Wapt or not

Otherwise :

Code: Select all

    
    for p in WAPT.installed(include_errors=True):
        if control.package == p.package:
            print(p.version)
To retrieve the currently installed version, although I admit I've never used it, I always use the first method

Re: Retrieving the version of a WAPT package installed on a machine

Published: March 23, 2023 - 9:55 PM
by brice73
Thank you.

Sorry for the question about the software version; I haven't used the `installed_softwares()` function yet and hadn't realized it could return the software version.

Regarding the package version, a network of workstations might have the same software version but different installed package versions (some workstations not having the latest package installed). Therefore, the update process can vary depending on whether a workstation has the latest package version installed or an earlier one. Rather than testing the changes made by the latest installed package, it seemed simpler and faster to retrieve this information and then condition the installation of the new package version based on the installed package version.

With your guidance, I understand how to retrieve the installed package version from the workstation's database (the 'version' field provides the software version associated with the package version).

Re: Retrieving the version of a WAPT package installed on a machine

Published: March 27, 2023 - 4:27 PM
by dcardon
Thanks Brice for the feedback. :-)
I'm marking the topic as resolved,
Denis