mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[syslinux] try to match version detection with the config directory
This commit is contained in:
parent
d3f7e1c1aa
commit
4f3e27b089
2 changed files with 18 additions and 11 deletions
19
src/iso.c
19
src/iso.c
|
@ -632,8 +632,7 @@ void GetGrubVersion(char* buf, size_t buf_size)
|
||||||
|
|
||||||
BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan)
|
BOOL ExtractISO(const char* src_iso, const char* dest_dir, BOOL scan)
|
||||||
{
|
{
|
||||||
size_t i, size;
|
size_t i, j, size, sl_index = 0;
|
||||||
int j;
|
|
||||||
uint16_t sl_version;
|
uint16_t sl_version;
|
||||||
FILE* fd;
|
FILE* fd;
|
||||||
int r = 1;
|
int r = 1;
|
||||||
|
@ -735,7 +734,7 @@ out:
|
||||||
iso_blocking_status = -1;
|
iso_blocking_status = -1;
|
||||||
if (scan_only) {
|
if (scan_only) {
|
||||||
// Remove trailing spaces from the label
|
// Remove trailing spaces from the label
|
||||||
for (j=(int)safe_strlen(img_report.label)-1; ((j>=0)&&(isspaceU(img_report.label[j]))); j--)
|
for (j=safe_strlen(img_report.label)-1; ((j>0)&&(isspaceU(img_report.label[j]))); j--)
|
||||||
img_report.label[j] = 0;
|
img_report.label[j] = 0;
|
||||||
// We use the fact that UDF_BLOCKSIZE and ISO_BLOCKSIZE are the same here
|
// We use the fact that UDF_BLOCKSIZE and ISO_BLOCKSIZE are the same here
|
||||||
img_report.projected_size = total_blocks * ISO_BLOCKSIZE;
|
img_report.projected_size = total_blocks * ISO_BLOCKSIZE;
|
||||||
|
@ -787,11 +786,19 @@ out:
|
||||||
if (img_report.sl_version == 0) {
|
if (img_report.sl_version == 0) {
|
||||||
safe_strcpy(img_report.sl_version_ext, sizeof(img_report.sl_version_ext), ext);
|
safe_strcpy(img_report.sl_version_ext, sizeof(img_report.sl_version_ext), ext);
|
||||||
img_report.sl_version = sl_version;
|
img_report.sl_version = sl_version;
|
||||||
j = (int)i;
|
sl_index = i;
|
||||||
} else if ((img_report.sl_version != sl_version) || (safe_strcmp(img_report.sl_version_ext, ext) != 0)) {
|
} else if ((img_report.sl_version != sl_version) || (safe_strcmp(img_report.sl_version_ext, ext) != 0)) {
|
||||||
uprintf(" Found conflicting %s versions:\n '%s' (%d.%02d%s) vs '%s' (%d.%02d%s)", isolinux_bin,
|
uprintf(" Found conflicting %s versions:\n '%s' (%d.%02d%s) vs '%s' (%d.%02d%s)", isolinux_bin,
|
||||||
isolinux_path.String[j], SL_MAJOR(img_report.sl_version), SL_MINOR(img_report.sl_version),
|
isolinux_path.String[sl_index], SL_MAJOR(img_report.sl_version), SL_MINOR(img_report.sl_version),
|
||||||
img_report.sl_version_ext, isolinux_path.String[i], SL_MAJOR(sl_version), SL_MINOR(sl_version), ext);
|
img_report.sl_version_ext, isolinux_path.String[i], SL_MAJOR(sl_version), SL_MINOR(sl_version), ext);
|
||||||
|
// Workaround for Antergos and other ISOs, that have multiple Syslinux versions.
|
||||||
|
// Where possible, prefer to the one that resides in the same directory as the config file.
|
||||||
|
for (j=safe_strlen(img_report.cfg_path); (j>0) && (img_report.cfg_path[j]!='/'); j--);
|
||||||
|
if (safe_strnicmp(img_report.cfg_path, isolinux_path.String[i], j) == 0) {
|
||||||
|
safe_strcpy(img_report.sl_version_ext, sizeof(img_report.sl_version_ext), ext);
|
||||||
|
img_report.sl_version = sl_version;
|
||||||
|
sl_index = i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
free(buf);
|
free(buf);
|
||||||
_unlink(dot_isolinux_bin);
|
_unlink(dot_isolinux_bin);
|
||||||
|
@ -801,7 +808,7 @@ out:
|
||||||
static_sprintf(img_report.sl_version_str, "%d.%02d",
|
static_sprintf(img_report.sl_version_str, "%d.%02d",
|
||||||
SL_MAJOR(img_report.sl_version), SL_MINOR(img_report.sl_version));
|
SL_MAJOR(img_report.sl_version), SL_MINOR(img_report.sl_version));
|
||||||
uprintf(" Detected Syslinux version: %s%s (from '%s')",
|
uprintf(" Detected Syslinux version: %s%s (from '%s')",
|
||||||
img_report.sl_version_str, img_report.sl_version_ext, isolinux_path.String[j]);
|
img_report.sl_version_str, img_report.sl_version_ext, isolinux_path.String[sl_index]);
|
||||||
if ( (has_ldlinux_c32 && (SL_MAJOR(img_report.sl_version) < 5))
|
if ( (has_ldlinux_c32 && (SL_MAJOR(img_report.sl_version) < 5))
|
||||||
|| (!has_ldlinux_c32 && (SL_MAJOR(img_report.sl_version) >= 5)) )
|
|| (!has_ldlinux_c32 && (SL_MAJOR(img_report.sl_version) >= 5)) )
|
||||||
uprintf(" Warning: Conflict between Isolinux version and the presence of ldlinux.c32...");
|
uprintf(" Warning: Conflict between Isolinux version and the presence of ldlinux.c32...");
|
||||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 242, 376
|
IDD_DIALOG DIALOGEX 12, 12, 242, 376
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_ACCEPTFILES
|
EXSTYLE WS_EX_ACCEPTFILES
|
||||||
CAPTION "Rufus 2.10.960"
|
CAPTION "Rufus 2.10.961"
|
||||||
FONT 8, "Segoe UI Symbol", 400, 0, 0x0
|
FONT 8, "Segoe UI Symbol", 400, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
|
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
|
||||||
|
@ -320,8 +320,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 2,10,960,0
|
FILEVERSION 2,10,961,0
|
||||||
PRODUCTVERSION 2,10,960,0
|
PRODUCTVERSION 2,10,961,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -338,13 +338,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", "2.10.960"
|
VALUE "FileVersion", "2.10.961"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2016 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2016 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", "2.10.960"
|
VALUE "ProductVersion", "2.10.961"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
Loading…
Reference in a new issue