diff --git a/src/common/Common.UI/Common.UI.csproj b/src/common/Common.UI/Common.UI.csproj index 8d19debc3b43..19fe2f1ee4d2 100644 --- a/src/common/Common.UI/Common.UI.csproj +++ b/src/common/Common.UI/Common.UI.csproj @@ -1,6 +1,7 @@  + true diff --git a/src/common/Common.UI/SettingsDeepLink.cs b/src/common/Common.UI/SettingsDeepLink.cs index 41bd2c012e94..904c631d0aa8 100644 --- a/src/common/Common.UI/SettingsDeepLink.cs +++ b/src/common/Common.UI/SettingsDeepLink.cs @@ -91,20 +91,20 @@ public static void OpenSettings(SettingsWindow window, bool mainExecutableIsOnTh { try { - var assemblyPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); - var fullPath = new DirectoryInfo(assemblyPath).FullName; + var directoryPath = System.AppContext.BaseDirectory; if (mainExecutableIsOnTheParentFolder) { // Need to go into parent folder for PowerToys.exe. Likely a WinUI3 App SDK application. - fullPath = fullPath + "\\..\\PowerToys.exe"; + directoryPath = Path.Combine(directoryPath, ".."); + directoryPath = Path.Combine(directoryPath, "PowerToys.exe"); } else { // PowerToys.exe is in the same path as the application. - fullPath = fullPath + "\\PowerToys.exe"; + directoryPath = Path.Combine(directoryPath, "PowerToys.exe"); } - Process.Start(new ProcessStartInfo(fullPath) { Arguments = "--open-settings=" + SettingsWindowNameToString(window) }); + Process.Start(new ProcessStartInfo(directoryPath) { Arguments = "--open-settings=" + SettingsWindowNameToString(window) }); } catch { diff --git a/src/common/Common.UI/ThemeManager.cs b/src/common/Common.UI/ThemeManager.cs index d30084ef6ec5..fe6e02ad9446 100644 --- a/src/common/Common.UI/ThemeManager.cs +++ b/src/common/Common.UI/ThemeManager.cs @@ -11,7 +11,7 @@ namespace Common.UI { - public class ThemeManager : IDisposable + public partial class ThemeManager : IDisposable { private readonly Application _app; private const string LightTheme = "Light.Accent1";