1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[syslinux] add detection for Syslinux/Isolinux v5.0

* This is not full Syslinux v5.0 support, but only to prevent the (vesa)menu.c32 message from displaying
* Uses the mandatory inclusion of ldlinux.c32 in Isolinux v5.x for the detection
* Part of a fix for #142
This commit is contained in:
Pete Batard 2013-06-13 23:46:52 +01:00
parent 0b64ef1210
commit 0e1c474ca0
4 changed files with 23 additions and 15 deletions

View file

@ -57,6 +57,7 @@ int64_t iso_blocking_status = -1;
static const char* psz_extract_dir; static const char* psz_extract_dir;
static const char* bootmgr_efi_name = "bootmgr.efi"; static const char* bootmgr_efi_name = "bootmgr.efi";
static const char* ldlinux_name = "ldlinux.sys"; static const char* ldlinux_name = "ldlinux.sys";
static const char* syslinux_v5_file = "ldlinux.c32";
static const char* efi_dirname = "/efi/boot"; static const char* efi_dirname = "/efi/boot";
static const char* isolinux_name[] = { "isolinux.cfg", "syslinux.cfg", "extlinux.conf"}; static const char* isolinux_name[] = { "isolinux.cfg", "syslinux.cfg", "extlinux.conf"};
static const char* pe_dirname[] = { "/i386", "/minint" }; static const char* pe_dirname[] = { "/i386", "/minint" };
@ -115,6 +116,11 @@ static __inline BOOL check_iso_props(const char* psz_dirname, BOOL* is_syslinux_
*is_syslinux_cfg = TRUE; *is_syslinux_cfg = TRUE;
} }
// Check for a syslinux v5.0 file anywhere
if (safe_stricmp(psz_basename, syslinux_v5_file) == 0) {
iso_report.has_syslinux_v5 = TRUE;
}
// Check for an old incompatible c32 file anywhere // Check for an old incompatible c32 file anywhere
for (i=0; i<NB_OLD_C32; i++) { for (i=0; i<NB_OLD_C32; i++) {
is_old_c32[i] = FALSE; is_old_c32[i] = FALSE;

View file

@ -1021,11 +1021,12 @@ DWORD WINAPI ISOScanThread(LPVOID param)
safe_free(iso_path); safe_free(iso_path);
goto out; goto out;
} }
uprintf("ISO label: '%s'\r\n Size: %lld bytes\r\n Has a >4GB file: %s\r\n Uses EFI: %s%s\r\n Uses Bootmgr: %s\r\n Uses WinPE: %s%s\r\n Uses isolinux: %s\n", uprintf("ISO label: '%s'\r\n Size: %lld bytes\r\n Has a >4GB file: %s\r\n Uses EFI: %s%s\r\n Uses Bootmgr: %s\r\n Uses WinPE: %s%s\r\n Uses isolinux: %s (v%s)\n",
iso_report.label, iso_report.projected_size, iso_report.has_4GB_file?"Yes":"No", (iso_report.has_efi || iso_report.has_win7_efi)?"Yes":"No", iso_report.label, iso_report.projected_size, iso_report.has_4GB_file?"Yes":"No", (iso_report.has_efi || iso_report.has_win7_efi)?"Yes":"No",
(iso_report.has_win7_efi && (!iso_report.has_efi))?" (win7_x64)":"", iso_report.has_bootmgr?"Yes":"No", (iso_report.has_win7_efi && (!iso_report.has_efi))?" (win7_x64)":"", iso_report.has_bootmgr?"Yes":"No",
IS_WINPE(iso_report.winpe)?"Yes":"No", (iso_report.uses_minint)?" (with /minint)":"", iso_report.has_isolinux?"Yes":"No"); IS_WINPE(iso_report.winpe)?"Yes":"No", (iso_report.uses_minint)?" (with /minint)":"", iso_report.has_isolinux?"Yes":"No",
if (iso_report.has_isolinux) { iso_report.has_syslinux_v5?"5.0 or later":"4.x or earlier");
if (iso_report.has_isolinux && !iso_report.has_syslinux_v5) {
for (i=0; i<NB_OLD_C32; i++) { for (i=0; i<NB_OLD_C32; i++) {
uprintf(" With an old %s: %s\n", old_c32_name[i], iso_report.has_old_c32[i]?"Yes":"No"); uprintf(" With an old %s: %s\n", old_c32_name[i], iso_report.has_old_c32[i]?"Yes":"No");
} }
@ -1041,8 +1042,8 @@ DWORD WINAPI ISOScanThread(LPVOID param)
MessageBoxU(hMainDialog, "This ISO image contains a file larger than 4 GB and cannot be used to boot in EFI mode from USB.\r\n" MessageBoxU(hMainDialog, "This ISO image contains a file larger than 4 GB and cannot be used to boot in EFI mode from USB.\r\n"
"This is a technical limitation from the UEFI/FAT32 process, not from " APPLICATION_NAME ".", "Non USB-UEFI compatible ISO", MB_OK|MB_ICONINFORMATION); "This is a technical limitation from the UEFI/FAT32 process, not from " APPLICATION_NAME ".", "Non USB-UEFI compatible ISO", MB_OK|MB_ICONINFORMATION);
safe_free(iso_path); safe_free(iso_path);
} else { } else if (!iso_report.has_syslinux_v5) { // This check is for Syslinux v4.x or earlier
for(i=0; i<NB_OLD_C32; i++) { for (i=0; i<NB_OLD_C32; i++) {
if (iso_report.has_old_c32[i]) { if (iso_report.has_old_c32[i]) {
fd = fopen(old_c32_name[i], "rb"); fd = fopen(old_c32_name[i], "rb");
if (fd != NULL) { if (fd != NULL) {
@ -1052,13 +1053,13 @@ DWORD WINAPI ISOScanThread(LPVOID param)
use_own_c32[i] = TRUE; use_own_c32[i] = TRUE;
} else { } else {
PrintStatus(0, FALSE, "Obsolete %s detected", old_c32_name[i]); PrintStatus(0, FALSE, "Obsolete %s detected", old_c32_name[i]);
safe_sprintf(msg, sizeof(msg), "This ISO image seems to use an obsolete version of %s\n" safe_sprintf(msg, sizeof(msg), "This ISO image seems to use an obsolete version of '%s'.\n"
"that may prevent boot menus from displaying properly...\n\n" "Because of this, boot menus may not display properly.\n\n"
"Rufus can fix this issue by downloading a newer version for you:\n" "Rufus can fix this issue by downloading a newer version for you:\n"
"- Select 'Yes' to connect to the internet and replace the file.\n" "- Choose 'Yes' to connect to the internet and replace the file.\n"
"- Select 'No' to leave the existing ISO file unmodified.\n" "- Choose 'No' to leave the existing ISO file unmodified.\n"
"If you don't know what to do, you should select 'Yes'.\n\n" "If you don't know what to do, you should select 'Yes'.\n\n"
"Note that the file will be downloaded in the current directory and once a\n" "Note: the new file will be downloaded in the current directory and once a "
"'%s' exists there, it will always be used as replacement.\n", old_c32_name[i], old_c32_name[i]); "'%s' exists there, it will always be used as replacement.\n", old_c32_name[i], old_c32_name[i]);
safe_sprintf(msg_title, sizeof(msg_title), "Replace %s?", old_c32_name[i]); safe_sprintf(msg_title, sizeof(msg_title), "Replace %s?", old_c32_name[i]);
if (MessageBoxA(hMainDialog, msg, msg_title, MB_YESNO|MB_ICONWARNING) == IDYES) { if (MessageBoxA(hMainDialog, msg, msg_title, MB_YESNO|MB_ICONWARNING) == IDYES) {

View file

@ -216,6 +216,7 @@ typedef struct {
BOOL has_autorun; BOOL has_autorun;
BOOL has_old_c32[NB_OLD_C32]; BOOL has_old_c32[NB_OLD_C32];
BOOL has_old_vesamenu; BOOL has_old_vesamenu;
BOOL has_syslinux_v5;
BOOL uses_minint; BOOL uses_minint;
} RUFUS_ISO_REPORT; } RUFUS_ISO_REPORT;

View file

@ -30,7 +30,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 329 IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW EXSTYLE WS_EX_APPWINDOW
CAPTION "Rufus v1.3.4.251" CAPTION "Rufus v1.3.4.252"
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -276,8 +276,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,4,251 FILEVERSION 1,3,4,252
PRODUCTVERSION 1,3,4,251 PRODUCTVERSION 1,3,4,252
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -294,13 +294,13 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus" VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.3.4.251" VALUE "FileVersion", "1.3.4.252"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2013 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011-2013 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe" VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.3.4.251" VALUE "ProductVersion", "1.3.4.252"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"