1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00
* Closes #37
* Closes #38
* Closes #39
* Closes #42 (from previous commits)
* Closes #44 (from previous commits)
This commit is contained in:
Pete Batard 2012-02-22 00:23:17 +00:00
parent 7e7c75169c
commit e0e974603c
5 changed files with 25 additions and 19 deletions

View file

@ -66,7 +66,6 @@ static BOOLEAN __stdcall FormatExCallback(FILE_SYSTEM_CALLBACK_COMMAND Command,
case FCC_PROGRESS: case FCC_PROGRESS:
percent = (DWORD*)pData; percent = (DWORD*)pData;
PrintStatus(0, FALSE, "Formatting: %d%% completed.", *percent); PrintStatus(0, FALSE, "Formatting: %d%% completed.", *percent);
// uprintf("%d percent completed.\n", *percent);
UpdateProgress(OP_FORMAT, 1.0f * (*percent)); UpdateProgress(OP_FORMAT, 1.0f * (*percent));
break; break;
case FCC_STRUCTURE_PROGRESS: // No progress on quick format case FCC_STRUCTURE_PROGRESS: // No progress on quick format
@ -668,6 +667,7 @@ DWORD WINAPI FormatThread(LPVOID param)
} }
if (IsChecked(IDC_SET_ICON)) if (IsChecked(IDC_SET_ICON))
SetAutorun(drive_name); SetAutorun(drive_name);
UpdateProgress(OP_DOS, -1.0f);
// Issue another complete remount before we exit, to ensure we're clean // Issue another complete remount before we exit, to ensure we're clean
RemountVolume(drive_name[0]); RemountVolume(drive_name[0]);
} }

View file

@ -105,7 +105,7 @@ static BOOL SaveIcon(const char* filename)
icondir = (GRPICONDIR*)LockResource(res_handle); icondir = (GRPICONDIR*)LockResource(res_handle);
hFile = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, hFile = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, CREATE_ALWAYS, 0, 0); NULL, CREATE_NEW, 0, 0);
if (hFile == INVALID_HANDLE_VALUE) { if (hFile == INVALID_HANDLE_VALUE) {
uprintf("Unable to create icon '%s': %s.\n", filename, WindowsErrorString()); uprintf("Unable to create icon '%s': %s.\n", filename, WindowsErrorString());
goto out; goto out;
@ -169,7 +169,7 @@ BOOL SetAutorun(const char* path)
safe_sprintf(filename, sizeof(filename), "%s\\autorun.inf", path); safe_sprintf(filename, sizeof(filename), "%s\\autorun.inf", path);
fd = fopen(filename, "r"); // If there's an existing autorun, don't overwrite fd = fopen(filename, "r"); // If there's an existing autorun, don't overwrite
if (fd != NULL) { if (fd != NULL) {
uprintf("An existing autorun.inf already exists - keeping it\n"); uprintf("%s already exists - keeping it\n", filename);
fclose(fd); fclose(fd);
return FALSE; return FALSE;
} }
@ -183,7 +183,7 @@ BOOL SetAutorun(const char* path)
GetWindowTextW(hLabel, wlabel, ARRAYSIZE(wlabel)); GetWindowTextW(hLabel, wlabel, ARRAYSIZE(wlabel));
GetWindowTextW(hMainDialog, wRufusVersion, ARRAYSIZE(wRufusVersion)); GetWindowTextW(hMainDialog, wRufusVersion, ARRAYSIZE(wRufusVersion));
fwprintf(fd, L"; Created by %s\n; " LTEXT(RUFUS_URL) L"\n", wRufusVersion); fwprintf(fd, L"; Created by %s\n; " LTEXT(RUFUS_URL) L"\n", wRufusVersion);
fwprintf(fd, L"[autorun]\nlabel = %s\nicon = autorun.ico", wlabel); fwprintf(fd, L"[autorun]\nicon = autorun.ico\nlabel = %s\n", wlabel);
fclose(fd); fclose(fd);
uprintf("Created: %s\n", filename); uprintf("Created: %s\n", filename);

View file

@ -668,13 +668,13 @@ static void InitProgress(void)
// 1 extra slot for PBR writing // 1 extra slot for PBR writing
switch (ComboBox_GetItemData(hDOSType, ComboBox_GetCurSel(hDOSType))) { switch (ComboBox_GetItemData(hDOSType, ComboBox_GetCurSel(hDOSType))) {
case DT_WINME: case DT_WINME:
nb_slots[OP_DOS] = 3+1; nb_slots[OP_DOS] = 4+1;
break; break;
case DT_FREEDOS: case DT_FREEDOS:
nb_slots[OP_DOS] = 5+1; nb_slots[OP_DOS] = 6+1;
break; break;
default: default:
nb_slots[OP_DOS] = 1+1; nb_slots[OP_DOS] = 3+1;
break; break;
} }
} }
@ -1306,10 +1306,18 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
break; break;
dt = (int)ComboBox_GetItemData(hDOSType, ComboBox_GetCurSel(hDOSType)); dt = (int)ComboBox_GetItemData(hDOSType, ComboBox_GetCurSel(hDOSType));
if ((dt == DT_ISO_NTFS) || (dt == DT_ISO_FAT)) { if ((dt == DT_ISO_NTFS) || (dt == DT_ISO_FAT)) {
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)hSelectISO, TRUE); if ((iso_path == NULL) || (iso_report.label[0] == 0)) {
// Set focus to the Select ISO button
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)FALSE, 0);
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)hSelectISO, TRUE);
} else {
SetWindowTextU(hLabel, iso_report.label);
}
} else { } else {
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)FALSE, 0); // Set focus on the start button
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)FALSE, 0);
SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hMainDialog, IDC_START), TRUE); SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hMainDialog, IDC_START), TRUE);
SetWindowTextU(hLabel, SelectedDrive.proposed_label);
} }
return (INT_PTR)TRUE; return (INT_PTR)TRUE;
case IDC_SELECT_ISO: case IDC_SELECT_ISO:

