From f5abae644265ebcca5bee4a36329094cda9dfd47 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Fri, 15 Apr 2022 11:43:22 +0100 Subject: [PATCH] [core] fix Boot selection dropdown not being reset on unsupported images * Closes #1903 --- src/rufus.c | 12 +++++++----- src/rufus.rc | 10 +++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index b0b4e6c3..a1fa5528 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1289,6 +1289,13 @@ DWORD WINAPI ImageScanThread(LPVOID param) (img_report.image_size == 0) || (!img_report.is_iso && (img_report.is_bootable_img <= 0) && !img_report.is_windows_img)) { // Failed to scan image + if (img_report.is_bootable_img < 0) + MessageBoxExU(hMainDialog, lmprintf(MSG_325, image_path), lmprintf(MSG_042), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); + else + MessageBoxExU(hMainDialog, lmprintf(MSG_082), lmprintf(MSG_081), MB_OK | MB_ICONINFORMATION | MB_IS_RTL, selected_langid); + // Make sure to relinquish image_path before we call UpdateImage + // otherwise the boot selection dropdown won't be properly reset. + safe_free(image_path); SendMessage(hMainDialog, UM_PROGRESS_EXIT, 0, 0); UpdateImage(FALSE); SetMBRProps(); @@ -1296,11 +1303,6 @@ DWORD WINAPI ImageScanThread(LPVOID param) PrintInfoDebug(0, MSG_203); PrintStatus(0, MSG_203); EnableControls(TRUE, FALSE); - if (img_report.is_bootable_img < 0) - MessageBoxExU(hMainDialog, lmprintf(MSG_325, image_path), lmprintf(MSG_042), MB_OK | MB_ICONERROR | MB_IS_RTL, selected_langid); - else - MessageBoxExU(hMainDialog, lmprintf(MSG_082), lmprintf(MSG_081), MB_OK | MB_ICONINFORMATION | MB_IS_RTL, selected_langid); - safe_free(image_path); goto out; } diff --git a/src/rufus.rc b/src/rufus.rc index 4abe328f..f2692015 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 232, 326 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 3.19.1884" +CAPTION "Rufus 3.19.1885" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -395,8 +395,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,19,1884,0 - PRODUCTVERSION 3,19,1884,0 + FILEVERSION 3,19,1885,0 + PRODUCTVERSION 3,19,1885,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -414,13 +414,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.19.1884" + VALUE "FileVersion", "3.19.1885" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.19.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.19.1884" + VALUE "ProductVersion", "3.19.1885" END END BLOCK "VarFileInfo"