From a4c37ac34a565f0b304e976b356446c7cde56986 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Tue, 8 Sep 2026 12:42:38 +0100 Subject: [PATCH 1/3] [wue] fix silent option being potentially applied when its dependencies aren't met * Also add a warning sign to the log report when the option is used. * Closes #3008. --- src/rufus.rc | 10 +++++----- src/stdlg.c | 7 ++++--- src/wue.c | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/rufus.rc b/src/rufus.rc index 67f2e187..aef488aa 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 4.15.2400" +CAPTION "Rufus 4.15.2401" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -409,8 +409,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,15,2400,0 - PRODUCTVERSION 4,15,2400,0 + FILEVERSION 4,15,2401,0 + PRODUCTVERSION 4,15,2401,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -428,13 +428,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.15.2400" + VALUE "FileVersion", "4.15.2401" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2026 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.15.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.15.2400" + VALUE "ProductVersion", "4.15.2401" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 74dc7efe..cb29d32e 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -1080,8 +1080,8 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam } else switch (LOWORD(wParam)) { case IDOK: // Produce a big scary warning if the silent install option was selected - if (selection_data[s].options->edition_index > 0 && - Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->edition_index - 1))) { + hCtrl = GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + selection_data[s].options->edition_index - 1); + if (selection_data[s].options->edition_index > 0 && IsWindowVisible(hCtrl) && Button_GetCheck(hCtrl)) { selection_dialog_options_t selection = { 0 }; selection.style = BS_AUTOCHECKBOX; selection.flags = SELECTION_NEEDS_ALL_TO_PROCEED | SELECTION_USE_WARNING_ICON; @@ -1095,7 +1095,8 @@ static INT_PTR CALLBACK SelectionCallback(HWND hDlg, UINT message, WPARAM wParam break; } for (r = 0, i = 0, m = 1; i < nDialogItems; i++, m <<= 1) - if (Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i)) == BST_CHECKED) + if (Button_GetCheck(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i)) == BST_CHECKED && + IsWindowVisible(GetDlgItem(hDlg, IDC_SELECTION_CHOICE1 + i))) r += m; if (selection_data[s].options->username_index > 0) { GetWindowTextU(GetDlgItem(hDlg, IDC_SELECTION_USERNAME), unattend_username, MAX_USERNAME_LENGTH); diff --git a/src/wue.c b/src/wue.c index 90367f51..2bc04b05 100644 --- a/src/wue.c +++ b/src/wue.c @@ -150,7 +150,7 @@ char* CreateUnattendXml(int arch, int flags) fprintf(fd, " \n"); fprintf(fd, " \n"); if (flags & UNATTEND_SILENT_INSTALL) { - uprintf("• Silent Install"); + uprintf("• âš Silent Installâš "); // Automatically partition the disk and set the installation target fprintf(fd, " \n"); fprintf(fd, " OnError\n"); From 482cdb53e71e173e2a603984f99d345697192721 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Tue, 8 Sep 2026 12:59:29 +0100 Subject: [PATCH 2/3] [dev] add more exceptions to the UFD vs HDD list * Closes #3035. * Closes #3036. --- src/dev.c | 6 +++--- src/hdd_vs_ufd.h | 4 +++- src/rufus.rc | 10 +++++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/dev.c b/src/dev.c index 49a64570..b1f1cdf7 100644 --- a/src/dev.c +++ b/src/dev.c @@ -420,9 +420,9 @@ BOOL GetOpticalMedia(IMG_SAVE* img_save) /* For debugging user reports of HDDs vs UFDs */ //#define FORCED_DEVICE #ifdef FORCED_DEVICE -#define FORCED_VID 0x0781 -#define FORCED_PID 0x55A9 -#define FORCED_NAME " USB SanDisk 3.2Gen1 UAS Device" +#define FORCED_VID 0x1058 +#define FORCED_PID 0x0702 +#define FORCED_NAME "WD 1200BEVExternal USB Device" #endif void ClearDrives(void) diff --git a/src/hdd_vs_ufd.h b/src/hdd_vs_ufd.h index 33941f76..2f632bc2 100644 --- a/src/hdd_vs_ufd.h +++ b/src/hdd_vs_ufd.h @@ -88,6 +88,7 @@ static str_score_t str_score[] = { }; static str_score_t str_adjust[] = { + { "SSK Port able", -20 }, { "Gadget", -10 }, { "Flash", -10 }, { "SD-CARD", -10 }, @@ -95,7 +96,7 @@ static str_score_t str_adjust[] = { { "HDD", +20 }, { "SATA", +20 }, { "SCSI", +20 }, - { "SSD", +20 } + { "SSD", +20 }, }; /* The lists belows set a score according to VID & VID:PID @@ -209,6 +210,7 @@ static vidpid_score_t vidpid_score[] = { { 0x0c0b, 0xb159, 10 }, // Dura Micro 509 // Meh { 0x0e21, 0x0510, 5 }, // Cowon iAudio X5 + { 0x1058, 0x0702, 5 }, // WD 1200BEVExternal HDD { 0x11b0, 0x6298, 10 }, // Enclosure from Kingston SSDNow notebook upgrade kit // NOT in VID list as plenty of UFDs { 0x125f, 0xa93a, 10 }, // A-DATA SH93 diff --git a/src/rufus.rc b/src/rufus.rc index aef488aa..0e74d25a 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 4.15.2401" +CAPTION "Rufus 4.15.2402" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -409,8 +409,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,15,2401,0 - PRODUCTVERSION 4,15,2401,0 + FILEVERSION 4,15,2402,0 + PRODUCTVERSION 4,15,2402,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -428,13 +428,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.15.2401" + VALUE "FileVersion", "4.15.2402" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2026 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.15.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.15.2401" + VALUE "ProductVersion", "4.15.2402" END END BLOCK "VarFileInfo" From b4a62a4e01a4e1a5b0ed536d01a0b5e3263da1ba Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Tue, 8 Sep 2026 16:50:01 +0100 Subject: [PATCH 3/3] [net] Don't remove an existing file in case of a download failure --- src/net.c | 13 ++++++++++++- src/rufus.rc | 10 +++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/net.c b/src/net.c index 32cebdf7..f0c61d9c 100644 --- a/src/net.c +++ b/src/net.c @@ -173,7 +173,7 @@ uint64_t DownloadToFileOrBufferEx(const char* url, const char* file, const char* const char* accept_types[] = {"*/*\0", NULL}; const char* short_name; unsigned char buf[DOWNLOAD_BUFFER_SIZE]; - char hostname[64], urlpath[128], strsize[32]; + char hostname[64], urlpath[128], strsize[32], *bak_file = NULL; BOOL r = FALSE; DWORD dwSize, dwWritten, dwDownloaded; HANDLE hFile = INVALID_HANDLE_VALUE; @@ -198,6 +198,13 @@ uint64_t DownloadToFileOrBufferEx(const char* url, const char* file, const char* uprintf("Downloading %s", url); } + // If an old file with the same name exists, rename it so we can restore it in case of failure + if (file != NULL && PathFileExistsU((char*)file) && (bak_file = calloc(1, strlen(file) + 6)) != NULL) { + strcpy(bak_file, file); + strcat(bak_file, ".bak"); + MoveFileU(file, bak_file); + } + if ( (!InternetCrackUrlA(url, (DWORD)safe_strlen(url), 0, &UrlParts)) || (UrlParts.lpszHostName == NULL) || (UrlParts.lpszUrlPath == NULL)) { uprintf("Unable to decode URL: %s", WindowsErrorString()); @@ -327,8 +334,12 @@ out: if (!r) { if (file != NULL) DeleteFileU(file); + if (bak_file != NULL) + MoveFileU(bak_file, file); if (buffer != NULL) safe_free(*buffer); + } else if (bak_file != NULL) { + DeleteFileU(bak_file); } if (hRequest) InternetCloseHandle(hRequest); diff --git a/src/rufus.rc b/src/rufus.rc index 0e74d25a..e510b158 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 4.15.2402" +CAPTION "Rufus 4.15.2403" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -409,8 +409,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,15,2402,0 - PRODUCTVERSION 4,15,2402,0 + FILEVERSION 4,15,2403,0 + PRODUCTVERSION 4,15,2403,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -428,13 +428,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.15.2402" + VALUE "FileVersion", "4.15.2403" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2026 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.15.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.15.2402" + VALUE "ProductVersion", "4.15.2403" END END BLOCK "VarFileInfo"