[misc] improve Windows version detection

* Also use actual Windows major.minor when checking for updates
This commit is contained in:
Pete Batard 2023-04-17 13:33:05 +01:00
parent 6280e8020a
commit e5f90282ed
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
10 changed files with 83 additions and 77 deletions

View file

@ -1,7 +1,7 @@
/*
* Rufus: The Reliable USB Formatting Utility
* UI-related function calls
* Copyright © 2018-2022 Pete Batard <pete@akeo.ie>
* Copyright © 2018-2023 Pete Batard <pete@akeo.ie>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -123,7 +123,7 @@ void GetBasicControlsWidth(HWND hDlg)
sz.cy = rc.bottom;
// TODO: figure out the specifics of each Windows version
if (nWindowsVersion == WINDOWS_10) {
if (WindowsVersion.Version == WINDOWS_10) {
checkbox_internal_spacing = 10;
dropdown_internal_spacing = 13;
}
@ -779,7 +779,7 @@ void ToggleImageOptions(void)
int i, shift = rh;
has_wintogo = ((boot_type == BT_IMAGE) && (image_path != NULL) && (img_report.is_iso || img_report.is_windows_img) &&
(nWindowsVersion >= WINDOWS_8) && (HAS_WINTOGO(img_report)));
(WindowsVersion.Version >= WINDOWS_8) && (HAS_WINTOGO(img_report)));
has_persistence = ((boot_type == BT_IMAGE) && (image_path != NULL) && (img_report.is_iso) && (HAS_PERSISTENCE(img_report)));
assert(popcnt8(image_options) <= 1);