Could we add hook points for managing an addon lifecycle? Specifically for the install, update, and delete events.
The install and delete hook points would allow me to avoid asking users to manually prepare the environment for my code highlighting addon. An update hook-point would let me inform users of my addon of the addons new features (if any).
From the add-on docs: Adding Hooks
I’m not sure that’s such a great idea:
- addons don’t run until Anki is restarted, so it wouldn’t simply be a case of running a hook as an add-on is installed
- on update, the old hook code would run, not the new code
- for uninstalling, I’m not sure users expect actions to be performed when removing an add-on, and an explicit action like roxgib mentioned might be a better approach there.