diff --git a/src/rufus.c b/src/rufus.c index d6e8de5c..b5d6ed44 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -384,6 +384,25 @@ static BOOL GetDriveInfo(void) return SetClusterSizes((int)ComboBox_GetItemData(hFileSystem, ComboBox_GetCurSel(hFileSystem))); } +static void SetFSFromISO(void) +{ + int i, fs; + + if (iso_path == NULL) + return; + + for (i=ComboBox_GetCount(hFileSystem)-1; i>=0; i--) { + fs = ComboBox_GetItemData(hFileSystem, i); + if ( ((iso_report.has_bootmgr) && (fs == FS_NTFS)) + || ((iso_report.has_isolinux) && ((fs == FS_FAT32) || (fs == FS_FAT16))) ) { + IGNORE_RETVAL(ComboBox_SetCurSel(hFileSystem, i)); + break; + } + } + SendMessage(hMainDialog, WM_COMMAND, (CBN_SELCHANGE<<16) | IDC_FILESYSTEM, + ComboBox_GetCurSel(hFileSystem)); +} + /* * Populate the UI properties */ @@ -411,8 +430,9 @@ static BOOL PopulateProperties(int ComboIndex) } SelectedDrive.DeviceNumber = (DWORD)ComboBox_GetItemData(hDeviceList, ComboIndex); - if (!GetDriveInfo()) + if (!GetDriveInfo()) // This also populates FS return FALSE; + SetFSFromISO(); HumanReadableSize = (double)SelectedDrive.DiskSize; for (i=0; i0)&&(iso_path[i]!='\\'); i--); PrintStatus(0, TRUE, "Using ISO: %s\n", &iso_path[i+1]); // Some Linux distros, such as Arch Linux, require the USB drive to have @@ -980,6 +1008,10 @@ DWORD WINAPI ISOScanThread(LPVOID param) if (iso_report.label[0] != 0) { SetWindowTextU(hLabel, iso_report.label); } + // Lose the focus on the select ISO (but place it on Close) + SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)FALSE, 0); + // Lose the focus from Close and set it back to Start + SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hMainDialog, IDC_START), TRUE); } out: @@ -1217,14 +1249,16 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA break; fs = (int)ComboBox_GetItemData(hFileSystem, ComboBox_GetCurSel(hFileSystem)); SetClusterSizes(fs); - if (((fs == FS_EXFAT) || (fs <0)) && IsWindowEnabled(hDOS)) { - // unlikely to be supported by BIOSes => don't bother - IGNORE_RETVAL(ComboBox_SetCurSel(hDOSType, 0)); - uDOSChecked = IsDlgButtonChecked(hMainDialog, IDC_DOS); - CheckDlgButton(hDlg, IDC_DOS, BST_UNCHECKED); - EnableWindow(hDOS, FALSE); - EnableWindow(hDOSType, FALSE); - ShowWindow(hSelectISO, SW_HIDE); + if ((fs == FS_EXFAT) || (fs <0)) { + if (IsWindowEnabled(hDOS)) { + // unlikely to be supported by BIOSes => don't bother + IGNORE_RETVAL(ComboBox_SetCurSel(hDOSType, 0)); + uDOSChecked = IsDlgButtonChecked(hMainDialog, IDC_DOS); + CheckDlgButton(hDlg, IDC_DOS, BST_UNCHECKED); + EnableWindow(hDOS, FALSE); + EnableWindow(hDOSType, FALSE); + EnableWindow(hSelectISO, FALSE); + } break; } IGNORE_RETVAL(ComboBox_ResetContent(hDOSType)); @@ -1238,23 +1272,25 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA if (fs == FS_NTFS) { IGNORE_RETVAL(ComboBox_SetItemData(hDOSType, ComboBox_AddStringU(hDOSType, "ISO Image"), DT_ISO_NTFS)); } - IGNORE_RETVAL(ComboBox_SetCurSel(hDOSType, (bWithFreeDOS && (fs != FS_NTFS))?1:0)); + if (iso_path != NULL) + IGNORE_RETVAL(ComboBox_SetCurSel(hDOSType, ComboBox_GetCount(hDOSType) - 1)); + else + IGNORE_RETVAL(ComboBox_SetCurSel(hDOSType, (bWithFreeDOS && (fs != FS_NTFS))?1:0)); if (!IsWindowEnabled(hDOS)) { EnableWindow(hDOS, TRUE); EnableWindow(hDOSType, TRUE); + EnableWindow(hSelectISO, TRUE); CheckDlgButton(hDlg, IDC_DOS, uDOSChecked); } - // Fall through to enable/disable the ISO selection + break; case IDC_DOSTYPE: if (HIWORD(wParam) != CBN_SELCHANGE) break; dt = (int)ComboBox_GetItemData(hDOSType, ComboBox_GetCurSel(hDOSType)); - if ((dt != DT_ISO_NTFS) && (dt != DT_ISO_FAT)) { - ShowWindow(hSelectISO, SW_HIDE); - break; + if ((dt == DT_ISO_NTFS) || (dt == DT_ISO_FAT)) { + SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)hSelectISO, TRUE); } - ShowWindow(hSelectISO, SW_SHOW); - break; + return (INT_PTR)TRUE; case IDC_SELECT_ISO: DestroyTooltip(hISOToolTip); safe_free(iso_path); diff --git a/src/rufus.rc b/src/rufus.rc index 93a06b83..c6233d0c 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 206, 278 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW -CAPTION "Rufus v1.1.1.135" +CAPTION "Rufus v1.1.1.136" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,236,50,14 @@ -57,7 +57,7 @@ BEGIN COMBOBOX IDC_DOSTYPE,119,183,49,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_NBPASSES,119,159,49,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Test",IDC_TEST,62,236,20,14,NOT WS_VISIBLE - PUSHBUTTON "...",IDC_SELECT_ISO,171,182,22,14,BS_ICON | NOT WS_VISIBLE + PUSHBUTTON "...",IDC_SELECT_ISO,171,182,22,14,BS_ICON END IDD_ABOUTBOX DIALOGEX 0, 0, 287, 195 @@ -71,7 +71,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP CONTROL "http://rufus.akeo.ie",IDC_ABOUT_RUFUS_URL, "SysLink",WS_TABSTOP,46,47,114,9 - LTEXT "Version 1.1.1 (Build 135)",IDC_STATIC,46,19,78,8 + LTEXT "Version 1.1.1 (Build 136)",IDC_STATIC,46,19,78,8 PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8 @@ -222,8 +222,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,1,1,135 - PRODUCTVERSION 1,1,1,135 + FILEVERSION 1,1,1,136 + PRODUCTVERSION 1,1,1,136 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -240,13 +240,13 @@ BEGIN BEGIN VALUE "CompanyName", "akeo.ie" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.1.1.135" + VALUE "FileVersion", "1.1.1.136" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "1.1.1.135" + VALUE "ProductVersion", "1.1.1.136" END END BLOCK "VarFileInfo"