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

[ui] indicate to the user if UEFI-CSM mode is used

* Also fixes Japanese for UEFI-CSM
* Closes #508
This commit is contained in:
Pete Batard 2015-05-24 21:50:50 +01:00
parent 3edb9d93f7
commit 5e131a7f56
3 changed files with 90 additions and 64 deletions

View file

@ -392,13 +392,33 @@ static BOOL SetClusterSizes(int FSType)
return TRUE;
}
// This call sets the first option for the "partition type and target system" field
// according to whether we will be running in UEFI/CSM mode or standard UEFI
static void SetMBRForUEFI(BOOL replace)
{
BOOL useCSM = FALSE;
if (image_path != NULL) {
if ( (!iso_report.has_efi) || ((iso_report.has_bootmgr) && (!allow_dual_uefi_bios) &&
(Button_GetCheck(GetDlgItem(hMainDialog, IDC_WINDOWS_TO_GO)) != BST_CHECKED)) )
useCSM = TRUE;
}
if (replace)
ComboBox_DeleteString(hPartitionScheme, 0);
IGNORE_RETVAL(ComboBox_SetItemData(hPartitionScheme, ComboBox_InsertStringU(hPartitionScheme, 0,
lmprintf(MSG_031, PartitionTypeLabel[PARTITION_STYLE_MBR], useCSM?"UEFI-CSM":"UEFI")), (BT_BIOS<<16)|PARTITION_STYLE_MBR));
if (replace)
IGNORE_RETVAL(ComboBox_SetCurSel(hPartitionScheme, max(ComboBox_GetCurSel(hPartitionScheme), 0)));
}
/*
* Fill the drive properties (size, FS, etc)
*/
static BOOL SetDriveInfo(int ComboIndex)
{
DWORD i;
int pt, bt;
int pt;
char fs_type[32];
memset(&SelectedDrive, 0, sizeof(SelectedDrive));
@ -445,10 +465,13 @@ static BOOL SetDriveInfo(int ComboIndex)
// for XP, as it doesn't support GPT at all
if ((i == 2) && (nWindowsVersion <= WINDOWS_XP))
continue;
bt = (i==0)?BT_BIOS:BT_UEFI;
pt = (i==2)?PARTITION_STYLE_GPT:PARTITION_STYLE_MBR;
IGNORE_RETVAL(ComboBox_SetItemData(hPartitionScheme, ComboBox_AddStringU(hPartitionScheme,
lmprintf((i==0)?MSG_031:MSG_033, PartitionTypeLabel[pt])), (bt<<16)|pt));
if (i==0) {
SetMBRForUEFI(FALSE);
} else {
IGNORE_RETVAL(ComboBox_SetItemData(hPartitionScheme, ComboBox_AddStringU(hPartitionScheme,
lmprintf(MSG_033, PartitionTypeLabel[pt])), (BT_UEFI<<16)|pt));
}
}
// At least one filesystem is go => enable formatting
@ -586,6 +609,7 @@ static void SetTargetSystem(void)
{
int ts;
SetMBRForUEFI(TRUE);
if (SelectedDrive.PartitionType == PARTITION_STYLE_GPT) {
ts = 2; // GPT/UEFI
} else if (SelectedDrive.has_protective_mbr || SelectedDrive.has_mbr_uefi_marker || ((iso_report.has_efi) &&
@ -2317,6 +2341,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
(Button_GetCheck(GetDlgItem(hMainDialog, IDC_WINDOWS_TO_GO)) == BST_CHECKED) ) {
SetFSFromISO();
SetMBRProps();
SetMBRForUEFI(TRUE);
}
break;
case IDC_RUFUS_MBR:
@ -2863,6 +2888,7 @@ relaunch:
if ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'E')) {
allow_dual_uefi_bios = !allow_dual_uefi_bios;
PrintStatus2000(lmprintf(MSG_266), allow_dual_uefi_bios);
SetMBRForUEFI(TRUE);
continue;
}
// Alt-F => Toggle detection of USB HDDs

View file

@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Rufus 2.2.662"
CAPTION "Rufus 2.2.663"
FONT 8, "Segoe UI", 400, 0, 0x1
BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -157,7 +157,7 @@ END
IDD_DIALOG_XP DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Rufus 2.2.662"
CAPTION "Rufus 2.2.663"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -283,7 +283,7 @@ END
IDD_DIALOG_RTL DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
CAPTION "Rufus 2.2.662"
CAPTION "Rufus 2.2.663"
FONT 8, "Segoe UI", 400, 0, 0x1
BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -415,7 +415,7 @@ END
IDD_DIALOG_RTL_XP DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
CAPTION "Rufus 2.2.662"
CAPTION "Rufus 2.2.663"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -671,8 +671,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,2,662,0
PRODUCTVERSION 2,2,662,0
FILEVERSION 2,2,663,0
PRODUCTVERSION 2,2,663,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -689,13 +689,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "2.2.662"
VALUE "FileVersion", "2.2.663"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2015 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "2.2.662"
VALUE "ProductVersion", "2.2.663"
END
END
BLOCK "VarFileInfo"