Skip to content

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

fix: remove access denied ShellFeedsTaskbarViewMode key

itsfatduck0fae688fa6bf
diff --git a/optimizerDuck/Core/Optimizers/UserExperience.cs b/optimizerDuck/Core/Optimizers/UserExperience.cs
index e509128..9ceee14 100644
--- a/optimizerDuck/Core/Optimizers/UserExperience.cs
+++ b/optimizerDuck/Core/Optimizers/UserExperience.cs
@@ -29,9 +29,7 @@ public class UserExperience : IOptimizationCategory
{
RegistryService.Write(
new RegistryItem(@"HKLM\SOFTWARE\Policies\Microsoft\Dsh", "AllowNewsAndInterests", 0),
- new RegistryItem(@"HKCU\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds", "EnableFeeds", 0),
- new RegistryItem(@"HKCU\Software\Microsoft\Windows\CurrentVersion\Feeds",
- "ShellFeedsTaskbarViewMode", 2)
+ new RegistryItem(@"HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds", "EnableFeeds", 0)
);
context.Logger.LogInformation("Disabled taskbar news and interests");
return Task.FromResult(ApplyResult.True());
diff --git a/optimizerDuck/Resources/Languages/Translations.Designer.cs b/optimizerDuck/Resources/Languages/Translations.Designer.cs
index a403cb0..6e45963 100644
--- a/optimizerDuck/Resources/Languages/Translations.Designer.cs
+++ b/optimizerDuck/Resources/Languages/Translations.Designer.cs
@@ -952,7 +952,7 @@ namespace optimizerDuck.Resources.Languages {
}
/// <summary>
- /// Looks up a localized string similar to User temporary files created by applications.
+ /// Looks up a localized string similar to User temporary files created by applications (excluding the .net temp directory).
/// </summary>
internal static string DiskCleanup_Item_TempFiles_Description {
get {
@@ -1078,7 +1078,7 @@ namespace optimizerDuck.Resources.Languages {
}
/// <summary>
- /// Looks up a localized string similar to Couldn&apos;t apply optimization..
+ /// Looks up a localized string similar to Couldn&apos;t fully apply optimization.
/// </summary>
internal static string Optimization_Apply_Snackbar_Error_Title {
get {
@@ -1086,6 +1086,15 @@ namespace optimizerDuck.Resources.Languages {
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Optimization applied successfully.
+ /// </summary>
+ internal static string Optimization_Apply_Snackbar_Success_Title {
+ get {
+ return ResourceManager.GetString("Optimization.Apply.Snackbar.Success.Title", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to Successfully applied {0}..
/// </summary>
@@ -1140,15 +1149,6 @@ namespace optimizerDuck.Resources.Languages {
}
}
- /// <summary>
- /// Looks up a localized string similar to Revert step #{0}.
- /// </summary>
- internal static string Optimization_Revert_StepDescription {
- get {
- return ResourceManager.GetString("Optimization.Revert.StepDescription", resourceCulture);
- }
- }
-
/// <summary>
/// Looks up a localized string similar to Reverting....
/// </summary>
@@ -1168,20 +1168,20 @@ namespace optimizerDuck.Resources.Languages {
}
/// <summary>
- /// Looks up a localized string similar to Optimization applied successfully.
+ /// Looks up a localized string similar to Optimization reverted successfully.
/// </summary>
- internal static string Optimization_Apply_Snackbar_Success_Title {
+ internal static string Optimization_Revert_Snackbar_Success_Title {
get {
- return ResourceManager.GetString("Optimization.Apply.Snackbar.Success.Title", resourceCulture);
+ return ResourceManager.GetString("Optimization.Revert.Snackbar.Success.Title", resourceCulture);
}
}
/// <summary>
- /// Looks up a localized string similar to Optimization reverted successfully.
+ /// Looks up a localized string similar to Revert step #{0}.
/// </summary>
- internal static string Optimization_Revert_Snackbar_Success_Title {
+ internal static string Optimization_Revert_StepDescription {
get {
- return ResourceManager.GetString("Optimization.Revert.Snackbar.Success.Title", resourceCulture);
+ return ResourceManager.GetString("Optimization.Revert.StepDescription", resourceCulture);
}
}
@@ -2683,15 +2683,6 @@ namespace optimizerDuck.Resources.Languages {
}
}
- /// <summary>
- /// Looks up a localized string similar to Revert step failed.
- /// </summary>
- internal static string Revert_Error_StepFailed {
- get {
- return ResourceManager.GetString("Revert.Error.StepFailed", resourceCulture);
- }
- }
-
/// <summary>
/// Looks up a localized string similar to No revert data found for {0}..
/// </summary>
@@ -2737,6 +2728,69 @@ namespace optimizerDuck.Resources.Languages {
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Revert step failed.
+ /// </summary>
+ internal static string Revert_Error_StepFailed {
+ get {
+ return ResourceManager.GetString("Revert.Error.StepFailed", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Delete registry value: {0}\{1}.
+ /// </summary>
+ internal static string Revert_Registry_Description_Delete {
+ get {
+ return ResourceManager.GetString("Revert.Registry.Description.Delete", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Restore registry value: {0}\{1}.
+ /// </summary>
+ internal static string Revert_Registry_Description_Restore {
+ get {
+ return ResourceManager.GetString("Revert.Registry.Description.Restore", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Disable scheduled task: {0}.
+ /// </summary>
+ internal static string Revert_ScheduledTask_Description_Disable {
+ get {
+ return ResourceManager.GetString("Revert.ScheduledTask.Description.Disable", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Enable scheduled task: {0}.
+ /// </summary>
+ internal static string Revert_ScheduledTask_Description_Enable {
+ get {
+ return ResourceManager.GetString("Revert.ScheduledTask.Description.Enable", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Restore service &apos;{0}&apos; to {1} startup.
+ /// </summary>
+ internal static string Revert_Service_Description_Restore {
+ get {
+ return ResourceManager.GetString("Revert.Service.Description.Restore", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Run {0} command: {1}.
+ /// </summary>
+ internal static string Revert_Shell_Description_Run {
+ get {
+ return ResourceManager.GetString("Revert.Shell.Description.Run", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to Delete.
/// </summary>
@@ -3097,6 +3151,24 @@ namespace optimizerDuck.Resources.Languages {
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Registry.
+ /// </summary>
+ internal static string Service_Registry_Name {
+ get {
+ return ResourceManager.GetString("Service.Registry.Name", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Scheduled Task.
+ /// </summary>
+ internal static string Service_ScheduledTask_Name {
+ get {
+ return ResourceManager.GetString("Service.ScheduledTask.Name", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to ChangeStartMode failed (code: {0}).
/// </summary>
@@ -3133,6 +3205,15 @@ namespace optimizerDuck.Resources.Languages {
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Service.
+ /// </summary>
+ internal static string Service_Service_Name {
+ get {
+ return ResourceManager.GetString("Service.Service.Name", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to Exit code {0}.
/// </summary>
@@ -3151,6 +3232,15 @@ namespace optimizerDuck.Resources.Languages {
}
}
+ /// <summary>
+ /// Looks up a localized string similar to Shell.
+ /// </summary>
+ internal static string Service_Shell_Name {
+ get {
+ return ResourceManager.GetString("Service.Shell.Name", resourceCulture);
+ }
+ }
+
/// <summary>
/// Looks up a localized string similar to optimizerDuck is made possible by the following open-source software and resources..
/// </summary>
@@ -3700,95 +3790,5 @@ namespace optimizerDuck.Resources.Languages {
return ResourceManager.GetString("StartupManager.Tasks.Title", resourceCulture);
}
}
-
- /// <summary>
- /// Looks up a localized string similar to Registry.
- /// </summary>
- internal static string Service_Registry_Name {
- get {
- return ResourceManager.GetString("Service.Registry.Name", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Service.
- /// </summary>
- internal static string Service_Service_Name {
- get {
- return ResourceManager.GetString("Service.Service.Name", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Scheduled Task.
- /// </summary>
- internal static string Service_ScheduledTask_Name {
- get {
- return ResourceManager.GetString("Service.ScheduledTask.Name", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Shell.
- /// </summary>
- internal static string Service_Shell_Name {
- get {
- return ResourceManager.GetString("Service.Shell.Name", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Restore registry value: {0}\{1}.
- /// </summary>
- internal static string Revert_Registry_Description_Restore {
- get {
- return ResourceManager.GetString("Revert.Registry.Description.Restore", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Delete registry value: {0}\{1}.
- /// </summary>
- internal static string Revert_Registry_Description_Delete {
- get {
- return ResourceManager.GetString("Revert.Registry.Description.Delete", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Restore service &apos;{0}&apos; to {1} startup.
- /// </summary>
- internal static string Revert_Service_Description_Restore {
- get {
- return ResourceManager.GetString("Revert.Service.Description.Restore", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Enable scheduled task: {0}.
- /// </summary>
- internal static string Revert_ScheduledTask_Description_Enable {
- get {
- return ResourceManager.GetString("Revert.ScheduledTask.Description.Enable", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Disable scheduled task: {0}.
- /// </summary>
- internal static string Revert_ScheduledTask_Description_Disable {
- get {
- return ResourceManager.GetString("Revert.ScheduledTask.Description.Disable", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Run {0} command: {1}.
- /// </summary>
- internal static string Revert_Shell_Description_Run {
- get {
- return ResourceManager.GetString("Revert.Shell.Description.Run", resourceCulture);
- }
- }
}
}
diff --git a/optimizerDuck/Resources/Languages/Translations.resx b/optimizerDuck/Resources/Languages/Translations.resx
index 6947fe6..db4c6cd 100644
--- a/optimizerDuck/Resources/Languages/Translations.resx
+++ b/optimizerDuck/Resources/Languages/Translations.resx
@@ -490,8 +490,8 @@ Current version: {0}</value>
<value>Just applied</value>
</data>
<data name="Optimization.Apply.Snackbar.Error.Title" xml:space="preserve">
- <value>Couldn't apply optimization.</value>
- </data>
+ <value>Couldn't fully apply optimization</value>
+ </data>
<data name="Optimization.Revert.Snackbar.Error.Title" xml:space="preserve">
<value>Couldn't revert optimization</value>
</data>
diff --git a/optimizerDuck/Resources/Languages/Translations.vi-VN.resx b/optimizerDuck/Resources/Languages/Translations.vi-VN.resx
index 16225cc..85c7e2e 100644
--- a/optimizerDuck/Resources/Languages/Translations.vi-VN.resx
+++ b/optimizerDuck/Resources/Languages/Translations.vi-VN.resx
@@ -488,8 +488,8 @@ Phiên bản hiện tại: {0} </value>
<value>Vừa áp dụng</value>
</data>
<data name="Optimization.Apply.Snackbar.Error.Title" xml:space="preserve">
- <value>Đã xảy ra lỗi sau khi áp dụng.</value>
- </data>
+ <value>Đã xảy ra lỗi sau khi áp dụng</value>
+ </data>
<data name="Optimization.Revert.Snackbar.Error.Title" xml:space="preserve">
<value>Đã xảy ra lỗi sau khi hoàn tác</value>
</data>
diff --git a/optimizerDuck/UI/ViewModels/Optimizer/OptimizationCategoryViewModel.cs b/optimizerDuck/UI/ViewModels/Optimizer/OptimizationCategoryViewModel.cs
index 5248df5..901d00a 100644
--- a/optimizerDuck/UI/ViewModels/Optimizer/OptimizationCategoryViewModel.cs
+++ b/optimizerDuck/UI/ViewModels/Optimizer/OptimizationCategoryViewModel.cs
@@ -272,14 +272,18 @@ public partial class OptimizationCategoryViewModel : ViewModel
/// <param name="message">The message to show.</param>
/// <param name="optimizationName">The name of the optimization.</param>
private void ShowOutcomeSnackbar(bool succeeded, bool partial, bool failed, string operationType,
- string message, string optimizationName)
+ string message, string optimizationName, bool restorePointCreated = false)
{
+ var finalMessage = message;
+ if (restorePointCreated)
+ finalMessage += "\n" + string.Format(Translations.RestorePoint_Snackbar_Success_Message, Shared.RestorePointName);
+
if (succeeded)
_snackbarService.Show(
operationType == "apply"
? Translations.Optimization_Apply_Snackbar_Success_Title
: Translations.Optimization_Revert_Snackbar_Success_Title,
- message,
+ finalMessage,
ControlAppearance.Success,
new SymbolIcon { Symbol = SymbolRegular.CheckmarkCircle24, Filled = true },
TimeSpan.FromSeconds(5));
@@ -288,7 +292,7 @@ public partial class OptimizationCategoryViewModel : ViewModel
operationType == "apply"
? Translations.Optimization_Apply_Snackbar_Error_Title
: Translations.Optimization_Revert_Snackbar_Error_Title,
- message,
+ finalMessage,
ControlAppearance.Caution,
new SymbolIcon { Symbol = SymbolRegular.Warning24, Filled = true },
TimeSpan.FromSeconds(5));
@@ -297,7 +301,7 @@ public partial class OptimizationCategoryViewModel : ViewModel
operationType == "apply"
? Translations.Optimization_Apply_Snackbar_Error_Title
: Translations.Optimization_Revert_Snackbar_Error_Title,
- message,
+ finalMessage,
ControlAppearance.Danger,
new SymbolIcon { Symbol = SymbolRegular.ErrorCircle24, Filled = true },
TimeSpan.FromSeconds(5));
@@ -307,7 +311,7 @@ public partial class OptimizationCategoryViewModel : ViewModel
/// Handles the restore point dialog.
/// </summary>
/// <returns>Whether the user accepted the restore point dialog.</returns>
- private async Task<bool> HandleRestorePointAsync()
+ private async Task<(bool Proceed, bool RestorePointCreated)> HandleRestorePointAsync()
{
var dialogContent = new RestorePointDialog();
var dialog = new ContentDialog
@@ -322,23 +326,18 @@ public partial class OptimizationCategoryViewModel : ViewModel
var result = await _contentDialogService.ShowAsync(dialog, CancellationToken.None);
if (result == ContentDialogResult.None) // User cancelled
- return false;
+ return (false, false);
if (result == ContentDialogResult.Secondary) // User skipped
- return true;
+ return (true, false);
var resultState = await _optimizationService.CreateRestorePointAsync();
+ var restorePointCreated = false;
switch (resultState)
{
case RestorePointResult.Success:
- _snackbarService.Show(
- Translations.RestorePoint_Snackbar_Success_Title,
- string.Format(Translations.RestorePoint_Snackbar_Success_Message, Shared.RestorePointName),
- ControlAppearance.Success,
- new SymbolIcon { Symbol = SymbolRegular.CheckmarkCircle24, Filled = true },
- TimeSpan.FromSeconds(5)
- );
+ restorePointCreated = true;
break;
case RestorePointResult.FrequencyLimitReached:
@@ -363,7 +362,7 @@ public partial class OptimizationCategoryViewModel : ViewModel
break;
}
- return true;
+ return (true, restorePointCreated);
}
/// <summary>
@@ -422,14 +421,17 @@ public partial class OptimizationCategoryViewModel : ViewModel
// Keep a stable reference to the previous state in case we need to roll back UI changes.
var wasApplied = await OptimizationService.IsAppliedAsync(optimization.Id);
+ var restorePointCreated = false;
if (!_optimizationService.WasRequestedRestorePoint)
{
- if (!await HandleRestorePointAsync())
+ var (proceed, created) = await HandleRestorePointAsync();
+ if (!proceed)
{
optimization.State.IsApplied = wasApplied;
return;
}
+ restorePointCreated = created;
_optimizationService.WasRequestedRestorePoint = true;
}
@@ -450,7 +452,7 @@ public partial class OptimizationCategoryViewModel : ViewModel
if (applyResult.Status == OptimizationSuccessResult.Failed)
{
ShowOutcomeSnackbar(false, false, true, "apply",
- applyResult.Message, optimization.OptimizationKey);
+ applyResult.Message, optimization.OptimizationKey, restorePointCreated);
_logger.LogWarning("Apply failed for {Name}: {Message}",
optimization.OptimizationKey, applyResult.Message);
@@ -478,7 +480,7 @@ public partial class OptimizationCategoryViewModel : ViewModel
applyResult.Status != OptimizationSuccessResult.Success;
ShowOutcomeSnackbar(succeeded, partial, failed, "apply",
- applyResult.Message, optimization.OptimizationKey);
+ applyResult.Message, optimization.OptimizationKey, restorePointCreated);
if (succeeded)
_logger.LogInformation("Successfully applied {Name}", optimization.OptimizationKey);
@@ -516,7 +518,7 @@ public partial class OptimizationCategoryViewModel : ViewModel
(revertResult.IsCompleteFailure && retryOutcome == RetryOutcome.Skipped);
ShowOutcomeSnackbar(succeeded, partial, failed, "revert",
- revertResult.Message, optimization.OptimizationKey);
+ revertResult.Message, optimization.OptimizationKey, restorePointCreated);
if (succeeded)
_logger.LogInformation("Successfully reverted {Name}", optimization.OptimizationKey);