diff --git a/source/gui/installerGui.py b/source/gui/installerGui.py index ff8475d8da2..f2165cd255b 100644 --- a/source/gui/installerGui.py +++ b/source/gui/installerGui.py @@ -96,9 +96,14 @@ def __init__(self, parent): ctrl = self.startOnLogonCheckbox = wx.CheckBox(self, label=_("Use NVDA on the Windows &logon screen")) ctrl.Value = config.getStartOnLogonScreen() if self.isUpdate else True optionsSizer.Add(ctrl) - # Translators: The label of a checkbox option in the Install NVDA dialog. - ctrl = self.createDesktopShortcutCheckbox = wx.CheckBox(self, label=_("Create &desktop icon and shortcut key (control+alt+n)")) - ctrl.Value = installer.isDesktopShortcutInstalled() if self.isUpdate else True + shortcutIsPrevInstalled=installer.isDesktopShortcutInstalled() + if self.isUpdate and shortcutIsPrevInstalled: + # Translators: The label of a checkbox option in the Install NVDA dialog. + ctrl = self.createDesktopShortcutCheckbox = wx.CheckBox(self, label=_("&Keep existing desktop shortcut")) + else: + # Translators: The label of a checkbox option in the Install NVDA dialog. + ctrl = self.createDesktopShortcutCheckbox = wx.CheckBox(self, label=_("Create &desktop icon and shortcut key (control+alt+n)")) + ctrl.Value = shortcutIsPrevInstalled if self.isUpdate else True optionsSizer.Add(ctrl) # Translators: The label of a checkbox option in the Install NVDA dialog. ctrl = self.copyPortableConfigCheckbox = wx.CheckBox(self, label=_("Copy &portable configuration to current user account")) diff --git a/source/installer.py b/source/installer.py index 408a4fb7972..ddb781e0670 100644 --- a/source/installer.py +++ b/source/installer.py @@ -39,11 +39,12 @@ def createShortcut(path,targetPath=None,arguments=None,iconLocation=None,working path=os.path.join(specialPath,path) if not os.path.isdir(os.path.dirname(path)): os.makedirs(os.path.dirname(path)) + shortcutExists=os.path.isfile(path) short=wsh.CreateShortcut(path) short.TargetPath=targetPath if arguments: short.arguments=arguments - if hotkey: + if not shortcutExists and hotkey: short.Hotkey=hotkey if iconLocation: short.IconLocation=iconLocation @@ -164,7 +165,7 @@ def isDesktopShortcutInstalled(): shortcutPath=os.path.join(specialPath,"nvda.lnk") return os.path.isfile(shortcutPath) -def unregisterInstallation(): +def unregisterInstallation(keepDesktopShortcut=False): import nvda_service try: nvda_service.stopService() @@ -176,7 +177,7 @@ def unregisterInstallation(): pass wsh=_getWSH() desktopPath=os.path.join(wsh.SpecialFolders("AllUsersDesktop"),"NVDA.lnk") - if os.path.isfile(desktopPath): + if not keepDesktopShortcut and os.path.isfile(desktopPath): try: os.remove(desktopPath) except WindowsError: @@ -254,7 +255,7 @@ def tryCopyFile(sourceFilePath,destFilePath): def install(shouldCreateDesktopShortcut=True,shouldRunAtLogon=True): prevInstallPath=getInstallPath(noDefault=True) - unregisterInstallation() + unregisterInstallation(keepDesktopShortcut=shouldCreateDesktopShortcut) installDir=defaultInstallPath startMenuFolder=defaultStartMenuFolder # Remove all the main executables always. diff --git a/user_docs/en/changes.t2t b/user_docs/en/changes.t2t index 2ed4f57e397..b67418fbbb8 100644 --- a/user_docs/en/changes.t2t +++ b/user_docs/en/changes.t2t @@ -24,6 +24,7 @@ - In the NVDA Review Cursor preferences dialog, the Follow keyboard focus option has been renamed to Follow system focus for consistency with terminology used elsewhere in NVDA. - When braille is tethered to review and the cursor is on an object which is not a text object (e.g. an editable text field), cursor routing keys will now activate the object. (#2386) - The Save Settings On Exit option is now on by default for new configurations. +- When updating a previously installed copy of NVDA, the desktop shortcut key is no longer forced back to control+alt+n if it was manually changed to something different by the user. (#2572) == Bug Fixes ==