mono / mono-addins

Mono.Addins is a generic framework for creating extensible applications, and for creating add-ins which extend those applications.
MIT License
164 stars 93 forks source link

Fix add-in downgrade issue #191

Closed slluis closed 1 year ago

slluis commented 1 year ago

In some cases when add-ins are downgraded the add-in database may be left in an invalid status. This happened because the add-in scanner did not properly compare the versions of the old and the new add-in, so it did not uninstall the old add-in when versions were different. This resulted on the old and new descriptions of the add-in to be kept in the database, and it might generate add-in dependency errors.

This also happened when upgrading, but since the engine always loads add-ins with the highest version it doesn't matter if there is one with lower version also registered.

The solution is to cache information about the old add-in version, and when comparing ids, use that information.

Added unit tests.