Skip to content

Installer: try multiple times to remove the NVDA exes, giving the installed NVDA extra time to fully exit on the UAC screen#16205

Merged
seanbudd merged 2 commits into
rcfrom
i16199
Feb 25, 2024
Merged

Installer: try multiple times to remove the NVDA exes, giving the installed NVDA extra time to fully exit on the UAC screen#16205
seanbudd merged 2 commits into
rcfrom
i16199

Conversation

@michaelDCurran

@michaelDCurran michaelDCurran commented Feb 21, 2024

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #16199
Fixes #16122

Summary of the issue:

In pr #16174, effort was made to make the installer more robust, including better handling when the installed NVDA is still running, by trying to remove the NVDA exes first, and if any of them fail, restoring them all and not corrupting a user's install.
Although it no longer corrupts the install, it was too fast at at trying to remove the exes and no longer tried multiple times, which did not take into account that the installed NVDA has just been running on the UAC screen, and may still be exiting.

Description of user facing changes

NVDA will try multiple times itself to remove the NVDA exes while waiting for the installed NvDA to fully exit.

Description of development approach

  • When the installer starts, it will now first wait an initial 1 second to give time for the installed NVDA to exit from the UAC screen.
  • When trying to remove each of the NvDA exes, the installer will again try up to 6 times, waiting half a second before the next try. Again, giving much more chance for an installed NvDA to fully exit like it used to.
  • NVDA will always clean up the temporary files it created while trying to remove all of the exes, whether or not it resulted in a retryableFailure.

Testing strategy:

  • Installed NVDA on Windows 11 with no other logged on user. Confirm that after one or more tries, NvDA successfully installs.
  • Installed NVDA on Windows 11 with another logged on user currently running NVDA. Confirm that the installer should fail asking to retry for ever. If cancelled, the install should not be corrupt.
  • Again Install NVDA on Windows 11 with another logged on user currently running NVDA. Confirm that the installer should fail asking to retry until the other user quits NVDA / logs out.

Known issues with pull request:

None known.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

* when starting the install, first wait an initial second to definitely give time for the installed NVDA (that may still be exiting on the UAC screen) to fully exit.
* When deleting each of the NvDA exes, try up to 6 times for each, with a wait interval of 0.5 seconds. this is similar to what the code used to do. It is possible for the installed NVDA on the secure screen to take some time to exit, so we must give as much chance as possible.
@michaelDCurran michaelDCurran added this to the 2023.3.4 milestone Feb 21, 2024
@michaelDCurran michaelDCurran changed the title Installer: try multiple times to remove the NVDA exes, giving the installed NVDA extra time to fully exit on the UAC scree Installer: try multiple times to remove the NVDA exes, giving the installed NVDA extra time to fully exit on the UAC screen Feb 21, 2024
@michaelDCurran michaelDCurran marked this pull request as ready for review February 21, 2024 02:58
@michaelDCurran michaelDCurran requested a review from a team as a code owner February 21, 2024 02:58
@michaelDCurran michaelDCurran requested review from seanbudd and removed request for a team February 21, 2024 02:58

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved pending minor feedback

Comment thread source/installer.py Outdated
installDir: str,
relativeFilepaths: Iterable[str],
numTries: int = 6,
retryWeightInterval: float = 0.5

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
retryWeightInterval: float = 0.5
retryWaitInterval: float = 0.5

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please update the docstring to cover the new parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants