mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-23 11:17:03 -04:00
[core] disable file indexing by default
* File indexing is too much of an annoyance on removable drives anyway and this should help with perf and access issues * Alt-Q cheat mode is now changed to re-enable file indexing * Also fix a rogue 'else' in the code
This commit is contained in:
parent
2c7e7030a3
commit
7221dee4d1
4 changed files with 19 additions and 19 deletions
13
src/format.c
13
src/format.c
|
@ -61,7 +61,7 @@ static int task_number = 0;
|
|||
extern const int nb_steps[FS_MAX];
|
||||
extern uint32_t dur_mins, dur_secs;
|
||||
static int fs_index = 0, wintogo_index = -1;
|
||||
extern BOOL force_large_fat32, enable_ntfs_compression, lock_drive, zero_drive, disable_file_indexing, write_as_image;
|
||||
extern BOOL force_large_fat32, enable_ntfs_compression, lock_drive, zero_drive, enable_file_indexing, write_as_image;
|
||||
uint8_t *grub2_buf = NULL;
|
||||
long grub2_len;
|
||||
static BOOL WritePBR(HANDLE hLogicalDrive);
|
||||
|
@ -1911,13 +1911,12 @@ DWORD WINAPI FormatThread(void* param)
|
|||
}
|
||||
CHECK_FOR_USER_CANCEL;
|
||||
|
||||
// Disable file indexing if the option was selected by the user
|
||||
if ((disable_file_indexing) && ((fs == FS_NTFS) || (fs == FS_UDF) || (fs == FS_REFS))) {
|
||||
if (SetFileAttributesA(guid_volume, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED))
|
||||
uprintf("File indexing has been set to: Disabled");
|
||||
else
|
||||
// Disable file indexing, unless it was force-enabled by the user
|
||||
if ((!enable_file_indexing) && ((fs == FS_NTFS) || (fs == FS_UDF) || (fs == FS_REFS))) {
|
||||
uprintf("Disabling file indexing...");
|
||||
if (!SetFileAttributesA(guid_volume, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED))
|
||||
uprintf("Could not disable file indexing: %s", WindowsErrorString());
|
||||
} else
|
||||
}
|
||||
|
||||
// Refresh the drive label - This is needed as Windows may have altered it from
|
||||
// the name we proposed, and we require an exact label, to patch config files.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue