mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
Merge branch 'master' into localization
This commit is contained in:
commit
843ce2e19a
9 changed files with 38 additions and 36 deletions
|
@ -1,7 +1,7 @@
|
|||
Rufus: The Reliable USB Formatting Utility
|
||||
|
||||
Features:
|
||||
- Formats USB flash drives to FAT/FAT32/NTFS/exFAT
|
||||
- Formats USB flash drives to FAT/FAT32/NTFS/UDF/exFAT
|
||||
- Creates DOS bootable USB drives, with no external files required
|
||||
- Creates MBR or GPT/UEFI bootable USB drives
|
||||
- Creates bootable USB drives from bootable ISOs (Windows, Linux, etc.)
|
||||
|
|
|
@ -225,7 +225,7 @@ t MSG_214 "Failed to launch new application"
|
|||
t MSG_215 "Opened %s"
|
||||
t MSG_216 "Saved %s"
|
||||
# Formatting status (make sure you use a double % to print the percent sign)
|
||||
t MSG_217 "Formatting: %d%% completed"
|
||||
t MSG_217 "Formatting: %0.1f%% completed"
|
||||
t MSG_218 "Creating file system: Task %d/%d completed"
|
||||
t MSG_219 "NTFS Fixup: %d%% completed"
|
||||
t MSG_221 "Setting Label (This may take while)..."
|
||||
|
@ -565,7 +565,7 @@ t MSG_213 "Lancement de la nouvelle application..."
|
|||
t MSG_214 "Echec de lancement de l'application"
|
||||
t MSG_215 "%s ouvert"
|
||||
t MSG_216 "%s sauvegardé"
|
||||
t MSG_217 "Formatage: %d%% complet"
|
||||
t MSG_217 "Formatage: %0.1f%% complet"
|
||||
t MSG_218 "Création du système de fichiers: Tâche %d/%d complète"
|
||||
t MSG_219 "Finalisation NTFS: %d%% complète"
|
||||
t MSG_221 "Ecriture du label (peut prendre du temps)..."
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,3 +1,3 @@
|
|||
o ldlinux_v4.[bss|sys] have been renamed from ldlinux.[bss|sys] found in syslinux-4.06/core/
|
||||
o ldlinux_v4.[bss|sys] have been renamed from ldlinux.[bss|sys] found in syslinux-4.07/core/
|
||||
o ldlinux_v5.[bss|sys] have been renamed from ldlinux.[bss|sys] found in syslinux-5.10/core/
|
||||
http://www.kernel.org/pub/linux/utils/boot/syslinux/
|
44
src/format.c
44
src/format.c
|
@ -55,6 +55,7 @@ static int task_number = 0;
|
|||
extern const int nb_steps[FS_MAX];
|
||||
static int fs_index = 0;
|
||||
BOOL force_large_fat32 = FALSE;
|
||||
static BOOL WritePBR(HANDLE hLogicalDrive);
|
||||
|
||||
/*
|
||||
* FormatEx callback. Return FALSE to halt operations
|
||||
|
@ -205,8 +206,8 @@ static void ToValidLabel(WCHAR* name, BOOL bFAT)
|
|||
{
|
||||
size_t i, j, k;
|
||||
BOOL found;
|
||||
WCHAR unauthorized[] = L"*?.,;:/\\|+=<>[]";
|
||||
WCHAR to_underscore[] = L"\t";
|
||||
WCHAR unauthorized[] = L"*?,;:/\\|+=<>[]";
|
||||
WCHAR to_underscore[] = L"\t.";
|
||||
|
||||
if (name == NULL)
|
||||
return;
|
||||
|
@ -331,7 +332,7 @@ static DWORD GetFATSizeSectors(DWORD DskSize, DWORD ReservedSecCnt, DWORD SecPer
|
|||
static BOOL FormatFAT32(DWORD DriveIndex)
|
||||
{
|
||||
BOOL r = FALSE;
|
||||
DWORD i;
|
||||
DWORD i, LastRefresh = 0;
|
||||
HANDLE hLogicalVolume;
|
||||
DWORD cbRet;
|
||||
DISK_GEOMETRY dgDrive;
|
||||
|
@ -550,9 +551,12 @@ static BOOL FormatFAT32(DWORD DriveIndex)
|
|||
|
||||
format_percent = 0.0f;
|
||||
for (i=0; i<(SystemAreaSize+BurstSize-1); i+=BurstSize) {
|
||||
format_percent = (100.0f*i)/(1.0f*(SystemAreaSize+BurstSize));
|
||||
PrintStatus(0, FALSE, lmprintf(MSG_217, (int)format_percent));
|
||||
UpdateProgress(OP_FORMAT, format_percent);
|
||||
if (GetTickCount() > LastRefresh + 25) {
|
||||
LastRefresh = GetTickCount();
|
||||
format_percent = (100.0f*i)/(1.0f*(SystemAreaSize+BurstSize));
|
||||
PrintStatus(0, FALSE, lmprintf(MSG_217, format_percent));
|
||||
UpdateProgress(OP_FORMAT, format_percent);
|
||||
}
|
||||
if (IS_ERROR(FormatStatus)) goto out; // For cancellation
|
||||
if (write_sectors(hLogicalVolume, BytesPerSect, i, BurstSize, pZeroSect) != (BytesPerSect*BurstSize)) {
|
||||
die("Error clearing reserved sectors\n", ERROR_WRITE_FAULT);
|
||||
|
@ -574,6 +578,13 @@ static BOOL FormatFAT32(DWORD DriveIndex)
|
|||
write_sectors(hLogicalVolume, BytesPerSect, SectorStart, 1, pFirstSectOfFat);
|
||||
}
|
||||
|
||||
// Must do it here, as have issues when trying to write the PBR after a remount
|
||||
PrintStatus(0, TRUE, "Writing partition boot record...");
|
||||
if (!WritePBR(hLogicalVolume)) {
|
||||
// Non fatal error, but the drive probably won't boot
|
||||
uprintf("Could not write partition boot record - drive may not boot...\n");
|
||||
}
|
||||
|
||||
// Set the FAT32 volume label
|
||||
GetWindowTextW(hLabel, wLabel, ARRAYSIZE(wLabel));
|
||||
ToValidLabel(wLabel, TRUE);
|
||||
|
@ -779,7 +790,9 @@ static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSi
|
|||
// http://en.wikipedia.org/wiki/GUID_Partition_Table tells us we should clear 34 sectors at the
|
||||
// beginning and 33 at the end. We bump these values to MAX_SECTORS_TO_CLEAR each end to help
|
||||
// with reluctant access to large drive.
|
||||
for (i=0; i<MAX_SECTORS_TO_CLEAR; i++) {
|
||||
|
||||
// Must clear at least 1MB + the PBR for large FAT32 format to work on a large drive
|
||||
for (i=0; i<(2048+MAX_SECTORS_TO_CLEAR); i++) {
|
||||
if ((IS_ERROR(FormatStatus)) || (write_sectors(hPhysicalDrive, SectorSize, i, 1, pBuf) != SectorSize)) {
|
||||
goto out;
|
||||
}
|
||||
|
@ -789,13 +802,6 @@ static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSi
|
|||
goto out;
|
||||
}
|
||||
}
|
||||
// Also attempt to clear the PBR, usually located at the 1 MB mark
|
||||
for (i=1024*1024/SectorSize; i<MAX_SECTORS_TO_CLEAR; i++) {
|
||||
if ((IS_ERROR(FormatStatus)) || (write_sectors(hPhysicalDrive, SectorSize, i, 1, pBuf) != SectorSize)) {
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
r = TRUE;
|
||||
|
||||
out:
|
||||
|
@ -1156,7 +1162,7 @@ DWORD WINAPI CloseFormatPromptThread(LPVOID param) {
|
|||
DWORD WINAPI FormatThread(LPVOID param)
|
||||
{
|
||||
int r, pt, bt, fs, dt;
|
||||
BOOL ret;
|
||||
BOOL ret, use_large_fat32;
|
||||
DWORD DriveIndex = (DWORD)(uintptr_t)param;
|
||||
HANDLE hPhysicalDrive = INVALID_HANDLE_VALUE;
|
||||
HANDLE hLogicalVolume = INVALID_HANDLE_VALUE;
|
||||
|
@ -1172,6 +1178,7 @@ DWORD WINAPI FormatThread(LPVOID param)
|
|||
dt = (int)ComboBox_GetItemData(hBootType, ComboBox_GetCurSel(hBootType));
|
||||
pt = GETPARTTYPE((int)ComboBox_GetItemData(hPartitionScheme, ComboBox_GetCurSel(hPartitionScheme)));
|
||||
bt = GETBIOSTYPE((int)ComboBox_GetItemData(hPartitionScheme, ComboBox_GetCurSel(hPartitionScheme)));
|
||||
use_large_fat32 = (fs == FS_FAT32) && ((SelectedDrive.DiskSize > LARGE_FAT32_SIZE) || (force_large_fat32));
|
||||
|
||||
PrintStatus(0, TRUE, lmprintf(MSG_225));
|
||||
hPhysicalDrive = GetPhysicalHandle(DriveIndex, TRUE, TRUE);
|
||||
|
@ -1319,8 +1326,7 @@ DWORD WINAPI FormatThread(LPVOID param)
|
|||
|
||||
// If FAT32 is requested and we have a large drive (>32 GB) use
|
||||
// large FAT32 format, else use MS's FormatEx.
|
||||
ret = ((fs == FS_FAT32) && ((SelectedDrive.DiskSize > LARGE_FAT32_SIZE) || (force_large_fat32)))?
|
||||
FormatFAT32(DriveIndex):FormatDrive(DriveIndex);
|
||||
ret = use_large_fat32?FormatFAT32(DriveIndex):FormatDrive(DriveIndex);
|
||||
if (!ret) {
|
||||
// Error will be set by FormatDrive() in FormatStatus
|
||||
uprintf("Format error: %s\n", StrError(FormatStatus));
|
||||
|
@ -1365,7 +1371,7 @@ DWORD WINAPI FormatThread(LPVOID param)
|
|||
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|ERROR_INSTALL_FAILURE;
|
||||
goto out;
|
||||
}
|
||||
} else if ((dt == DT_WINME) || (dt == DT_FREEDOS) || ((dt == DT_ISO) && (fs == FS_NTFS))) {
|
||||
} else if ((((dt == DT_WINME) || (dt == DT_FREEDOS)) && (!use_large_fat32)) || ((dt == DT_ISO) && (fs == FS_NTFS))) {
|
||||
// We still have a lock, which we need to modify the volume boot record
|
||||
// => no need to reacquire the lock...
|
||||
hLogicalVolume = GetLogicalHandle(DriveIndex, TRUE, FALSE);
|
||||
|
@ -1422,7 +1428,7 @@ DWORD WINAPI FormatThread(LPVOID param)
|
|||
goto out;
|
||||
}
|
||||
if ((bt == BT_UEFI) && (!iso_report.has_efi) && (iso_report.has_win7_efi)) {
|
||||
// TODO: (v1.3.4) check ISO with EFI only
|
||||
// TODO: (v1.4.0) check ISO with EFI only
|
||||
PrintStatus(0, TRUE, lmprintf(MSG_232));
|
||||
wim_image[0] = drive_name[0];
|
||||
efi_dst[0] = drive_name[0];
|
||||
|
|
10
src/rufus.c
10
src/rufus.c
|
@ -227,11 +227,7 @@ static BOOL DefineClusterSizes(void)
|
|||
// > 32GB FAT32 is not supported by MS and FormatEx but is achieved using fat32format
|
||||
// See: http://www.ridgecrop.demon.co.uk/index.htm?fat32format.htm
|
||||
// < 32 MB FAT32 is not allowed by FormatEx, so we don't bother
|
||||
// We also found issues with > 1TB drives, so we use our own max threshold (can be disabled with Alt-S)
|
||||
if ((size_check) && (1.0f*SelectedDrive.DiskSize >= 1.0f*MAX_FAT32_SIZE*TB))
|
||||
uprintf("FAT32 support is disabled for this device, as it is larger than %.1f TB\n", 1.0f*MAX_FAT32_SIZE);
|
||||
|
||||
if ((SelectedDrive.DiskSize >= 32*MB) && ((!size_check) || (1.0f*SelectedDrive.DiskSize < 1.0f*MAX_FAT32_SIZE*TB))) {
|
||||
if ((SelectedDrive.DiskSize >= 32*MB) && (1.0f*SelectedDrive.DiskSize < 1.0f*MAX_FAT32_SIZE*TB)) {
|
||||
SelectedDrive.ClusterSize[FS_FAT32].Allowed = 0x000001F8;
|
||||
for (i=32; i<=(32*1024); i<<=1) { // 32 MB -> 32 GB
|
||||
if (SelectedDrive.DiskSize < i*MB) {
|
||||
|
@ -561,13 +557,13 @@ static BOOL PopulateProperties(int ComboIndex)
|
|||
HumanReadableSize *= 1024.0;
|
||||
i--;
|
||||
}
|
||||
// If we're beneath the tolerance, round proposed label to an integer, if not, show one decimal point
|
||||
// If we're beneath the tolerance, round proposed label to an integer, if not, show two decimal point
|
||||
if (fabs(HumanReadableSize / ceil(HumanReadableSize) - 1.0) < PROPOSEDLABEL_TOLERANCE) {
|
||||
safe_sprintf(SelectedDrive.proposed_label, sizeof(SelectedDrive.proposed_label),
|
||||
"%0.0f%s", ceil(HumanReadableSize), lmprintf(MSG_020+i));
|
||||
} else {
|
||||
safe_sprintf(SelectedDrive.proposed_label, sizeof(SelectedDrive.proposed_label),
|
||||
"%0.1f%s", HumanReadableSize, lmprintf(MSG_020+i));
|
||||
"%0.2f%s", HumanReadableSize, lmprintf(MSG_020+i));
|
||||
}
|
||||
|
||||
// If no existing label is available and no ISO is selected, propose one according to the size (eg: "256MB", "8GB")
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
#define FS_DEFAULT FS_FAT32
|
||||
#define BADBLOCK_PATTERNS {0xaa, 0x55, 0xff, 0x00}
|
||||
#define LARGE_FAT32_SIZE (32*1073741824LL) // Size at which we need to use fat32format
|
||||
#define MAX_FAT32_SIZE 1.0f // Threshold above which we disable FAT32 formatting (in TB)
|
||||
#define MAX_FAT32_SIZE 2.0f // Threshold above which we disable FAT32 formatting (in TB)
|
||||
#define WHITE RGB(255,255,255)
|
||||
#define SEPARATOR_GREY RGB(223,223,223)
|
||||
#define RUFUS_URL "http://rufus.akeo.ie"
|
||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -30,7 +30,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
|||
IDD_DIALOG DIALOGEX 12, 12, 206, 329
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "Rufus v1.3.4.275"
|
||||
CAPTION "Rufus v1.3.4.278"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
|
||||
|
@ -278,8 +278,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,3,4,275
|
||||
PRODUCTVERSION 1,3,4,275
|
||||
FILEVERSION 1,3,4,278
|
||||
PRODUCTVERSION 1,3,4,278
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -296,13 +296,13 @@ BEGIN
|
|||
BEGIN
|
||||
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
||||
VALUE "FileDescription", "Rufus"
|
||||
VALUE "FileVersion", "1.3.4.275"
|
||||
VALUE "FileVersion", "1.3.4.278"
|
||||
VALUE "InternalName", "Rufus"
|
||||
VALUE "LegalCopyright", "© 2011-2013 Pete Batard (GPL v3)"
|
||||
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
||||
VALUE "OriginalFilename", "rufus.exe"
|
||||
VALUE "ProductName", "Rufus"
|
||||
VALUE "ProductVersion", "1.3.4.275"
|
||||
VALUE "ProductVersion", "1.3.4.278"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
Loading…
Reference in a new issue