Skip to content

Commit

Permalink
[core] do not set the UEFI:NTFS partition to ESP type
Browse files Browse the repository at this point in the history
* As usual, Microsoft products are so poorly designed that they can't deal with
  multiple instances of one thing. In this case, if the Windows installer sees
  two ESPs after you select the drive where you want to install Windows and it
  creates its own ESP there, it will fail during the "CopyinG Windows Files"
  step.
* So make sure that the UEFI:NTFS partition is *not* set to ESP type, even
  though it is really an ESP, which is something that we used to do, but that
  got reverted in 0f23c47.
  • Loading branch information
pbatard committed May 22, 2024
1 parent fcf5e2e commit 59fd550
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion src/drive.c
Original file line number Diff line number Diff line change
Expand Up @@ -2439,6 +2439,8 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m
// May override the the type of main partition if write_as_esp is active
if ((wcscmp(SelectedDrive.Partition[i].Name, L"EFI System Partition") == 0) ||
(wcscmp(SelectedDrive.Partition[i].Name, L"UEFI:NTFS") == 0))
// UEFI:NTFS as an MBR ESP somehow seems to be okay, but we may want
// to switch to type 0x01 (FAT21) if people report issues.
DriveLayoutEx.PartitionEntry[i].Mbr.PartitionType = 0xef;
else if (wcscmp(SelectedDrive.Partition[i].Name, L"Linux Persistence") == 0)
DriveLayoutEx.PartitionEntry[i].Mbr.PartitionType = 0x83;
Expand All @@ -2447,7 +2449,10 @@ BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL m
} else {
assert(partition_style == PARTITION_STYLE_GPT);
if (wcscmp(SelectedDrive.Partition[i].Name, L"UEFI:NTFS") == 0) {
DriveLayoutEx.PartitionEntry[i].Gpt.PartitionType = PARTITION_GENERIC_ESP;
// Boy do you *NOT* want the ESP of a GPT bootable drive to be declared as ESP,
// lest the Microsoft Windows installer errors out at "Copying Windows Files"
// because it just can't handle 2 ESPs on one system. The horror! The horror!
DriveLayoutEx.PartitionEntry[i].Gpt.PartitionType = PARTITION_MICROSOFT_DATA;
// Prevent a drive letter from being assigned to the UEFI:NTFS partition
DriveLayoutEx.PartitionEntry[i].Gpt.Attributes = GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER;
#if !defined(_DEBUG)
Expand Down
10 changes: 5 additions & 5 deletions src/rufus.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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 4.5.2178"
CAPTION "Rufus 4.5.2179"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
Expand Down Expand Up @@ -397,8 +397,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,5,2178,0
PRODUCTVERSION 4,5,2178,0
FILEVERSION 4,5,2179,0
PRODUCTVERSION 4,5,2179,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -416,13 +416,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "4.5.2178"
VALUE "FileVersion", "4.5.2179"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "� 2011-2024 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-4.5.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "4.5.2178"
VALUE "ProductVersion", "4.5.2179"
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit 59fd550

Please sign in to comment.