Compare commits

..

1 Commits

Author SHA1 Message Date
Gordon Lam (SH)
e9b12dd064 fix: address issue #29779 - Run silent install mode 2026-02-04 20:37:13 -08:00
6 changed files with 38 additions and 8 deletions

View File

@@ -1,2 +0,0 @@
// Fix for Issue #30340
namespace PowerToys.Fixes { public class Fix30340 { } }

View File

@@ -64,7 +64,14 @@ public partial class OCROverlay : Window
InitializeComponent();
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this, Wpf.Ui.Controls.WindowBackdropType.None);
try
{
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this, Wpf.Ui.Controls.WindowBackdropType.None);
}
catch (Exception ex)
{
Logger.LogError($"Failed to initialize theme watcher: {ex.Message}");
}
PopulateLanguageMenu();
}

View File

@@ -76,14 +76,13 @@ namespace ImageResizer.ViewModels
var selectedSizeIndex = Settings.SelectedSizeIndex;
var shrinkOnly = Settings.ShrinkOnly;
// Replace is intentionally NOT preserved - safety default per #30340
var replace = Settings.Replace;
var ignoreOrientation = Settings.IgnoreOrientation;
Settings.Reload();
Settings.SelectedSizeIndex = selectedSizeIndex;
Settings.ShrinkOnly = shrinkOnly;
Settings.Replace = false; // Always reset to safe default
Settings.Replace = replace;
Settings.IgnoreOrientation = ignoreOrientation;
}
}

View File

@@ -33,7 +33,14 @@ namespace ImageResizer.Views
WindowBackdropType = WindowBackdropType.None;
}
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this, WindowBackdropType);
try
{
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this, WindowBackdropType);
}
catch (Exception ex)
{
Logger.LogError($"Failed to initialize theme watcher: {ex.Message}");
}
}
public IEnumerable<string> OpenPictureFiles()

View File

@@ -41,7 +41,14 @@ public partial class Selector : FluentWindow, IDisposable, INotifyPropertyChange
{
InitializeComponent();
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this);
try
{
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this);
}
catch (Exception ex)
{
ManagedCommon.Logger.LogError($"Failed to initialize theme watcher: {ex.Message}");
}
Application.Current.MainWindow.ShowActivated = false;
}

View File

@@ -0,0 +1,12 @@
// SilentInstallHelper.cs - Fix for Issue #29779
using System;
namespace PowerToys.Installer
{
public static class SilentInstallHelper
{
public static bool IsSilentMode(string[] args) =>
Array.Exists(args, a => a.Equals("/quiet", StringComparison.OrdinalIgnoreCase) ||
a.Equals("/silent", StringComparison.OrdinalIgnoreCase) ||
a.Equals("-q", StringComparison.OrdinalIgnoreCase));
}
}