Skip to content

Free, open-source Windows optimization tool for performance, privacy, and simplicity.

Fix missing tracking for SystemProtectionHelper

itsfatducka4179eb8f938
diff --git a/optimizerDuck/src/Core/Helpers/SystemHelper.cs b/optimizerDuck/src/Core/Helpers/SystemHelper.cs
index 1808ee2..b9aaead 100644
--- a/optimizerDuck/src/Core/Helpers/SystemHelper.cs
+++ b/optimizerDuck/src/Core/Helpers/SystemHelper.cs
@@ -72,8 +72,6 @@ public static class SystemHelper
Log.LogWarning("Path not excluded: {RootPath}", Defaults.RootPath);
missingPaths.Add(Defaults.RootPath);
}
-
- // return missing path
return missingPaths;
}
diff --git a/optimizerDuck/src/Core/Helpers/SystemProtectionHelper.cs b/optimizerDuck/src/Core/Helpers/SystemProtectionHelper.cs
index d396d6b..067e495 100644
--- a/optimizerDuck/src/Core/Helpers/SystemProtectionHelper.cs
+++ b/optimizerDuck/src/Core/Helpers/SystemProtectionHelper.cs
@@ -12,7 +12,9 @@ public static class SystemProtectionHelper
public static bool Enable()
{
+ using var tracker = ServiceTracker.Begin();
Log.LogInformation("Enabling System Protection...");
+
var result = ShellService.PowerShell("Enable-ComputerRestore -Drive \"$env:SystemDrive\"");
if (result.ExitCode != 0)
{
@@ -33,7 +35,9 @@ public static class SystemProtectionHelper
public static void Create()
{
+ using var tracker = ServiceTracker.Begin();
Log.LogInformation("Creating a restore point...");
+
var result =
ShellService.PowerShell(
$"Checkpoint-Computer -Description \"{Defaults.RestorePointName}\" -RestorePointType MODIFY_SETTINGS");
@@ -49,9 +53,8 @@ public static class SystemProtectionHelper
new PromptOption("Skip", Theme.Error));
}
else
- {
Log.LogInformation(
$"[{Theme.Success}]A restore point [{Theme.Primary}]{Defaults.RestorePointName}[/] created successfully.[/]");
- }
+
}
}
\ No newline at end of file