[SOLVED] Installing the previous version of a 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
VincentUCA
Messages: 4
Registration: Oct 25, 2023 - 2:49 p.m.

March 19, 2025 - 11:56

WAPT version 2.6

Good morning,
Sorry if a similar topic has already been opened, I couldn't find it.
I'm currently developing a software package whose installer doesn't remove the old version. So I added a piece of code to do that. But for testing purposes, I'd like to be able to reinstall the old version. I think I've done this before, but I didn't take notes and I've since forgotten how.
I found a section in the documentation stating:
Each command that takes a package name as a parameter can also take the package's unique package_uuid as a parameter (wapt-get install, wapt-get forget, etc.). Using a GUID allows you to specify a unique package without ambiguity about its architecture or version. The package_uuid is listed in the output of wapt-get list and wapt-get search. For example:
So I made a

Code: Select all

wapt-get search monpaquet
to retrieve the package ID in the version I'm interested in.
But then when I execute the command

Code: Select all

wapt-get install c65ecfc2-ed87-428a-abc7-1646497ee71e
I get the following error:
Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
install using WAPT packages c65ecfc2-ed87-428a-abc7-1646497ee71e

Results:
Critical:
=== Unavailable packages ===
c65ecfc2-ed87-428a-abc7-1646497ee71e [x64_fr_PROD,DEV,PREPROD]
Where am I going wrong?
Thank you in advance for your reply.
Sincerely.
Vincent
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

March 20, 2025 - 09:42

Hello Vincent,

You can force the installation of a particular version using the following syntax:

Code: Select all

wapt-get install "tis-monpaquet(=2.5.3)"
However, the version "pinning" is not stored in the agent, and therefore the package will be updated at the next wapt-get upgrade.

Sincerely,

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
User avatar
vcardon
WAPT Expert
Messages: 278
Registration: Oct 06, 2017 - 10:55 p.m.
Location: Nantes, France

March 20, 2025 - 7:46 PM

Hello, to follow up on Denis's comment, if you want a version of a software without it updating, duplicate the version you're interested in and rename the package with the software version.

For example: the tis-firefox package for version 136.0.2 would become tis-firefox-pinned-136.0.2.
Vincent CARDON
Tranquil IT
VincentUCA
Messages: 4
Registration: Oct 25, 2023 - 2:49 p.m.

March 21, 2025 - 11:34

Hello everyone,
Thank you for your valuable advice. I successfully tested the installation of an older version of my package. However, the part added by WAPT must not be omitted from the version number, otherwise it won't work. To use the previous example, it looks like this:

Code: Select all

wapt-get install "tis-monpaquet(=2.5.3-2)"
I suggest removing the installation via the UUID of a package from the documentation if it no longer works and adding this method via version "pinning" which I have not been able to find elsewhere.

To be perfectly honest, the package I'm trying to develop is for the Chimera software. A package already exists in the tranquil.it repository with the code to uninstall previous versions, but I've noticed two things.

The first issue is that the Chimera software version number is not recorded in the Windows registry. Therefore, the package code is as follows:

Code: Select all

for to_uninstall in installed_softwares("UCSF Chimera"):
        if Version(to_uninstall["version"]) < Version(last_version):
Always test the condition:

Code: Select all

if 0.0.0.0 < N° de la dernière version:
Therefore, regardless of the version installed, it will be uninstalled.

The second issue is that the `installed_softwares("UCSF Chimera")` function also retrieves the ChimeraX registry key, which also lacks a version number. This results in ChimeraX being uninstalled during the Chimera installation process.

I saw that in the Chimera uninstallation registry key, the version number was indicated in the "DisplayName" key. Therefore, I modified the code as follows:

Code: Select all

for to_uninstall in installed_softwares("UCSF Chimera"):
        to_uninstall_version = to_uninstall["name"].split()[-1]
        if Version(to_uninstall_version) < Version(last_version):
            print(f"Removing: {to_uninstall['name']} ({to_uninstall_version})")
The tested conditions become:

Code: Select all

if 1.18.0.0 <1.19.0.0:
And

Code: Select all

if "ChimeraX"<1.19.0.0:
Because ChimeraX does not have the version number included in "DisplayName", this condition appears to return False.

It's not the cleanest solution, but it works. The latest version of Chimera isn't uninstalled and then reinstalled when the package is updated without changing the software version, and ChimeraX isn't uninstalled either, allowing both software packages to coexist. I admit it's a bit of a nitpick :oops: Because now that I've added the function to remove the desktop shortcut, I don't think I'll touch the code of this package. And normally there's little point in having Chimera and ChimeraX installed on the same machine, but apparently there are functions that were removed from Chimera in ChimeraX that are useful for some users.

Thank you again for responding to my request.
Sincerely.
Vincent
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

March 21, 2025 - 2:11 PM

Hi Vincent,

thanks for the feedback. I'm forwarding your post to the team that maintains the store packages so they can fix the package following your advice. :-)

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
italbot
Messages: 61
Registration: Sep 26, 2023 - 3:50 p.m.

March 24, 2025 - 11:10

Hello,

I've just adapted the code so that an already installed version of ChimeraX isn't uninstalled along with Chimera. Indeed, the version check wasn't working; I've also modified that.

Thank you for bringing this to our attention.

Sincerely,

Ingrid
Tranquil IT
Locked