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:
And
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

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