def __init__(self, parent): self.isUpdate=installer.isPreviousInstall() # Translators: The title of the Install NVDA dialog. super(InstallerDialog, self).__init__(parent, title=_("Install NVDA")) mainSizer = self.mainSizer = wx.BoxSizer(wx.VERTICAL) # Translators: An informational message in the Install NVDA dialog. msg=_("To install NVDA to your hard drive, please press the Continue button.") if self.isUpdate: # Translators: An informational message in the Install NVDA dialog. msg+=" "+_("A previous copy of NVDA has been found on your system. This copy will be updated.") if not os.path.isdir(installer.defaultInstallPath): # Translators: a message in the installer telling the user NVDA is now located in a different place. msg+=" "+_("The installation path for NVDA has changed. it will now be installed in {path}").format(path=installer.defaultInstallPath) dialogCaption=wx.StaticText(self,label=msg) mainSizer.Add(dialogCaption) optionsSizer = wx.BoxSizer(wx.VERTICAL) # Translators: The label of a checkbox option in the Install NVDA dialog. 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) 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")) ctrl.Value = False if globalVars.appArgs.launcher: ctrl.Disable() optionsSizer.Add(ctrl) mainSizer.Add(optionsSizer) sizer = wx.BoxSizer(wx.HORIZONTAL) # Translators: The label of a button to continue with the operation. ctrl = wx.Button(self, label=_("&Continue"), id=wx.ID_OK) ctrl.SetDefault() ctrl.Bind(wx.EVT_BUTTON, self.onInstall) sizer.Add(ctrl) sizer.Add(wx.Button(self, id=wx.ID_CANCEL)) # If we bind this using button.Bind, it fails to trigger when the dialog is closed. self.Bind(wx.EVT_BUTTON, self.onCancel, id=wx.ID_CANCEL) mainSizer.Add(sizer) self.Sizer = mainSizer mainSizer.Fit(self)
def doSilentInstall(): prevInstall=installer.isPreviousInstall() doInstall(installer.isDesktopShortcutInstalled() if prevInstall else True,config.getStartOnLogonScreen() if prevInstall else True,False,prevInstall,True)