Skip to content

Conversation

@progray
Copy link

@progray progray commented Nov 28, 2025

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant