From b274388f959b46d301a4fe96dbc8a25b35723c53 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 4 Jun 2018 12:10:23 +0100 Subject: [PATCH] [iso] fix file extraction for GRUB/Grub4DOS based ISOs * We were switching the global boot type variable to something other than BT_IMAGE, which prevented ISO extraction whenever a GRUB secondary boot record was written. * Closes #1145 --- src/format.c | 8 ++++---- src/rufus.rc | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/format.c b/src/format.c index c7a180ef..ed3efa8b 100644 --- a/src/format.c +++ b/src/format.c @@ -996,7 +996,7 @@ static BOOL WriteSBR(HANDLE hPhysicalDrive) { // TODO: Do we need anything special for 4K sectors? DWORD size, max_size, mbr_size = 0x200; - int r; + int r, sub_type = bt; unsigned char* buf = NULL; FAKE_FD fake_fd = { 0 }; FILE* fp = (FILE*)&fake_fd; @@ -1010,12 +1010,12 @@ static BOOL WriteSBR(HANDLE hPhysicalDrive) // Syslinux has precedence over Grub if ((bt == BT_IMAGE) && (!HAS_SYSLINUX(img_report))) { if (img_report.has_grub4dos) - bt = BT_GRUB4DOS; + sub_type = BT_GRUB4DOS; if (img_report.has_grub2) - bt = BT_GRUB2; + sub_type = BT_GRUB2; } - switch (bt) { + switch (sub_type) { case BT_GRUB4DOS: uprintf("Writing Grub4Dos SBR"); buf = GetResource(hMainInstance, MAKEINTRESOURCEA(IDR_GR_GRUB_GRLDR_MBR), _RT_RCDATA, "grldr.mbr", &size, FALSE); diff --git a/src/rufus.rc b/src/rufus.rc index 3ca5aa74..9d4afb54 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.0.1305" +CAPTION "Rufus 3.0.1306" 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,0,1305,0 - PRODUCTVERSION 3,0,1305,0 + FILEVERSION 3,0,1306,0 + PRODUCTVERSION 3,0,1306,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.0.1305" + VALUE "FileVersion", "3.0.1306" 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.0.1305" + VALUE "ProductVersion", "3.0.1306" END END BLOCK "VarFileInfo"