mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
Compare commits
2 commits
165127d221
...
9727fd4342
Author | SHA1 | Date | |
---|---|---|---|
|
9727fd4342 | ||
|
a6769e4fb2 |
3 changed files with 32 additions and 35 deletions
|
@ -368,8 +368,7 @@ static void fix_config(const char* psz_fullpath, const char* psz_path, const cha
|
||||||
// line to their grub.cfg, which means that their kernel option token is no longer
|
// line to their grub.cfg, which means that their kernel option token is no longer
|
||||||
//'linux' but '$linux'... and we have to add a workaround for that.
|
//'linux' but '$linux'... and we have to add a workaround for that.
|
||||||
// Finally, newer Arch and derivatives added an extra "search --label ..." command
|
// Finally, newer Arch and derivatives added an extra "search --label ..." command
|
||||||
// in GRUB which we need to cater for in supplement to the kernel line.
|
// in their GRUB conf, which we need to cater for in supplement of the kernel line.
|
||||||
|
|
||||||
static const char* grub_token[] = { "linux", "linuxefi", "$linux", "search" };
|
static const char* grub_token[] = { "linux", "linuxefi", "$linux", "search" };
|
||||||
iso_label = replace_char(img_report.label, ' ', "\\x20");
|
iso_label = replace_char(img_report.label, ' ', "\\x20");
|
||||||
usb_label = replace_char(img_report.usb_label, ' ', "\\x20");
|
usb_label = replace_char(img_report.usb_label, ' ', "\\x20");
|
||||||
|
@ -385,11 +384,9 @@ static void fix_config(const char* psz_fullpath, const char* psz_path, const cha
|
||||||
uprintf(" Patched %s: '%s' ➔ '%s'\n", src, iso_label, usb_label);
|
uprintf(" Patched %s: '%s' ➔ '%s'\n", src, iso_label, usb_label);
|
||||||
modified = TRUE;
|
modified = TRUE;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// Since version 8.2, and https://github.com/rhinstaller/anaconda/commit/a7661019546ec1d8b0935f9cb0f151015f2e1d95,
|
// Since version 8.2, and https://github.com/rhinstaller/anaconda/commit/a7661019546ec1d8b0935f9cb0f151015f2e1d95,
|
||||||
// Red Hat derivatives have changed their CD-ROM detection policy which leads to the installation source
|
// Red Hat derivatives have changed their CD-ROM detection policy which leads to the installation source
|
||||||
// not being found. So we need to use 'inst.repo' instead of 'inst.stage2' in the kernel options.
|
// not being found. So we need to use 'inst.repo' instead of 'inst.stage2' in the kernel options.
|
||||||
//
|
|
||||||
if (img_report.rh8_derivative && (replace_in_token_data(src, props->is_grub_cfg ?
|
if (img_report.rh8_derivative && (replace_in_token_data(src, props->is_grub_cfg ?
|
||||||
"linuxefi" : "append", "inst.stage2", "inst.repo", TRUE) != NULL)) {
|
"linuxefi" : "append", "inst.stage2", "inst.repo", TRUE) != NULL)) {
|
||||||
uprintf(" Patched %s: '%s' ➔ '%s'\n", src, "inst.stage2", "inst.repo");
|
uprintf(" Patched %s: '%s' ➔ '%s'\n", src, "inst.stage2", "inst.repo");
|
||||||
|
|
38
src/rufus.c
38
src/rufus.c
|
@ -75,6 +75,7 @@ static BOOL img_provided = FALSE;
|
||||||
static BOOL user_notified = FALSE;
|
static BOOL user_notified = FALSE;
|
||||||
static BOOL relaunch = FALSE;
|
static BOOL relaunch = FALSE;
|
||||||
static BOOL dont_display_image_name = FALSE;
|
static BOOL dont_display_image_name = FALSE;
|
||||||
|
static BOOL dont_process_dbt_devnodes = FALSE;
|
||||||
static BOOL user_changed_label = FALSE;
|
static BOOL user_changed_label = FALSE;
|
||||||
static BOOL user_deleted_rufus_dir = FALSE;
|
static BOOL user_deleted_rufus_dir = FALSE;
|
||||||
static BOOL app_changed_label = FALSE;
|
static BOOL app_changed_label = FALSE;
|
||||||
|
@ -630,7 +631,7 @@ static BOOL SetFileSystemAndClusterSize(char* fs_name)
|
||||||
static void SetFSFromISO(void)
|
static void SetFSFromISO(void)
|
||||||
{
|
{
|
||||||
int i, fs_tmp, preferred_fs = FS_UNKNOWN;
|
int i, fs_tmp, preferred_fs = FS_UNKNOWN;
|
||||||
uint32_t fs_mask = FS_FAT32 | FS_NTFS;
|
uint32_t fs_mask = FS_NTFS | (img_report.has_4GB_file ? 0 : FS_FAT32);
|
||||||
BOOL windows_to_go = (image_options & IMOP_WINTOGO) && (boot_type == BT_IMAGE) &&
|
BOOL windows_to_go = (image_options & IMOP_WINTOGO) && (boot_type == BT_IMAGE) &&
|
||||||
HAS_WINTOGO(img_report) && (ComboBox_GetCurItemData(hImageOption) == IMOP_WIN_TO_GO);
|
HAS_WINTOGO(img_report) && (ComboBox_GetCurItemData(hImageOption) == IMOP_WIN_TO_GO);
|
||||||
|
|
||||||
|
@ -643,33 +644,24 @@ static void SetFSFromISO(void)
|
||||||
fs_mask |= 1 << fs_tmp;
|
fs_mask |= 1 << fs_tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((preferred_fs == FS_UNKNOWN) && (preselected_fs != FS_UNKNOWN)) {
|
|
||||||
// If the FS requested from the command line is valid use it
|
// If the FS requested from the command line is valid use it
|
||||||
if (fs_mask & (1 << preselected_fs)) {
|
if ((preselected_fs != FS_UNKNOWN) && (fs_mask & (1 << preselected_fs))) {
|
||||||
preferred_fs = preselected_fs;
|
preferred_fs = preselected_fs;
|
||||||
}
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
if (preferred_fs == FS_UNKNOWN) {
|
|
||||||
// Syslinux and EFI have precedence over bootmgr (unless the user selected BIOS as target type)
|
// Syslinux and EFI have precedence over bootmgr (unless the user selected BIOS as target type)
|
||||||
if ((HAS_SYSLINUX(img_report)) || (HAS_REACTOS(img_report)) || HAS_KOLIBRIOS(img_report) ||
|
if ((HAS_SYSLINUX(img_report)) || (HAS_REACTOS(img_report)) || HAS_KOLIBRIOS(img_report) ||
|
||||||
(IS_EFI_BOOTABLE(img_report) && (target_type == TT_UEFI) && (!windows_to_go))) {
|
(IS_EFI_BOOTABLE(img_report) && (target_type == TT_UEFI) && (!windows_to_go) && (!img_report.has_4GB_file))) {
|
||||||
if (fs_mask & (1 << FS_FAT32)) {
|
if (fs_mask & (1 << FS_FAT32))
|
||||||
preferred_fs = FS_FAT32;
|
preferred_fs = FS_FAT32;
|
||||||
} else if ((fs_mask & (1 << FS_FAT16)) && !HAS_KOLIBRIOS(img_report)) {
|
else if ((fs_mask & (1 << FS_FAT16)) && !HAS_KOLIBRIOS(img_report))
|
||||||
preferred_fs = FS_FAT16;
|
preferred_fs = FS_FAT16;
|
||||||
}
|
|
||||||
} else if ((windows_to_go) || HAS_BOOTMGR(img_report) || HAS_WINPE(img_report)) {
|
} else if ((windows_to_go) || HAS_BOOTMGR(img_report) || HAS_WINPE(img_report)) {
|
||||||
if (fs_mask & (1 << FS_NTFS)) {
|
if ((fs_mask & (1 << FS_FAT32)) && (!img_report.has_4GB_file) && (allow_dual_uefi_bios))
|
||||||
|
preferred_fs = FS_FAT32;
|
||||||
|
else if (fs_mask & (1 << FS_NTFS))
|
||||||
preferred_fs = FS_NTFS;
|
preferred_fs = FS_NTFS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// The presence of a 4GB file forces the use of NTFS as default FS if available
|
|
||||||
if (img_report.has_4GB_file && (fs_mask & (1 << FS_NTFS))) {
|
|
||||||
preferred_fs = FS_NTFS;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try to select the FS
|
// Try to select the FS
|
||||||
for (i = 0; i < ComboBox_GetCount(hFileSystem); i++) {
|
for (i = 0; i < ComboBox_GetCount(hFileSystem); i++) {
|
||||||
|
@ -1276,6 +1268,10 @@ DWORD WINAPI ImageScanThread(LPVOID param)
|
||||||
uint8_t arch;
|
uint8_t arch;
|
||||||
char tmp_path[MAX_PATH], tmp_str[64];
|
char tmp_path[MAX_PATH], tmp_str[64];
|
||||||
|
|
||||||
|
// We may mount an ISO during the lookup of the Windows version, which
|
||||||
|
// produces DBT_DEVNODES_CHANGED messages that lead to unwanted device
|
||||||
|
// refreshes. So make sure to ignore DBT_DEVNODES_CHANGED while scanning.
|
||||||
|
dont_process_dbt_devnodes = TRUE;
|
||||||
if (image_path == NULL)
|
if (image_path == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
PrintInfoDebug(0, MSG_202);
|
PrintInfoDebug(0, MSG_202);
|
||||||
|
@ -1414,6 +1410,7 @@ DWORD WINAPI ImageScanThread(LPVOID param)
|
||||||
|
|
||||||
out:
|
out:
|
||||||
dont_display_image_name = FALSE;
|
dont_display_image_name = FALSE;
|
||||||
|
dont_process_dbt_devnodes = FALSE;
|
||||||
PrintInfo(0, MSG_210);
|
PrintInfo(0, MSG_210);
|
||||||
ExitThread(0);
|
ExitThread(0);
|
||||||
}
|
}
|
||||||
|
@ -2791,7 +2788,10 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
||||||
return (INT_PTR)TRUE;
|
return (INT_PTR)TRUE;
|
||||||
case DBT_DEVNODES_CHANGED:
|
case DBT_DEVNODES_CHANGED:
|
||||||
// If it's been more than a second since last device refresh, arm a refresh timer
|
// If it's been more than a second since last device refresh, arm a refresh timer
|
||||||
if (GetTickCount64() > LastRefresh + 1000) {
|
if (dont_process_dbt_devnodes) {
|
||||||
|
// This ensures we don't get unwanted refreshes while scanning an image.
|
||||||
|
LastRefresh = GetTickCount64();
|
||||||
|
} else if (GetTickCount64() > LastRefresh + 1000) {
|
||||||
LastRefresh = GetTickCount64();
|
LastRefresh = GetTickCount64();
|
||||||
SetTimer(hMainDialog, TID_REFRESH_TIMER, 1000, RefreshTimer);
|
SetTimer(hMainDialog, TID_REFRESH_TIMER, 1000, RefreshTimer);
|
||||||
}
|
}
|
||||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
||||||
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 3.21.1944"
|
CAPTION "Rufus 3.21.1946"
|
||||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||||
|
@ -396,8 +396,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 3,21,1944,0
|
FILEVERSION 3,21,1946,0
|
||||||
PRODUCTVERSION 3,21,1944,0
|
PRODUCTVERSION 3,21,1946,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -415,13 +415,13 @@ BEGIN
|
||||||
VALUE "Comments", "https://rufus.ie"
|
VALUE "Comments", "https://rufus.ie"
|
||||||
VALUE "CompanyName", "Akeo Consulting"
|
VALUE "CompanyName", "Akeo Consulting"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "3.21.1944"
|
VALUE "FileVersion", "3.21.1946"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
||||||
VALUE "OriginalFilename", "rufus-3.21.exe"
|
VALUE "OriginalFilename", "rufus-3.21.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "3.21.1944"
|
VALUE "ProductVersion", "3.21.1946"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue