Skip to content

Add NVDA estimated size to add/remove programs#13909

Merged
seanbudd merged 7 commits into
nvaccess:masterfrom
LeonarddeR:estimatedSize
Jul 18, 2022
Merged

Add NVDA estimated size to add/remove programs#13909
seanbudd merged 7 commits into
nvaccess:masterfrom
LeonarddeR:estimatedSize

Conversation

@LeonarddeR

@LeonarddeR LeonarddeR commented Jul 15, 2022

Copy link
Copy Markdown
Collaborator

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
Copy Markdown

@AppVeyorBot

Copy link
Copy Markdown

@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
Comment thread source/installer.py Outdated
Comment thread source/installer.py
"""Calculates the size of a directory in bytes.
"""
total = 0
with os.scandir(path) as iterator:

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.

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

Copy link
Copy Markdown
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

Comment thread source/installer.py Outdated
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
@LeonarddeR LeonarddeR deleted the estimatedSize branch August 23, 2025 06:27
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