Skip to content

Commit 3dd42fc

Browse files
author
slobbenmeier
committed
Change to AppServiceConnectionHelper so the Process is started by FilesFullTrust instead
1 parent 4f6aceb commit 3dd42fc

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/Files/ViewModels/NavToolbarViewModel.cs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ public async Task CheckPathInput(string currentInput, string currentSelectedPath
954954
}
955955
}
956956

957-
LaunchApplicationFromPath(currentInput, workingDir);
957+
await LaunchApplicationFromPath(currentInput, workingDir);
958958

959959
try
960960
{
@@ -977,7 +977,7 @@ await DialogDisplayHelper.ShowDialogAsync("InvalidItemDialogTitle".GetLocalized(
977977
}
978978
}
979979

980-
private static void LaunchApplicationFromPath(string currentInput, string workingDir)
980+
private static async Task LaunchApplicationFromPath(string currentInput, string workingDir)
981981
{
982982
var trimmedInput= currentInput.Trim();
983983
var fileName = trimmedInput;
@@ -989,16 +989,18 @@ private static void LaunchApplicationFromPath(string currentInput, string workin
989989
arguments = currentInput.Substring(currentInput.IndexOf(' '));
990990
}
991991

992-
var psi = new ProcessStartInfo
992+
var connection = await AppServiceConnectionHelper.Instance;
993+
if (connection != null)
993994
{
994-
FileName = fileName,
995-
Arguments = arguments,
996-
CreateNoWindow = false,
997-
UseShellExecute = true,
998-
WindowStyle = ProcessWindowStyle.Normal,
999-
WorkingDirectory = workingDir
1000-
};
1001-
Process.Start(psi);
995+
var value = new ValueSet()
996+
{
997+
{ "Arguments", "LaunchApp" },
998+
{ "WorkingDirectory", workingDir },
999+
{ "Application", fileName },
1000+
{ "Parameters", arguments }
1001+
};
1002+
await connection.SendMessageAsync(value);
1003+
}
10021004
}
10031005

10041006
public async void SetAddressBarSuggestions(AutoSuggestBox sender, IShellPage shellpage, int maxSuggestions = 7)

0 commit comments

Comments
 (0)