View file

@ -110,9 +110,6 @@ enum action_type {
}; };
/* File system indexes in our FS combobox */ /* File system indexes in our FS combobox */
// TODO: FormatEx should support "NTFS", "FAT", "FAT32", "UDF", and "EXFAT" as per
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa819439.aspx
enum { enum {
FS_UNKNOWN = -1, FS_UNKNOWN = -1,
FS_FAT16 = 0, FS_FAT16 = 0,

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 289 IDD_DIALOG DIALOGEX 12, 12, 206, 289
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW EXSTYLE WS_EX_APPWINDOW
CAPTION "Rufus v1.1.2.142" CAPTION "Rufus v1.1.2.143"
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,248,50,14 DEFPUSHBUTTON "Start",IDC_START,94,248,50,14
@ -52,7 +52,8 @@ BEGIN
CONTROL "Check device for bad blocks:",IDC_BADBLOCKS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,161,101,10 CONTROL "Check device for bad blocks:",IDC_BADBLOCKS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,161,101,10
CONTROL "Quick Format",IDC_QUICKFORMAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,173,58,10 CONTROL "Quick Format",IDC_QUICKFORMAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,173,58,10
CONTROL "Create a bootable disk using:",IDC_DOS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,185,104,10 CONTROL "Create a bootable disk using:",IDC_DOS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,185,104,10
CONTROL "Set icon and extended label",IDC_SET_ICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,197,105,10 CONTROL "Create extended label and icon files",IDC_SET_ICON,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,197,131,10
LTEXT "New volume label",IDC_STATIC,9,121,105,10 LTEXT "New volume label",IDC_STATIC,9,121,105,10
CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,7,221,189,9 CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,7,221,189,9
COMBOBOX IDC_NBPASSES,119,159,49,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_NBPASSES,119,159,49,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
@ -72,7 +73,7 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP
CONTROL "<a href=""http://rufus.akeo.ie"">http://rufus.akeo.ie</a>",IDC_ABOUT_RUFUS_URL, CONTROL "<a href=""http://rufus.akeo.ie"">http://rufus.akeo.ie</a>",IDC_ABOUT_RUFUS_URL,
"SysLink",WS_TABSTOP,46,47,114,9 "SysLink",WS_TABSTOP,46,47,114,9
LTEXT "Version 1.1.2 (Build 142)",IDC_STATIC,46,19,78,8 LTEXT "Version 1.1.2 (Build 143)",IDC_STATIC,46,19,78,8
PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP 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 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 LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8
@ -222,8 +223,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,2,142 FILEVERSION 1,1,2,143
PRODUCTVERSION 1,1,2,142 PRODUCTVERSION 1,1,2,143
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -240,13 +241,13 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "akeo.ie" VALUE "CompanyName", "akeo.ie"
VALUE "FileDescription", "Rufus" VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.1.2.142" VALUE "FileVersion", "1.1.2.143"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe" VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.1.2.142" VALUE "ProductVersion", "1.1.2.143"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"