Skip to content

Commit 1a41758

Browse files
committed
[iso] fix a situation where no file system might be proposed in ISO mode
* The Nutanix phoenix.x86_64-fnd_5.6.1_patch-aos_6.8.1_ga.iso contains a GRUB bootloader that somehow stripped the 'fshelp' source string from the fat module, and therefore prevents Rufus from detecting that FAT32 support is available. * As a result, since NTFS is also not supported, no file system able to be selected by the user for ISO mode, and the media creation process fails with "Could Not Partition Drive". * Fix this by only disabling FAT32 in ISO mode if NTFS is available, and producing a warning in the log if we have to forcefully enable FAT32 even if we didn't detect FAT32 compatibility. * Closes #2769. * Also add the setup wrapper binaries produced from previous commit and harmonise the casing of WARNING messages.
1 parent 3bbdd66 commit 1a41758

File tree

19 files changed

+57
-53
lines changed

19 files changed

+57
-53
lines changed

res/setup/readme.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ and can be validated to not have been tampered through SHA-256 validation (Since
3333
produce SHA-256 hashes during the build process per:
3434
https://github.com/pbatard/rufus/blob/master/.github/workflows/setup.yml).
3535

36-
Per the https://github.com/pbatard/rufus/actions/runs/15539519674 GitHub Actions
36+
Per the https://github.com/pbatard/rufus/actions/runs/16191913388 GitHub Actions
3737
workflow run, the SHA-256 for the executables (before signature was applied) were:
38-
* bea9a68e73b53820ea9c3fcdda70b1615f7453ad483dd3aa06e0385fd28f004e *./setup_x64.exe
39-
* f024aed61b1f215a3b684bbb2fd176893fc61f92243708a0d9334671df1cdb61 *./setup_arm64.exe
38+
* f8e1c7c5f1297be7a76d73567d4d82f61bb20c2e5c86d2a2f8d2e5961751d658 *./setup_x64.exe
39+
* e6ff77b859231cc58c872c7b14ce9def73244641e487bbb074d3a759bdfcbc8d *./setup_arm64.exe
4040

4141
You will also find the VirusTotal reports for the current signed executable at:
42-
* https://www.virustotal.com/gui/file/41037f63f20f5984e5ca1dab12c033d795966e80bd8b76a39c1dc42a3dc33594/detection
43-
* https://www.virustotal.com/gui/file/cc9cb4f4080db352d9a82ef926fc290d62a8d67a45a5557f46fa924a7b9bdbe3/detection
42+
* https://www.virustotal.com/gui/file/11df838dc69378187e1e1aaf32d34384157642d07096c6e49c1d0e7375634544/detection
43+
* https://www.virustotal.com/gui/file/14bd07f559513890a0f6565df3927392b4fe6b8e6fc3f5e832e9d69c8b7bb7eb/detection

res/setup/setup_arm64.exe

568 Bytes
Binary file not shown.

res/setup/setup_x64.exe

568 Bytes
Binary file not shown.

src/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ BOOL GetDevices(DWORD devnum)
10151015
}
10161016
num_drives++;
10171017
if (num_drives >= MAX_DRIVES)
1018-
uprintf("Warning: Found more than %d drives - ignoring remaining ones...", MAX_DRIVES);
1018+
uprintf("WARNING: Found more than %d drives - ignoring remaining ones...", MAX_DRIVES);
10191019
safe_free(devint_detail_data);
10201020
break;
10211021
}

