Search code examples
c#uwpdesktop-bridge

What is /invokerPRAID?


I'm making a Universal Windows App designed for entertainment purposes and one of its tasks is to run a locally installed game.

I've done all the configurations of the .appxmanifest to run a fullTrustProcess and placed the .exe in the /Assets folder in order for it to be accessible. But once I try to run the .exe through the App with

await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();

I get this error message: Error! Failed to open InvokerPRAID: with errno 22 It's really strange since it doesn't appear to throw this error with every .exe I try to run. The problem is I don't know what this error means and I can't seem to find information on it anywhere. If anyone can shed some light on the matter I'd be very grateful.


Solution

  • With the FullTrustProcoessLauncher you can only launch an EXE that is in your package, not an arbitrary game on the system. If this is your goal then you can include a simple EXE in your package that you launch via FullTrustProcessLauncher, which will then in turn launch your game (via Process.Start or ShellExecute). See also my blog post on this topic: https://stefanwick.com/2018/04/06/uwp-with-desktop-extension-part-2/

    The "/InvokerPRAID" parameter is passed by FullTrustProcessLauncher to the EXE and indicates the ID of the app that has triggered the launch.

    This ID is specified in the appxmanifest.xml file:

    <Application ID="[PRAID]" ...>
    

    Btw, PRAID stands for "package relative app id".