nvda icon indicating copy to clipboard operation
nvda copied to clipboard

Add-on handler: current install/uninstall order causes removal of add-on-specific information the add-on installer has added

Open josephsl opened this issue 8 years ago • 4 comments

Hi,

Reported by @DerekRiemer and subsequently confirmed:

If an add-on performs operation such as adding DLL's to path environment variable, migrating settings after an install and what not, these information will be lost when NVDA restarts.

STR:

  1. Create an add-on that performs actions such as adding its path to path environment variables while running onInstall function, and removes this very info via onUninstall function.
  2. Install this add-on.
  3. After restarting NVDA, upgrade (reinstall) the add-on.

Expected: information added in install function should be kept. Actual: information is removed via uninstall function. Cause: install/uninstall order.

Technical: onInstall function is run when an add-on is installed. During an upgrade, onInstall is called. When NVDA restarts, onUninstall function is called, undoing the work the instlal function has performed. This causes issues such as loss of just added path, migration being canceled and so on.

Solutions:

  1. Let add-ons detect loss of functionality and mitigate workarounds such as manually adding its path.
  2. Create a new function (onPostInstall) that'll let add-ons take care of this very scenario.
  3. Create a mechanism for add-ons to specify that onUninstall should not be called when upgrading.

Thanks.

josephsl avatar Oct 13 '17 15:10 josephsl

Technical, this isn't a bug, as much as very unexpected behavior. See https://github.com/dictationbridge/dictationbridge-nvda/issues/16 I agree that some sort of postInstall or onUpdateUninstall or onUpdatePreviousUninstall, or onOnlyRemove method be created to allow code to choose whether to run the uninstaller on update. This would look like run onUpdateUninstall if old addon exists.

derekriemer avatar Oct 16 '17 08:10 derekriemer

cc: @feerrenrut, @michaelDCurran

Adriani90 avatar Feb 03 '20 20:02 Adriani90

cc: @CyrilleB79, @seanbudd this issue very probably still exists in NVDA 2023.2 right?

Adriani90 avatar Sep 12 '23 19:09 Adriani90

@josephsl is this still an issue in NVDA 2024.1 with the current add-on store?

Adriani90 avatar Apr 24 '24 21:04 Adriani90

We didn't get any updates from Joseph upon request since many years on this, I am closing as abandoned. if you are still having this issue, please comment and we can reopen.

Adriani90 avatar May 09 '24 20:05 Adriani90

@josephsl, @derekriemer: if this issue is still relevant with NVDA 2024.1, please comment here so that this issue be reopened.

CyrilleB79 avatar May 09 '24 21:05 CyrilleB79