|
21 | 21 | from gui.dpiScalingHelper import DpiScalingHelperMixin |
22 | 22 | import tones |
23 | 23 |
|
24 | | -def doInstall(createDesktopShortcut,startOnLogon,copyPortableConfig,isUpdate,silent=False,startAfterInstall=True): |
| 24 | +def doInstall( |
| 25 | + createDesktopShortcut=True, |
| 26 | + startOnLogon=True, |
| 27 | + isUpdate=False, |
| 28 | + copyPortableConfig=False, |
| 29 | + silent=False, |
| 30 | + startAfterInstall=True |
| 31 | +): |
25 | 32 | progressDialog = gui.IndeterminateProgressDialog(gui.mainFrame, |
26 | 33 | # Translators: The title of the dialog presented while NVDA is being updated. |
27 | 34 | _("Updating NVDA") if isUpdate |
@@ -49,7 +56,14 @@ def doInstall(createDesktopShortcut,startOnLogon,copyPortableConfig,isUpdate,sil |
49 | 56 | # Translators: the title of a retry cancel dialog when NVDA installation fails |
50 | 57 | title=_("File in Use") |
51 | 58 | if winUser.MessageBox(None,message,title,winUser.MB_RETRYCANCEL)==winUser.IDRETRY: |
52 | | - return doInstall(createDesktopShortcut,startOnLogon,copyPortableConfig,isUpdate,silent,startAfterInstall) |
| 59 | + return doInstall( |
| 60 | + createDesktopShortcut=createDesktopShortcut, |
| 61 | + startOnLogon=startOnLogon, |
| 62 | + copyPortableConfig=copyPortableConfig, |
| 63 | + isUpdate=isUpdate, |
| 64 | + silent=silent, |
| 65 | + startAfterInstall=startAfterInstall |
| 66 | + ) |
53 | 67 | if res!=0: |
54 | 68 | log.error("Installation failed: %s"%res) |
55 | 69 | # Translators: The message displayed when an error occurs during installation of NVDA. |
@@ -78,16 +92,19 @@ def doInstall(createDesktopShortcut,startOnLogon,copyPortableConfig,isUpdate,sil |
78 | 92 | else: |
79 | 93 | wx.GetApp().ExitMainLoop() |
80 | 94 |
|
81 | | -def doSilentInstall(startAfterInstall=True): |
| 95 | +def doSilentInstall( |
| 96 | + copyPortableConfig=False, |
| 97 | + startAfterInstall=True |
| 98 | +): |
82 | 99 | prevInstall=installer.comparePreviousInstall() is not None |
83 | 100 | startOnLogon=globalVars.appArgs.enableStartOnLogon |
84 | 101 | if startOnLogon is None: |
85 | 102 | startOnLogon=config.getStartOnLogonScreen() if prevInstall else True |
86 | 103 | doInstall( |
87 | | - installer.isDesktopShortcutInstalled() if prevInstall else True, |
88 | | - startOnLogon, |
89 | | - False, |
90 | | - prevInstall, |
| 104 | + createDesktopShortcut=installer.isDesktopShortcutInstalled() if prevInstall else True, |
| 105 | + startOnLogon=startOnLogon, |
| 106 | + isUpdate=prevInstall, |
| 107 | + copyPortableConfig=copyPortableConfig, |
91 | 108 | silent=True, |
92 | 109 | startAfterInstall=startAfterInstall |
93 | 110 | ) |
@@ -170,8 +187,10 @@ def __init__(self, parent, isUpdate): |
170 | 187 | # Translators: The label of a checkbox option in the Install NVDA dialog. |
171 | 188 | createPortableText = _("Copy &portable configuration to current user account") |
172 | 189 | self.copyPortableConfigCheckbox = optionsSizer.addItem(wx.CheckBox(self, label=createPortableText)) |
173 | | - self.copyPortableConfigCheckbox.Value = False |
174 | | - if globalVars.appArgs.launcher: |
| 190 | + self.copyPortableConfigCheckbox.Value = bool(globalVars.appArgs.copyPortableConfig) |
| 191 | + if globalVars.appArgs.copyPortableConfig is None: |
| 192 | + # copyPortableConfig is set to C{None} in the main loop, |
| 193 | + # when copying the portable configuration should be disabled at all costs. |
175 | 194 | self.copyPortableConfigCheckbox.Disable() |
176 | 195 |
|
177 | 196 | bHelper = sHelper.addDialogDismissButtons(guiHelper.ButtonHelper(wx.HORIZONTAL)) |
@@ -202,7 +221,12 @@ def __init__(self, parent, isUpdate): |
202 | 221 |
|
203 | 222 | def onInstall(self, evt): |
204 | 223 | self.Hide() |
205 | | - doInstall(self.createDesktopShortcutCheckbox.Value,self.startOnLogonCheckbox.Value,self.copyPortableConfigCheckbox.Value,self.isUpdate) |
| 224 | + doInstall( |
| 225 | + createDesktopShortcut=self.createDesktopShortcutCheckbox.Value, |
| 226 | + startOnLogon=self.startOnLogonCheckbox.Value, |
| 227 | + copyPortableConfig=self.copyPortableConfigCheckbox.Value, |
| 228 | + silent=self.isUpdate |
| 229 | + ) |
206 | 230 | self.Destroy() |
207 | 231 |
|
208 | 232 | def onCancel(self, evt): |
|
0 commit comments