From e4e9e8776874987c986cae193cd1ca51fa49c20c Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 9 Feb 2015 19:34:41 +0000 Subject: [PATCH] [misc] handle multipart install.swm Windows images * Closes #437 --- src/format.c | 7 ++++++- src/iso.c | 16 ++++++++++------ src/rufus.h | 2 +- src/rufus.rc | 16 ++++++++-------- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/format.c b/src/format.c index fb2fcfaa..05ae8501 100644 --- a/src/format.c +++ b/src/format.c @@ -1855,9 +1855,14 @@ DWORD WINAPI FormatThread(void* param) } } // EFI mode selected, with no 'bootx64.efi' (bit #2) but Windows 7 x64's 'bootmgr.efi' (bit #0) - if ((bt == BT_UEFI) && (!(iso_report.has_efi & 4)) && (iso_report.has_efi & 1)) { + if ((bt == BT_UEFI) && (!(iso_report.has_efi & 4)) && (iso_report.has_efi & 1) && (iso_report.has_install_wim)) { PrintInfoDebug(0, MSG_232); wim_image[0] = drive_name[0]; + // Handle multipart .swm images + if (iso_report.has_install_wim == 2) { + wim_image[19] = 's'; + wim_image[20] = 'w'; + } efi_dst[0] = drive_name[0]; efi_dst[sizeof(efi_dst) - sizeof("\\bootx64.efi")] = 0; if (!CreateDirectoryA(efi_dst, 0)) { diff --git a/src/iso.c b/src/iso.c index ec58d930..4fcfb57a 100644 --- a/src/iso.c +++ b/src/iso.c @@ -69,8 +69,9 @@ static const char* ldlinux_name = "ldlinux.sys"; static const char* ldlinux_c32 = "ldlinux.c32"; static const char* efi_dirname = "/efi/boot"; static const char* efi_bootname[] = { "bootia32.efi", "bootx64.efi", "bootia64.efi", "bootarm.efi" }; -static const char* install_wim_path = "/sources/install.wim"; -static const char* grub_dirname = "/boot/grub"; // NB: We don't support nonstandard config dir such as AROS' "/boot/pc/grub/" +static const char* install_wim_path = "/sources"; +static const char* install_wim_name[] = { "install.wim", "install.swm" }; +static const char* grub_dirname = "/boot/grub"; // NB: We don't support nonstandard config dir such as AROS' "/boot/pc/grub/" static const char* grub_cfg = "grub.cfg"; static const char* syslinux_cfg[] = { "isolinux.cfg", "syslinux.cfg", "extlinux.conf"}; static const char dot_isolinux_bin[] = ".\\isolinux.bin"; @@ -189,12 +190,15 @@ static BOOL check_iso_props(const char* psz_dirname, int64_t i_file_length, cons if (safe_stricmp(psz_dirname, efi_dirname) == 0) { for (i=0; i