diff --git a/ChangeLog.txt b/ChangeLog.txt index 2a8eaff0..2e1d3776 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,11 @@ +o Version 3.1 (2018.06.??) + Fix ISO content not being extracted with GRUB based ISOs (Manjaro, Kaspersky, etc.) + Fix text being truncated on some dialogs (mostly for Russian and Thai) + Add detection & warning about the 'Controlled Folder Access' Windows 10 feature + Improve retry attempts for transient errors + Update GRUB 2.0 and Grub4DOS to latest + Update libcdio to latest + o Version 3.0 (2018.05.29) UI redesign to follow the flow of user operations (with thanks to Fahad Al-Riyami for the concept) Drop XP and Vista platform support diff --git a/src/dev.c b/src/dev.c index eec1db76..94eef03e 100644 --- a/src/dev.c +++ b/src/dev.c @@ -141,8 +141,10 @@ BOOL ResetDevice(int index) return FALSE; } - if (DriveHub.String[index] == NULL) + if (DriveHub.String[index] == NULL) { + uprintf("The device you are trying to reset does not appear to be a USB device..."); return FALSE; + } LastReset = GetTickCount64(); @@ -162,6 +164,7 @@ BOOL ResetDevice(int index) uprintf(" Failed to cycle port: %s", WindowsErrorString()); goto out; } + uprintf("Please wait for the device to re-appear..."); r = TRUE; out: diff --git a/src/format.c b/src/format.c index ed3efa8b..7e637528 100644 --- a/src/format.c +++ b/src/format.c @@ -815,7 +815,7 @@ out: static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSize, BOOL add1MB) { BOOL r = FALSE; - uint64_t i, last_sector = DiskSize/SectorSize, num_sectors_to_clear; + uint64_t i, j, last_sector = DiskSize/SectorSize, num_sectors_to_clear; unsigned char* pBuf = (unsigned char*) calloc(SectorSize, 1); PrintInfoDebug(0, MSG_224); @@ -839,13 +839,29 @@ static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSi uprintf("Erasing %d sectors", num_sectors_to_clear); for (i=0; i= WRITE_RETRIES) goto out; + if (i > WRITE_RETRIES) + goto out; } } RefreshDriveLayout(hPhysicalDrive); @@ -2105,7 +2123,7 @@ DWORD WINAPI SaveImageThread(void* param) NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL); break; default: - uprintf("invalid image type"); + uprintf("Invalid image type"); } if (hPhysicalDrive == INVALID_HANDLE_VALUE) { FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_OPEN_FAILED; @@ -2149,7 +2167,7 @@ DWORD WINAPI SaveImageThread(void* param) (DWORD)MIN(img_save->BufSize, img_save->DeviceSize - wb), &rSize, NULL); if (!s) { FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_READ_FAULT; - uprintf("read error: %s", WindowsErrorString()); + uprintf("Read error: %s", WindowsErrorString()); goto out; } if (rSize == 0) @@ -2160,20 +2178,21 @@ DWORD WINAPI SaveImageThread(void* param) PrintInfo(0, MSG_261, format_percent); UpdateProgress(OP_FORMAT, format_percent); } - for (i=0; i= WRITE_RETRIES) goto out; + if (i > WRITE_RETRIES) + goto out; } if (wb != img_save->DeviceSize) { uprintf("Error: wrote %s, expected %s", SizeToHumanReadable(wb, FALSE, FALSE), diff --git a/src/rufus.h b/src/rufus.h index 60af4ccc..20b141b0 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -62,7 +62,8 @@ #define MAX_SECTORS_TO_CLEAR 128 // nb sectors to zap when clearing the MBR/GPT (must be >34) #define MBR_UEFI_MARKER 0x49464555 // 'U', 'E', 'F', 'I', as a 32 bit little endian longword #define STATUS_MSG_TIMEOUT 3500 // How long should cheat mode messages appear for on the status bar -#define WRITE_RETRIES 3 +#define WRITE_RETRIES 4 +#define WRITE_TIMEOUT 5000 // How long we should wait between write retries #define MARQUEE_TIMER_REFRESH 10 // Time between progress bar marquee refreshes, in ms #define FS_DEFAULT FS_FAT32 #define SINGLE_CLUSTERSIZE_DEFAULT 0x00000100 diff --git a/src/rufus.rc b/src/rufus.rc index 1adcc5e7..1db8a787 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.1.1316" +CAPTION "Rufus 3.1.1317" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -389,8 +389,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,1,1316,0 - PRODUCTVERSION 3,1,1316,0 + FILEVERSION 3,1,1317,0 + PRODUCTVERSION 3,1,1317,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -407,13 +407,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.1.1316" + VALUE "FileVersion", "3.1.1317" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.1.1316" + VALUE "ProductVersion", "3.1.1317" END END BLOCK "VarFileInfo" diff --git a/src/stdio.c b/src/stdio.c index 6298d239..1fc4116d 100644 --- a/src/stdio.c +++ b/src/stdio.c @@ -339,19 +339,18 @@ BOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWr DWORD nTry; BOOL readFilePointer; LARGE_INTEGER liFilePointer, liZero = { { 0,0 } }; - static char* retry_msg = " - retrying..."; // Need to get the current file pointer in case we need to retry readFilePointer = SetFilePointerEx(hFile, liZero, &liFilePointer, FILE_CURRENT); if (!readFilePointer) - uprintf(" Warning - Could not read file pointer: %s", WindowsErrorString()); + uprintf("Warning: Could not read file pointer: %s", WindowsErrorString()); if (nNumRetries == 0) nNumRetries = 1; for (nTry = 1; nTry <= nNumRetries; nTry++) { // Need to rewind our file position on retry - if we can't even do that, just give up if ((nTry > 1) && (!SetFilePointerEx(hFile, liFilePointer, NULL, FILE_BEGIN))) { - uprintf(" Could not set file pointer - aborting"); + uprintf("Could not set file pointer - Aborting"); break; } if (WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, NULL)) { @@ -362,15 +361,17 @@ BOOL WriteFileWithRetry(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWr uprintf("Warning: Possible short write"); return TRUE; } - uprintf(" Wrote %d bytes but requested %d%s", *lpNumberOfBytesWritten, - nNumberOfBytesToWrite, nTry < nNumRetries ? retry_msg : ""); + uprintf("Wrote %d bytes but requested %d", *lpNumberOfBytesWritten, nNumberOfBytesToWrite); } else { - uprintf(" Write error [0x%08X]%s", GetLastError(), nTry < nNumRetries ? retry_msg : ""); + uprintf("Write error [0x%08X]", GetLastError()); } // If we can't reposition for the next run, just abort if (!readFilePointer) break; - Sleep(200); + if (nTry < nNumRetries) { + uprintf("Retrying in %d seconds...", WRITE_TIMEOUT / 1000); + Sleep(WRITE_TIMEOUT); + } } if (SCODE_CODE(GetLastError()) == ERROR_SUCCESS) SetLastError(ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_WRITE_FAULT);