Skip to content

Commit

Permalink
Use modules relative path (#13774)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansjfw committed Oct 12, 2021
1 parent 4803180 commit 65e5b40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/common/Microsoft.PowerToys.Common.UI/SettingsDeepLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using System.Diagnostics;
using System.IO;

namespace Microsoft.PowerToys.Common.UI
{
Expand Down Expand Up @@ -61,7 +62,9 @@ public static void OpenSettings(SettingsWindow window)
{
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
Expand Down

0 comments on commit 65e5b40

Please sign in to comment.