Fix version comparisons when installing/updating/downgrading#19631
Fix version comparisons when installing/updating/downgrading#19631
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request refactors NVDA's installer logic to fix version comparison issues and correct the default behavior of the "Use NVDA during sign-in" checkbox. The changes aim to resolve issue #19600 where the checkbox was being enabled without user action. The core improvement replaces file modification timestamp comparisons with actual file version comparisons using Windows version info APIs.
Changes:
- Introduced a
ComparisonStateenum to represent installation states (FRESH_INSTALL, OLDER, SAME, NEWER, UNKNOWN) instead of integer/None values - Updated version comparison logic to use file version information instead of file modification timestamps
- Fixed "Use NVDA during sign-in" checkbox to default to False for fresh installs and check registry settings for existing installations
- Added type annotations and improved documentation for
getFileVersionInfofunction
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| source/installer.py | Introduces ComparisonState enum and refactors comparePreviousInstall() to use file version comparison instead of timestamps |
| source/gui/installerGui.py | Updates installer GUI logic to use ComparisonState enum and fixes default checkbox behavior for "Use NVDA during sign-in" |
| source/fileUtils.py | Adds type annotations and documentation to getFileVersionInfo function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
The approach here looks good to me. I think we can probably get this in to 26.1 if it's ready soon. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * Improved user notifications when connecting as the controlled computer fails. (#19103, @hdzrvcc0X74) | ||
| * NVDA will no longer open multiple disconnection confirmation dialogs if the action is triggered repeatedly. (#19442, @Cary-rowen) | ||
| * NVDA installer: | ||
| * NVDA should now correctly identify downgrades and show the downgrade warning dialog appropriately. (#19631) |
There was a problem hiding this comment.
| * NVDA should now correctly identify downgrades and show the downgrade warning dialog appropriately. (#19631) | |
| * NVDA should now correctly identify downgrades and show the downgrade warning dialog appropriately, including for portable copies. (#19631, #18291) |
Link to issue number:
May fix #19600
Fixes #18291
Summary of the issue:
NVDA would do the same for creating the desktop shortcut.
Description of user facing changes:
Description of developer facing changes:
installer._comparePreviousInstallnow returns aComparisonStateenumgui.installerGui.doInstallparameterstartOnLogondefault value is now False not TrueDescription of development approach:
This pull request refactors the installer logic to improve version comparison and installation flow, primarily by introducing a new
ComparisonStateenum for clearer handling of installation states.ComparisonStateenum ininstaller.pyto represent installation comparison results more clearly (e.g.,FRESH_INSTALL,UPGRADE,REINSTALL,DOWNGRADE,UNKNOWN), replacing the previous integer/None return values. ThecomparePreviousInstallfunction now returns this enum and uses file version information for comparison instead of file modification times.installerGui.pyto use the newComparisonStateenum throughout the installation logic, ensuring correct handling of fresh installs, upgrades, and downgrades, and improving the logic for desktop shortcut creation and "start on logon" options. [1] [2] [3] [4]Testing strategy:
Known issues with pull request:
The backwards compatibility here might not be correct. Callers may need to call
.valueon the return ofcomparePreviousInstallto have the same behaviour. We may either need to make an API breaking change, a deprecation layer, or create a new function entirely and keep the old broken one.Code Review Checklist: