From 45b2d28c8461ba30249db11906a9bf00e7ef5616 Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Thu, 11 Jan 2024 00:18:51 +0900 Subject: [PATCH] Fix: Fixed issue where pinned applications were executed in %windir%\System32 (#14420) --- src/Files.App/Utils/Shell/LaunchHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Files.App/Utils/Shell/LaunchHelper.cs b/src/Files.App/Utils/Shell/LaunchHelper.cs index 6a0bd68db118..1dedd486d036 100644 --- a/src/Files.App/Utils/Shell/LaunchHelper.cs +++ b/src/Files.App/Utils/Shell/LaunchHelper.cs @@ -106,7 +106,7 @@ private static async Task HandleApplicationLaunch(string application, stri Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.User)); } - process.StartInfo.WorkingDirectory = workingDirectory; + process.StartInfo.WorkingDirectory = string.IsNullOrEmpty(workingDirectory) ? PathNormalization.GetParentDir(application) : workingDirectory; process.Start(); Win32API.BringToForeground(currentWindows); @@ -120,7 +120,7 @@ private static async Task HandleApplicationLaunch(string application, stri process.StartInfo.FileName = application; process.StartInfo.CreateNoWindow = true; process.StartInfo.Arguments = arguments; - process.StartInfo.WorkingDirectory = workingDirectory; + process.StartInfo.WorkingDirectory = string.IsNullOrEmpty(workingDirectory) ? PathNormalization.GetParentDir(application) : workingDirectory; try {