src/drive.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static HANDLE GetHandle(char* Path, BOOL bLockDrive, BOOL bWriteAccess, BOOL bWr
166166
uprintf("Waiting for access on %s...", Path);
167167
} else if (!bWriteShare && (i > DRIVE_ACCESS_RETRIES/3)) {
168168
// If we can't seem to get a hold of the drive for some time, try to enable FILE_SHARE_WRITE...
169-
uprintf("Warning: Could not obtain exclusive rights. Retrying with write sharing enabled...");
169+
uprintf("WARNING: Could not obtain exclusive rights. Retrying with write sharing enabled...");
170170
bWriteShare = TRUE;
171171
// Try to report the process that is locking the drive
172172
access_mask = GetProcessSearch(SEARCH_PROCESS_TIMEOUT, 0x07, FALSE);
@@ -362,7 +362,7 @@ char* GetLogicalName(DWORD DriveIndex, uint64_t PartitionOffset, BOOL bKeepTrail
362362
// NB: We need to re-add DRIVE_INDEX_MIN for this call since CheckDriveIndex() subtracted it
363363
ret = AltGetLogicalName(DriveIndex + DRIVE_INDEX_MIN, PartitionOffset, bKeepTrailingBackslash, bSilent);
364364
if ((ret != NULL) && (strchr(ret, ' ') != NULL))
365-
uprintf("Warning: Using physical device to access partition data");
365+
uprintf("WARNING: Using physical device to access partition data");
366366
}
367367

368368
out:
@@ -1148,7 +1148,7 @@ static BOOL _GetDriveLettersAndType(DWORD DriveIndex, char* drive_letters, UINT*
11481148
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL, 3000);
11491149
if (hDrive == INVALID_HANDLE_VALUE) {
11501150
if (GetLastError() == WAIT_TIMEOUT)
1151-
uprintf("Warning: Time-out while trying to query drive %c", toupper(drive[0]));
1151+
uprintf("WARNING: Time-out while trying to query drive %c", toupper(drive[0]));
11521152
continue;
11531153
}
11541154

@@ -1883,7 +1883,7 @@ BOOL GetDrivePartitionData(DWORD DriveIndex, char* FileSystemName, DWORD FileSys
18831883
SelectedDrive.SectorSize = DiskGeometry->Geometry.BytesPerSector;
18841884
SelectedDrive.FirstDataSector = MAXDWORD;
18851885
if (SelectedDrive.SectorSize < 512) {
1886-
suprintf("Warning: Drive 0x%02x reports a sector size of %d - Correcting to 512 bytes.",
1886+
suprintf("WARNING: Drive 0x%02x reports a sector size of %d - Correcting to 512 bytes.",
18871887
DriveIndex, SelectedDrive.SectorSize);
18881888
SelectedDrive.SectorSize = 512;
18891889
}
@@ -2126,7 +2126,7 @@ BOOL MountVolume(char* drive_name, char *volume_name)
21262126
}
21272127
uprintf("Retrying after dismount...");
21282128
if (!DeleteVolumeMountPointA(drive_name))
2129-
uprintf("Warning: Could not delete volume mountpoint '%s': %s", drive_name, WindowsErrorString());
2129+
uprintf("WARNING: Could not delete volume mountpoint '%s': %s", drive_name, WindowsErrorString());
21302130
if (SetVolumeMountPointA(drive_name, volume_name))
21312131
return TRUE;
21322132
if ((GetLastError() == ERROR_DIR_NOT_EMPTY) &&

src/format.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSi
745745
}
746746
liFilePointer.QuadPart = 0ULL;
747747
if (!SetFilePointerEx(hPhysicalDrive, liFilePointer, &liFilePointer, FILE_BEGIN) || (liFilePointer.QuadPart != 0ULL))
748-
uprintf("Warning: Could not reset disk position");
748+
uprintf("WARNING: Could not reset disk position");
749749
if (!WriteFileWithRetry(hPhysicalDrive, pZeroBuf, (DWORD)(SectorSize * num_sectors_to_clear), NULL, WRITE_RETRIES))
750750
goto out;
751751
CHECK_FOR_USER_CANCEL;
@@ -807,15 +807,15 @@ static BOOL WriteMBR(HANDLE hPhysicalDrive)
807807
if (buffer[0x1c2] == 0x0e) {
808808
uprintf("Partition is already FAT16 LBA...");
809809
} else if ((buffer[0x1c2] != 0x04) && (buffer[0x1c2] != 0x06)) {
810-
uprintf("Warning: converting a non FAT16 partition to FAT16 LBA: FS type=0x%02x", buffer[0x1c2]);
810+
uprintf("WARNING: converting a non FAT16 partition to FAT16 LBA: FS type=0x%02x", buffer[0x1c2]);
811811
}
812812
buffer[0x1c2] = 0x0e;
813813
break;
814814
case FS_FAT32:
815815
if (buffer[0x1c2] == 0x0c) {
816816
uprintf("Partition is already FAT32 LBA...");
817817
} else if (buffer[0x1c2] != 0x0b) {
818-
uprintf("Warning: converting a non FAT32 partition to FAT32 LBA: FS type=0x%02x", buffer[0x1c2]);
818+
uprintf("WARNING: converting a non FAT32 partition to FAT32 LBA: FS type=0x%02x", buffer[0x1c2]);
819819
}
820820
buffer[0x1c2] = 0x0c;
821821
break;
@@ -1170,7 +1170,7 @@ static BOOL WriteDrive(HANDLE hPhysicalDrive, BOOL bZeroDrive)
11701170
// We poked the MBR and other stuff, so we need to rewind
11711171
li.QuadPart = 0;
11721172
if (!SetFilePointerEx(hPhysicalDrive, li, NULL, FILE_BEGIN))
1173-
uprintf("Warning: Unable to rewind image position - wrong data might be copied!");
1173+
uprintf("WARNING: Unable to rewind image position - wrong data might be copied!");
11741174
UpdateProgressWithInfoInit(NULL, FALSE);
11751175

11761176
if (bZeroDrive) {
@@ -1532,7 +1532,7 @@ DWORD WINAPI FormatThread(void* param)
15321532
safe_unlockclose(hPhysicalDrive);
15331533
PrintInfo(0, MSG_239, lmprintf(MSG_307));
15341534
if (!is_vds_available || !DeletePartition(DriveIndex, 0, TRUE)) {
1535-
uprintf("Warning: Could not delete partition(s): %s", is_vds_available ? WindowsErrorString() : "VDS is not available");
1535+
uprintf("WARNING: Could not delete partition(s): %s", is_vds_available ? WindowsErrorString() : "VDS is not available");
15361536
SetLastError(ErrorStatus);
15371537
ErrorStatus = 0;
15381538
// If we couldn't delete partitions, Windows give us trouble unless we
@@ -1845,7 +1845,7 @@ DWORD WINAPI FormatThread(void* param)
18451845
// the name we proposed, and we require an exact label, to patch config files.
18461846
if ((fs_type < FS_EXT2) && !GetVolumeInformationU(drive_name, img_report.usb_label,
18471847
ARRAYSIZE(img_report.usb_label), NULL, NULL, NULL, NULL, 0)) {
1848-
uprintf("Warning: Failed to refresh label: %s", WindowsErrorString());
1848+
uprintf("WARNING: Failed to refresh label: %s", WindowsErrorString());
18491849
} else if (IS_EXT(fs_type)) {
18501850
const char* ext_label = GetExtFsLabel(DriveIndex, 0);
18511851
if (ext_label != NULL)
@@ -1944,7 +1944,7 @@ DWORD WINAPI FormatThread(void* param)
19441944
uprintf("Installing: %s (KolibriOS loader)", kolibri_dst);
19451945
if (ExtractISOFile(image_path, "HD_Load/USB_Boot/MTLD_F32", kolibri_dst,
19461946
FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM) == 0) {
1947-
uprintf("Warning: loader installation failed - KolibriOS will not boot!");
1947+
uprintf("WARNING: Loader installation failed - KolibriOS will not boot!");
19481948
}
19491949
}
19501950
// EFI mode selected, with no 'boot###.efi' but Windows 7 x64's 'bootmgr.efi' (bit #0)
@@ -2004,7 +2004,7 @@ DWORD WINAPI FormatThread(void* param)
20042004
UpdateProgress(OP_EXTRACT_ZIP, 0.0f);
20052005
drive_name[2] = 0;
20062006
if (archive_path != NULL && fs_type < FS_EXT2 && !ExtractZip(archive_path, drive_name) && !IS_ERROR(ErrorStatus))
2007-
uprintf("Warning: Could not copy additional files");
2007+
uprintf("WARNING: Could not copy additional files");
20082008
}
20092009

20102010
out:

src/iso.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,7 +2031,7 @@ static DWORD WINAPI OpticalDiscSaveImageThread(void* param)
20312031
// In case someone poked the disc before us
20322032
li.QuadPart = 0;
20332033
if (!SetFilePointerEx(hPhysicalDrive, li, NULL, FILE_BEGIN))
2034-
uprintf("Warning: Unable to rewind device position - wrong data might be copied!");
2034+
uprintf("WARNING: Unable to rewind device position - wrong data might be copied!");
20352035
hDestImage = CreateFileU(img_save->ImagePath, GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
20362036
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
20372037
if (hDestImage == INVALID_HANDLE_VALUE) {
@@ -2058,7 +2058,7 @@ static DWORD WINAPI OpticalDiscSaveImageThread(void* param)
20582058
// Optical drives do not appear to increment the sectors to read automatically
20592059
li.QuadPart = wb;
20602060
if (!SetFilePointerEx(hPhysicalDrive, li, NULL, FILE_BEGIN))
2061-
uprintf("Warning: Unable to set device position - wrong data might be copied!");
2061+
uprintf("WARNING: Unable to set device position - wrong data might be copied!");
20622062
s = ReadFile(hPhysicalDrive, buffer,
20632063
(DWORD)MIN(img_save->BufSize, img_save->DeviceSize - wb), &rSize, NULL);
20642064
if (!s) {

src/ms-sys/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int64_t write_sectors(HANDLE hDrive, uint64_t SectorSize,
5959
{
6060
/* Some large drives return 0, even though all the data was written - See github #787 */
6161
if (large_drive && Size == 0) {
62-
uprintf("Warning: Possible short write\n");
62+
uprintf("WARNING: Possible short write\n");
6363
return 0;
6464
}
6565
uprintf("write_sectors: Write error\n");

src/msapi_utf8.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,8 @@ static __inline BOOL GetTextExtentPointU(HDC hdc, const char* lpString, LPSIZE l
644644
return ret;
645645
}
646646

647-
// A UTF-8 alternative to MS GetCurrentDirectory() since the latter is useless for
648-
// apps installed from the App Store...
649-
static __inline DWORD GetCurrentDirectoryU(DWORD nBufferLength, char* lpBuffer)
647+
// Gets the directory where the executable resises, through GetModuleFileName()
648+
static __inline DWORD GetAppDirectoryU(DWORD nBufferLength, char* lpBuffer)
650649
{
651650
DWORD i, ret = 0, err = ERROR_INVALID_DATA;
652651
// coverity[returned_null]

src/net.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ static void CheckForDBXUpdates(int verbose)
514514
WriteSetting64(reg_name, timestamp);
515515
uprintf("Saved %s as 'dbx_%s.bin'", dbx_info[i].url, efi_archname[i + 1]);
516516
} else
517-
uprintf("Warning: Failed to download %s", dbx_info[i].url);
517+
uprintf("WARNING: Failed to download %s", dbx_info[i].url);
518518
}
519519
}
520520

0 commit comments

Comments
 (0)