CN.1875084792839892:8317d16c0ed1155690df33c6a3126fdb_6929784fe24155862d2e9e27.69298e36e24155862d2e9e53.69298e3644a3e733aaa06252:Trae CN.T(2025/11/28 19:57:42)feat: implement automatic granular registry backup mechanism #627
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Utilities.BackupRegistryKey: Usesreg.exe exportto save the current state of a key to the localBackupsdirectory with sanitized filenames.Utilities.SetRegistryValue: A wrapper method that enforces the "backup-then-write" pattern, ensuring no registry value is changed without a prior backup.OptimizeHelper.cs: Replaced all directRegistry.SetValuecalls with the newUtilities.SetRegistryValuewrapper to integrate the backup logic across all performance tweaks.Utilities.csregarding missing context and method visibility.