From 65e5b402233937264e44b63bf05e85058a3ec3b3 Mon Sep 17 00:00:00 2001 From: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com> Date: Tue, 12 Oct 2021 14:03:36 +0200 Subject: [PATCH] Use modules relative path (#13774) --- src/common/Microsoft.PowerToys.Common.UI/SettingsDeepLink.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/Microsoft.PowerToys.Common.UI/SettingsDeepLink.cs b/src/common/Microsoft.PowerToys.Common.UI/SettingsDeepLink.cs index 383ea3124..c5054ba7d 100644 --- a/src/common/Microsoft.PowerToys.Common.UI/SettingsDeepLink.cs +++ b/src/common/Microsoft.PowerToys.Common.UI/SettingsDeepLink.cs @@ -4,6 +4,7 @@ using System; using System.Diagnostics; +using System.IO; namespace Microsoft.PowerToys.Common.UI { @@ -61,7 +62,9 @@ namespace Microsoft.PowerToys.Common.UI { try { - Process.Start(new ProcessStartInfo(Environment.CurrentDirectory + "\\PowerToys.exe") { Arguments = "--open-settings=" + SettingsWindowNameToString(window) }); + var assemblyPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); + var fullPath = Directory.GetParent(assemblyPath).FullName; + Process.Start(new ProcessStartInfo(fullPath + "\\..\\PowerToys.exe") { Arguments = "--open-settings=" + SettingsWindowNameToString(window) }); } #pragma warning disable CA1031 // Do not catch general exception types catch