[SETUPLIB] Don't flag freeldr.ini as read-only during installation.

CORE-19575

For the time being, don't add read-only attribute for ease of testing
and modifying files, but it won't always stay this way.

For example, Windows sets its boot.ini (as well as NTLDR, NTDETECT.COM
etc.) as read-only (+ hidden and system) during its 1st-stage setup.
2nd-stage setup makes some adjustments in boot.ini but doesn't restore
its read-only attribute.
Windows tools that can modify boot.ini (i.e. msconfig.exe, bootcfg.exe,
and sysdm.cpl) **ALL** know how to remove the read-only attribute for
modifying boot.ini, before restoring it if needed.
This commit is contained in:
Hermès Bélusca-Maïto 2024-05-07 19:26:03 +02:00
parent cf9f7548d5
commit a7cbb60ebf
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -860,7 +860,13 @@ CloseIniBootLoaderStore(
/* Re-protect the INI file */
FileAttribs = ProtectAttribs;
/*Status =*/ ProtectFile(BootStore->FileHandle, ProtectAttribs, &FileAttribs);
if (BootStore->Header.Type == FreeLdr)
{
// NOTE: CORE-19575: For the time being, don't add READONLY for ease
// of testing and modifying files, but it won't always stay this way.
FileAttribs &= ~FILE_ATTRIBUTE_READONLY;
}
/*Status =*/ ProtectFile(BootStore->FileHandle, FileAttribs, &FileAttribs);
Status = STATUS_SUCCESS; // Ignore the status and just succeed.
Quit: