Skip to content

Commit

Permalink
[misc] handle multipart install.swm Windows images
Browse files Browse the repository at this point in the history
* Closes #437
  • Loading branch information
pbatard committed Feb 9, 2015
1 parent 9fef406 commit e4e9e87
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
7 changes: 6 additions & 1 deletion src/format.c
Expand Up @@ -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)) {
Expand Down
16 changes: 10 additions & 6 deletions src/iso.c
Expand Up @@ -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";
Expand Down Expand Up @@ -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<ARRAYSIZE(efi_bootname); i++)
if (safe_stricmp(psz_basename, efi_bootname[i]) == 0)
iso_report.has_efi |= (2<<i);
iso_report.has_efi |= (2<<i); // start at 2 since "bootmgr.efi" is bit 0
}

// Check for 'install.wim"
if (safe_stricmp(psz_fullpath, install_wim_path) == 0)
iso_report.has_install_wim = TRUE;
// Check for "install.wim" or "install.swm" in "/sources"
if (safe_stricmp(psz_dirname, install_wim_path) == 0) {
for (i=0; i<ARRAYSIZE(install_wim_name); i++)
if (safe_stricmp(psz_basename, install_wim_name[i]) == 0)
iso_report.has_install_wim |= (1<<i);
}

// Check for PE (XP) specific files in "/i386" or "/minint"
for (i=0; i<ARRAYSIZE(pe_dirname); i++)
Expand Down
2 changes: 1 addition & 1 deletion src/rufus.h
Expand Up @@ -249,11 +249,11 @@ typedef struct {
uint64_t src_size;
uint8_t winpe;
uint8_t has_efi;
uint8_t has_install_wim;
BOOL has_4GB_file;
BOOL has_long_filename;
BOOL has_symlinks;
BOOL has_bootmgr;
BOOL has_install_wim;
BOOL has_autorun;
BOOL has_old_c32[NB_OLD_C32];
BOOL has_old_vesamenu;
Expand Down
16 changes: 8 additions & 8 deletions src/rufus.rc
Expand Up @@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL

IDD_DIALOG DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Rufus 2.0.610"
CAPTION "Rufus 2.0.611"
FONT 8, "Segoe UI", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,127,339,50,14
Expand Down Expand Up @@ -157,7 +157,7 @@ END

IDD_DIALOG_XP DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Rufus 2.0.610"
CAPTION "Rufus 2.0.611"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,127,339,50,14
Expand Down Expand Up @@ -283,7 +283,7 @@ END
IDD_DIALOG_RTL DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
CAPTION "Rufus 2.0.610"
CAPTION "Rufus 2.0.611"
FONT 8, "Segoe UI", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,127,339,50,14
Expand Down Expand Up @@ -415,7 +415,7 @@ END
IDD_DIALOG_RTL_XP DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
CAPTION "Rufus 2.0.610"
CAPTION "Rufus 2.0.611"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,127,339,50,14
Expand Down Expand Up @@ -671,8 +671,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,610,0
PRODUCTVERSION 2,0,610,0
FILEVERSION 2,0,611,0
PRODUCTVERSION 2,0,611,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -689,13 +689,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "2.0.610"
VALUE "FileVersion", "2.0.611"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "� 2011-2015 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "2.0.610"
VALUE "ProductVersion", "2.0.611"
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit e4e9e87

Please sign in to comment.