Skip to content

Commit

Permalink
Add onInstall check
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonarddeR committed Jul 25, 2023
1 parent 4ae14a4 commit fe18bae
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions addon/installTasks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import typing
from time import sleep
import addonHandler
import gui
import wx

if typing.TYPE_CHECKING:
from .lib import configuration
Expand All @@ -12,6 +15,22 @@


def onInstall():
for addon in addonHandler.getAvailableAddons():
if addon.name == "nvdaRd":
result = gui.messageBox(
# Translators: message asking the user to remove nvdaRd add-on
_("This add-on was previously called NVDA Remote Desktop. "
"You have an installed version of that add-on. "
"Would you like to update to RDAccess?"),
# Translators: question title
_("Previous version detected"),
wx.YES_NO|wx.ICON_QUESTION,
gui.mainFrame
)
if result == wx.YES:
addon.requestRemove()
else:
raise addonHandler.AddonError("Installed nvdaRd found that needs to be removed first")
configuration.initializeConfig()


Expand Down

0 comments on commit fe18bae

Please sign in to comment.