Skip to content

Commit

Permalink
Use newer API for FullTrustProcessLauncher on Win11
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxb711 committed Aug 28, 2023
1 parent 8f9bf9b commit dc34669
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion RX_Explorer/Class/AuxiliaryTrustProcessController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,14 @@ private static async Task<AuxiliaryTrustProcessController> CreateAsync()

try
{
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("AuxiliaryTrustProcess");
if (WindowsVersionChecker.IsNewerOrEqual(WindowsVersion.Windows11))
{
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppWithArgumentsAsync("--AuxiliaryTrustProcess");
}
else
{
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("AuxiliaryTrustProcess");
}

if (await Controller.ConnectRemoteAsync())
{
Expand Down
9 changes: 8 additions & 1 deletion RX_Explorer/Class/MonitorTrustProcessController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ public static async Task InitializeAsync()
{
try
{
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("MonitorTrustProcess");
if (WindowsVersionChecker.IsNewerOrEqual(WindowsVersion.Windows11))
{
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppWithArgumentsAsync("--MonitorTrustProcess");
}
else
{
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("MonitorTrustProcess");
}

if (!await ConnectRemoteAsync())
{
Expand Down

0 comments on commit dc34669

Please sign in to comment.