Updating python plugin version

I am developing a rhino command using python.

Each release installs in a path that includes the version. On windows:
C:\Users[username]\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\PythonPlugins\RePort (a59528fb-b452-4852-864c-6c8bacaa5049)\0.2.1.0

The problem: instead of having version 0.1.0 replaced by version 0.2.0 the new version is installed in a separate directory… and Rhino continues to use the older version.

Releases are made following (I think) the steps described in the guide. Specifically, I zip up the plugin.py and RePort_cmd.py files, and rename the result to Reification_Rhino_Exporter.rhi.

If someone could tell me why the version upgrade does not work (or how to work around the issue) I would be very grateful.

@Alain - is this something you can help with?

@Alain @dale this seems to have been asked previously, before the release of Rhino7.

Since I am trying to support Rhino versions 5 through 7 a general work-around would be very helpful, even if the latest version of Rhino has fixed the issue.

If the answer is that the lowest installed version must search for later versions that could be a common first call in all new releases - but I’m not sure how to to reliably locate the plugin in order to search for later versions.

@Alain @dale is there a way to execute a specific version of a command script?
For example, if I used sys.path to find the parent directory containing versions of the command, how would I tell Rhino to execute the latest version? Something like:

rs.Command("-MyCommand [magical version specifier)"]

Or, maybe I could specify the path to the version and rerun, with something like:

rs.CommandPath("-MyCommand", "path/to/version")
rs.Command("-MyCommand")

The current solution of asking users to find and delete older versions of the command is… really bad.

Hi @Alain,

I’ve logged an issue for this, as I cannot provide you a clear answer today.

https://mcneel.myjetbrains.com/youtrack/issue/RH-63320

– Dale

@dale thank you for ticketing this.

In the meantime, here’s my “solution” : never update the version field in __plugin__.py.
If the version is not changed the new install will overwrite the old one.
Note that it is not permitted to omit the version field (this will result in an exception from: System.Version.TryParseVersion(String version, VersionResult& result)).

Tested using:
Rhino Version 7 (7.3.21053.23031, 2/22/2021) Commercial

Addendum: A natural choice for an unusable version number would be “0.0.0.0”
Unfortunately this choice is not permitted - the installing fails with the statement “This package is not compatible with the Rhino Installer Engine”.

However, a version number of “0.1.0.0” seems to be OK.