nvda
bb1d7d83 - Fix version comparisons when installing/updating/downgrading (#19631)

Commit
177 days ago
Fix version comparisons when installing/updating/downgrading (#19631) May fix #19600 Fixes #18291 Summary of the issue: NVDA would identify a downgrade if the old installed copy files were created before/after the new installer. This should instead compare the versions of the NVDA files. By checking timestamps, an alpha build of 2026.2 created before 2026.1 was released would be identified as a downgrade incorrectly. NVDA would check "Use NVDA during sign-in" by default when performing a fresh install. This might be considered a security issue, and should be explicitly opt-in. NVDA would always check "Use NVDA during sign-in" by default when not performing a fresh install, but downgrade/upgrade status could not be determined. i.e. we know that a previous copy exists, but we don't know the time difference of the files, so we don't check the registry. instead we should check the registry if we know a previous copy exists. NVDA would do the same for creating the desktop shortcut. NVDA would not warn about downgrading a portable copy Description of user facing changes: NVDA will no longer check the "Use NVDA during sign-in" by default when performing a fresh install NVDA will now check the registry to see if "Use NVDA during sign-in" is set even if we are unsure if the previous install makes this an upgrade or downgrade. NVDA will now check to see if we should re-create the desktop shortcut, even if we are unsure if the previous install makes this an upgrade or downgrade. NVDA should now correctly identify downgrades and show the Downgrade warning dialog appropriately including for portable copies Description of developer facing changes: installer._comparePreviousInstall now returns a ComparisonState enum gui.installerGui.doInstall parameter startOnLogon default value is now False not True Description of development approach: This pull request refactors the installer logic to improve version comparison and installation flow, primarily by introducing a new ComparisonState enum for clearer handling of installation states. Introduced a ComparisonState enum in installer.py to represent installation comparison results more clearly (e.g., FRESH_INSTALL, UPGRADE, REINSTALL, DOWNGRADE, UNKNOWN), replacing the previous integer/None return values. The comparePreviousInstall function now returns this enum and uses file version information for comparison instead of file modification times. Updated installerGui.py to use the new ComparisonState enum 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.
Author
Parents
Loading