Skip to content

Replace os.environ["PROCESSOR_ARCHITEW6432"] with winVersion.getWinVer().processorArchitecture in most cases#14564

Merged
seanbudd merged 6 commits into
nvaccess:masterfrom
josephsl:i14534processorArchitecture
Jan 18, 2023
Merged

Replace os.environ["PROCESSOR_ARCHITEW6432"] with winVersion.getWinVer().processorArchitecture in most cases#14564
seanbudd merged 6 commits into
nvaccess:masterfrom
josephsl:i14534processorArchitecture

Conversation

@josephsl

Copy link
Copy Markdown
Contributor

Link to issue number:

Closes #14534

Summary of the issue:

Replace os.environ["PROCESSOR_ARCHITEW6432"] with winVersion.getWinVer().processorArchitecture in most cases (see below for exceptions).

Description of user facing changes

None

Description of development approach

Replace os.environ["PROCESSOR_ARCHITEW6432"] with winVersion.getWinVer().processArchitecture in the following cases:

  • appModuleHandler.AppModule: is64bitProcess, appArchitecture
  • NVDA helper: when starting appropriate helper suite for the right 64-bit architecture
  • COM registration fixing tool: determining 32-bit or 64-bit Windows version

The only exception is update check, specifically since Windows 7 service pack 1 string must be recorded correctly; when NVDA moves to supporting Windows 8.1/10 or later, this can be dropped (no more service packs), allowing update check facility to switch to using winVersion.WinVersion class attributes, including processor architecture.

Testing strategy:

In addition to existing unit test on processor architecture attribute, manu testing would involve testing COM registration fixing tool and comparing app module attributes to make sure they remain the same before and after the PR is merged.

Known issues with pull request:

None

Change log entries:

No changelog as #14439 changelog would suffice

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
  • Security precautions taken.

About add-on API

NO changes to the API as os.environ can be used by add-ons. winVErsion.WinVersion.processorArchitecture provides a one-stop shop for obtaining processor architecture in a more convenient way.

…vaccess#14534.

Replace usage of os.environ['PROCESSOR_ARCHITEW6432'] with winVersion.getWinver().processorArchitecture (this string comes from os.environ anyway). This affects is64bitProcess and appArchitecture methods in app module clas.
…vaccess#14534.

Replace os.environ with processorArchitecture when determining 32-bit versus 64-bit Windows.
Store processorArchitecture string in the 'arch' variable when starting NVDA helper processes on various 64-bit architectures (AMD64, ARM64).
@josephsl josephsl requested a review from a team as a code owner January 18, 2023 00:50
@josephsl josephsl requested a review from seanbudd January 18, 2023 00:50
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit a5c14c221c

@seanbudd seanbudd changed the title Replace os.environ["PROCESSOR_ARCHITEW6432"] with winVErsion.getWinVer().processorArchitecture in most cases Replace os.environ["PROCESSOR_ARCHITEW6432"] with winVersion.getWinVer().processorArchitecture in most cases Jan 18, 2023
@seanbudd seanbudd merged commit 4fd77c9 into nvaccess:master Jan 18, 2023
@nvaccessAuto nvaccessAuto added this to the 2023.1 milestone Jan 18, 2023
@josephsl josephsl deleted the i14534processorArchitecture branch January 19, 2023 22:40
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.

Use winVersion.getWinVer().processorArchitecture whenever possible

4 participants