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

[misc] improve path display for Sylinux/GRUB resources

This commit is contained in:
Pete Batard 2021-10-21 01:59:03 +01:00
parent 1c2884ceba
commit 32b083e535
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
5 changed files with 20 additions and 15 deletions

View file

@ -11,7 +11,7 @@
<Identity
Name="19453.net.Rufus"
Publisher="CN=7AC86D13-3E5A-491A-ADD5-80095C212740"
Version="3.17.1839.0" />
Version="3.17.1840.0" />
<Properties>
<DisplayName>Rufus</DisplayName>

View file

@ -1517,6 +1517,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
fd = fopen(tmp, "rb");
if (fd != NULL) {
// If a file already exists in the current directory, use that one
to_windows_path(tmp);
uprintf("Will reuse '%s' from '%s\\%s\\%s-%s\\' for Grub 2.x installation",
core_img, app_data_dir, FILES_DIR, grub, img_report.grub2_version);
fseek(fd, 0, SEEK_END);
@ -1620,7 +1621,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
IGNORE_RETVAL(_chdir(FILES_DIR));
for (i=0; i<2; i++) {
// Check if we already have the relevant ldlinux_v#.##.sys & ldlinux_v#.##.bss files
static_sprintf(tmp, "%s-%s%s/%s.%s", syslinux, img_report.sl_version_str,
static_sprintf(tmp, "%s-%s%s\\%s.%s", syslinux, img_report.sl_version_str,
img_report.sl_version_ext, ldlinux, ldlinux_ext[i]);
fd = fopen(tmp, "rb");
if (fd != NULL) {
@ -1630,6 +1631,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
}
}
if ((syslinux_ldlinux_len[0] != 0) && (syslinux_ldlinux_len[1] != 0)) {
to_windows_path(img_report.sl_version_ext);
uprintf("Will reuse '%s.%s' and '%s.%s' from '%s\\%s\\%s-%s%s\\' for Syslinux installation",
ldlinux, ldlinux_ext[0], ldlinux, ldlinux_ext[1], app_data_dir, FILES_DIR, syslinux,
img_report.sl_version_str, img_report.sl_version_ext);
@ -1687,6 +1689,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
static_sprintf(tmp, "%s-%s/%s.%s", syslinux, embedded_sl_version_str[1], ldlinux, ldlinux_ext[2]);
fd = fopenU(tmp, "rb");
if (fd != NULL) {
to_windows_path(tmp);
uprintf("Will reuse '%s\\%s\\%s' for Syslinux installation", app_data_dir, FILES_DIR, tmp);
fclose(fd);
} else {
@ -1720,6 +1723,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param)
static_sprintf(tmp, "grub4dos-%s/grldr", GRUB4DOS_VERSION);
fd = fopenU(tmp, "rb");
if (fd != NULL) {
to_windows_path(tmp);
uprintf("Will reuse '%s\\%s\\%s' for Grub4DOS installation", app_data_dir, FILES_DIR, tmp);
fclose(fd);
} else {

View file

@ -163,6 +163,7 @@
#define static_sprintf(dst, ...) safe_sprintf(dst, sizeof(dst), __VA_ARGS__)
#define safe_strlen(str) ((((char*)str)==NULL)?0:strlen(str))
#define safe_strdup _strdup
#define to_windows_path(str) do { size_t __i; for (__i = 0; __i < safe_strlen(str); __i++) if (str[__i] == '/') str[__i] = '\\'; } while(0)
#if defined(_MSC_VER)
#define safe_vsnprintf(buf, size, format, arg) _vsnprintf_s(buf, size, _TRUNCATE, format, arg)
#else

View file

@ -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.17.1839"
CAPTION "Rufus 3.17.1840"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -395,8 +395,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,17,1839,0
PRODUCTVERSION 3,17,1839,0
FILEVERSION 3,17,1840,0
PRODUCTVERSION 3,17,1840,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -414,13 +414,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.17.1839"
VALUE "FileVersion", "3.17.1840"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2021 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-3.17.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.17.1839"
VALUE "ProductVersion", "3.17.1840"
END
END
BLOCK "VarFileInfo"

View file

@ -166,17 +166,17 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int file_system)
syslinux_ldlinux[i] = (unsigned char*) malloc(syslinux_ldlinux_len[i]);
if (syslinux_ldlinux[i] == NULL)
goto out;
static_sprintf(path, "%s/%s-%s%s/%s.%s", FILES_DIR, syslinux, img_report.sl_version_str,
static_sprintf(path, "%s\\%s-%s%s\\%s.%s", FILES_DIR, syslinux, img_report.sl_version_str,
img_report.sl_version_ext, ldlinux, i==0?"sys":"bss");
fd = fopen(path, "rb");
if (fd == NULL) {
uprintf("Could not open %s", path);
uprintf("Could not open %s\\%s", app_data_dir, path);
goto out;
}
length = fread(syslinux_ldlinux[i], 1, (size_t)syslinux_ldlinux_len[i], fd);
fclose(fd);
if (length != (size_t)syslinux_ldlinux_len[i]) {
uprintf("Could not read %s", path);
uprintf("Could not read %s\\%s", app_data_dir, path);
goto out;
}
uprintf("Using existing '%s\\%s' %s", app_data_dir, path,
@ -250,7 +250,7 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int file_system)
vcn = extent.NextVcn) {
err = NtfsSectLcnToLba(&vol_info, &extent.FirstLcn, &lba);
if (err != ERROR_SUCCESS) {
uprintf("Could not translate LDLINUX.SYS LCN to disk LBA");
uprintf("Could not translate 'ldlinux.sys' LCN to disk LBA");
goto out;
}
lba.QuadPart -= vol_info.PartitionLba.QuadPart;
@ -331,7 +331,7 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int file_system)
if (boot_type == BT_SYSLINUX_V6) {
IGNORE_RETVAL(_chdirU(app_data_dir));
static_sprintf(path, "%s/%s-%s", FILES_DIR, syslinux, embedded_sl_version_str[1]);
static_sprintf(path, "%s\\%s-%s", FILES_DIR, syslinux, embedded_sl_version_str[1]);
IGNORE_RETVAL(_chdir(path));
static_sprintf(path, "%C:\\%s.%s", drive_letter, ldlinux, ldlinux_ext[2]);
fd = fopen(&path[3], "rb");
@ -340,7 +340,7 @@ BOOL InstallSyslinux(DWORD drive_index, char drive_letter, int file_system)
} else {
fclose(fd);
if (CopyFileU(&path[3], path, TRUE)) {
uprintf("Created '%s' (from '%s/%s-%s/%s') %s", path, FILES_DIR, syslinux,
uprintf("Created '%s' (from '%s\\%s\\%s-%s\\%s') %s", path, app_data_dir, FILES_DIR, syslinux,
embedded_sl_version_str[1], &path[3], IsFileInDB(&path[3])?"":"");
} else {
uprintf("Failed to create '%s': %s", path, WindowsErrorString());