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

[ui] always use fake units for proposed labels

* Also improve log messages
This commit is contained in:
Pete Batard 2020-11-03 12:49:08 +00:00
parent 65a0c2c42d
commit e8c717c394
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
5 changed files with 15 additions and 14 deletions

View file

@ -165,7 +165,8 @@ static HANDLE GetHandle(char* Path, BOOL bLockDrive, BOOL bWriteAccess, BOOL bWr
if ((GetLastError() != ERROR_SHARING_VIOLATION) && (GetLastError() != ERROR_ACCESS_DENIED)) if ((GetLastError() != ERROR_SHARING_VIOLATION) && (GetLastError() != ERROR_ACCESS_DENIED))
break; break;
if (i == 0) { if (i == 0) {
uprintf("Waiting for access on %s [%s]...", Path, DevPath); uprintf("Notice: Volume Device Path is %s", DevPath);
uprintf("Waiting for access on %s...", Path);
} else if (!bWriteShare && (i > DRIVE_ACCESS_RETRIES/3)) { } else if (!bWriteShare && (i > DRIVE_ACCESS_RETRIES/3)) {
// If we can't seem to get a hold of the drive for some time, try to enable FILE_SHARE_WRITE... // If we can't seem to get a hold of the drive for some time, try to enable FILE_SHARE_WRITE...
uprintf("Warning: Could not obtain exclusive rights. Retrying with write sharing enabled..."); uprintf("Warning: Could not obtain exclusive rights. Retrying with write sharing enabled...");
@ -1812,7 +1813,7 @@ BOOL MountVolume(char* drive_name, char *volume_name)
uprintf("%s is mounted, but volume GUID doesn't match:\r\n expected %s, got %s", uprintf("%s is mounted, but volume GUID doesn't match:\r\n expected %s, got %s",
drive_name, volume_name, mounted_guid); drive_name, volume_name, mounted_guid);
} else { } else {
uprintf("%s is already mounted as %C:", volume_name, drive_name[0]); duprintf("%s is already mounted as %C:", volume_name, drive_name[0]);
return TRUE; return TRUE;
} }
uprintf("Retrying after dismount..."); uprintf("Retrying after dismount...");
@ -1888,7 +1889,7 @@ BOOL AltUnmountVolume(const char* drive_name, BOOL bSilent)
* Issue a complete remount of the volume. * Issue a complete remount of the volume.
* Note that drive_name *may* be altered when the volume gets remounted. * Note that drive_name *may* be altered when the volume gets remounted.
*/ */
BOOL RemountVolume(char* drive_name) BOOL RemountVolume(char* drive_name, BOOL bSilent)
{ {
char volume_name[51]; char volume_name[51];
@ -1896,9 +1897,9 @@ BOOL RemountVolume(char* drive_name)
FlushDrive(drive_name[0]); FlushDrive(drive_name[0]);
if (GetVolumeNameForVolumeMountPointA(drive_name, volume_name, sizeof(volume_name))) { if (GetVolumeNameForVolumeMountPointA(drive_name, volume_name, sizeof(volume_name))) {
if (MountVolume(drive_name, volume_name)) { if (MountVolume(drive_name, volume_name)) {
uprintf("Successfully remounted %s as %C:", volume_name, drive_name[0]); suprintf("Successfully remounted %s as %C:", volume_name, drive_name[0]);
} else { } else {
uprintf("Could not remount %s as %C: %s", volume_name, drive_name[0], WindowsErrorString()); suprintf("Could not remount %s as %C: %s", volume_name, drive_name[0], WindowsErrorString());
// This will leave the drive inaccessible and must be flagged as an error // This will leave the drive inaccessible and must be flagged as an error
FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_CANT_REMOUNT_VOLUME); FormatStatus = ERROR_SEVERITY_ERROR|FAC(FACILITY_STORAGE)|APPERR(ERROR_CANT_REMOUNT_VOLUME);
return FALSE; return FALSE;

View file

@ -395,7 +395,7 @@ BOOL UnmountVolume(HANDLE hDrive);
BOOL MountVolume(char* drive_name, char *drive_guid); BOOL MountVolume(char* drive_name, char *drive_guid);
BOOL AltUnmountVolume(const char* drive_name, BOOL bSilent); BOOL AltUnmountVolume(const char* drive_name, BOOL bSilent);
char* AltMountVolume(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bSilent); char* AltMountVolume(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bSilent);
BOOL RemountVolume(char* drive_name); BOOL RemountVolume(char* drive_name, BOOL bSilent);
BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL mbr_uefi_marker, uint8_t extra_partitions); BOOL CreatePartition(HANDLE hDrive, int partition_style, int file_system, BOOL mbr_uefi_marker, uint8_t extra_partitions);
BOOL InitializeDisk(HANDLE hDrive); BOOL InitializeDisk(HANDLE hDrive);
BOOL RefreshDriveLayout(HANDLE hDrive); BOOL RefreshDriveLayout(HANDLE hDrive);

View file

@ -2074,7 +2074,7 @@ DWORD WINAPI FormatThread(void* param)
// We issue a complete remount of the filesystem on account of: // We issue a complete remount of the filesystem on account of:
// - Ensuring the file explorer properly detects that the volume was updated // - Ensuring the file explorer properly detects that the volume was updated
// - Ensuring that an NTFS system will be reparsed so that it becomes bootable // - Ensuring that an NTFS system will be reparsed so that it becomes bootable
if (!RemountVolume(drive_name)) if (!RemountVolume(drive_name, FALSE))
goto out; goto out;
CHECK_FOR_USER_CANCEL; CHECK_FOR_USER_CANCEL;
@ -2149,7 +2149,7 @@ DWORD WINAPI FormatThread(void* param)
if (IsChecked(IDC_EXTENDED_LABEL)) if (IsChecked(IDC_EXTENDED_LABEL))
SetAutorun(drive_name); SetAutorun(drive_name);
// 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); RemountVolume(drive_name, TRUE);
// NTFS fixup (WinPE/AIK images don't seem to boot without an extra checkdisk) // NTFS fixup (WinPE/AIK images don't seem to boot without an extra checkdisk)
if ((boot_type == BT_IMAGE) && (img_report.is_iso) && (fs_type == FS_NTFS)) { if ((boot_type == BT_IMAGE) && (img_report.is_iso) && (fs_type == FS_NTFS)) {
// Try to ensure that all messages from Checkdisk will be in English // Try to ensure that all messages from Checkdisk will be in English

View file

@ -898,7 +898,7 @@ static BOOL PopulateProperties(void)
// Set a proposed label according to the size (eg: "256MB", "8GB") // Set a proposed label according to the size (eg: "256MB", "8GB")
static_sprintf(SelectedDrive.proposed_label, "%s", static_sprintf(SelectedDrive.proposed_label, "%s",
SizeToHumanReadable(SelectedDrive.DiskSize, FALSE, use_fake_units)); SizeToHumanReadable(SelectedDrive.DiskSize, FALSE, TRUE));
// Add a tooltip (with the size of the device in parenthesis) // Add a tooltip (with the size of the device in parenthesis)
device_tooltip = (char*) malloc(safe_strlen(DriveName.String[device_index]) + 32); device_tooltip = (char*) malloc(safe_strlen(DriveName.String[device_index]) + 32);

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326 IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.13.1717" CAPTION "Rufus 3.13.1718"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0 FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -395,8 +395,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,13,1717,0 FILEVERSION 3,13,1718,0
PRODUCTVERSION 3,13,1717,0 PRODUCTVERSION 3,13,1718,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -414,13 +414,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie" VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting" VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus" VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.13.1717" VALUE "FileVersion", "3.13.1718"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-3.13.exe" VALUE "OriginalFilename", "rufus-3.13.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.13.1717" VALUE "ProductVersion", "3.13.1718"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"