UWP/DesktopBridge app - Can't launch fulltrust process

148 Views Asked by At

I have a uwp - desktop bridge app (SyncFolder - a folder sync/copy app) in the Windows Store which delegates copying, scanning folders etc. to a win32 process that is launched from the uwp part as a fulltrust process. As follows:

public static async Task<bool> LaunchWin32ProcessAsync(string groupId = null, string dynamicParameters = null)
{
  try
  {
    if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
    {
      if (dynamicParameters != null)
      {
        Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
        localSettings.Values["Win32DynParms"] = dynamicParameters;
      }
      if (groupId == null)
      {
        await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
      }
      else
      {
        await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync(groupId);
      }
      return true;
    }
  }
  catch (Exception e)
  {
    ConditionalFileLogger.Log($"Win32RequestHelper - Exception: {e.Message}");
  }
  return false;
}

The app is being used by thousands of people and works as it should, but some users (I got 3 reports over the last 2 years), even ones where the app runs successfully for months, occasionally report an error indicating that the full trust process is not launched.

There is a check in the app which looks for an AppService connection to be established by the win32 process. The error indicates that 20s after the launch the win32 process hasn't created the connection. There is also some logging in the win32 process in case the process would run, but there is no entry in the log file (or the log file simple doesn't exist). So I have to assume that windows hasn't launched the process.

Does someone know what could cause Windows not to launch this win32 process?

0

There are 0 best solutions below