optimizer icon indicating copy to clipboard operation
optimizer copied to clipboard

CN.1875084792839892:8317d16c0ed1155690df33c6a3126fdb_6929784fe24155862d2e9e27.69298e36e24155862d2e9e53.69298e3644a3e733aaa06252:Trae CN.T(2025/11/28 19:57:42)feat: implement automatic granular registry backup mechanism

Open progray opened this issue 1 month ago • 0 comments

Summary: Introduced a safety interception layer for registry modifications to prevent data loss. The system now automatically exports the target registry key to a .reg file before applying any tweaks.

Details:

  • Implemented Utilities.BackupRegistryKey: Uses reg.exe export to save the current state of a key to the local Backups directory with sanitized filenames.
  • Added Utilities.SetRegistryValue: A wrapper method that enforces the "backup-then-write" pattern, ensuring no registry value is changed without a prior backup.
  • Refactored OptimizeHelper.cs: Replaced all direct Registry.SetValue calls with the new Utilities.SetRegistryValue wrapper to integrate the backup logic across all performance tweaks.
  • Fixed compilation errors in Utilities.cs regarding missing context and method visibility.

progray avatar Nov 28 '25 13:11 progray