Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NVDA estimated size to add/remove programs #13909

Merged
merged 7 commits into from
Jul 18, 2022

Conversation

LeonarddeR
Copy link
Collaborator

@LeonarddeR LeonarddeR commented Jul 15, 2022

Link to issue number:

None

Summary of the issue:

In Windows Add/remove programs, there is a column that displays the estimated installation size of a product. This column is empty for NVDA.

Description of user facing changes

Calculate install size of the NVDA program files folder, and add it to the registry. This will be visible in Add/remove programs.

Description of development approach

I decided to calculate estimated size during installation. This takes the SystemConfig into account as that is part of the program files directory. This means that the estimated size is also based on the system config. I think this is OK, because when removing NVDA from Add/remove programs, the systemConfig dir is removed as well. Long story short, the estimated size is the best estimate we could get at time of installation

Testing strategy:

installed the build from appveyor. Verified that the estimated size is visible in add/remove programs and equal to the size of C:\Program Files (x86)\NVDA

Known issues with pull request:

None known

Change log entries:

Changes

  • The installation size of NVDA is now shown in Windows' Programs and Feature section.

Code Review Checklist:

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

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@LeonarddeR LeonarddeR marked this pull request as ready for review July 15, 2022 14:59
@LeonarddeR LeonarddeR requested a review from a team as a code owner July 15, 2022 14:59
@LeonarddeR LeonarddeR requested a review from seanbudd July 15, 2022 14:59
source/installer.py Outdated Show resolved Hide resolved
"""Calculates the size of a directory in bytes.
"""
total = 0
with os.scandir(path) as iterator:
Copy link
Member

Choose a reason for hiding this comment

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

Rather than using recursion on getDirectorySize, it might be better to use glob which returns files within folders recursively.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the suggestion. I just tried glob, but there are two disadvantages:

  1. Glob simply returns files and folders, so we need to call os.path.isfile on every node
  2. It is noticeably slower

source/installer.py Outdated Show resolved Hide resolved
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
@seanbudd seanbudd merged commit dc0173e into nvaccess:master Jul 18, 2022
@nvaccessAuto nvaccessAuto added this to the 2022.3 milestone Jul 18, 2022
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.

4 participants