How Best to Use UWP FullTrustProcessLauncher to Launch Seperate Unity Game

偶尔善良 提交于 2021-01-29 06:40:51

问题


I am working for a client who wants a UWP Portal App and a Pac-Man clone game that can be launched from inside the Portal App. I set up the FullTrustProcessLauncher capability in the UWP App to handle launch the exe for the game. I also had to add a post-build item to copy the exe and accompanying data folder to the AppX folder of the build. The FullTrustProcessLauncher fires the exe fine, but I keep getting the "Data folder not found error".

So my questions are this: 1. Why does it keep saying the folder is missing, but it would be right next to it? 2. Is there a better way to do this?

In full disclosure, this is my first app I've created and my first post on StackOverflow.

  • I have the Build options of the Unity project set to .NET 2.0, but that doesn't fix the issue
  • I have added the Pac-Man folder to my Visual Studio, but had to do the XCOPY so it was accessible

I want the Pac-Man app to launch like it would from navigating to the folder and launching the exe


回答1:


Include your EXE (and any required supporting files) as "Content" to your UWP project. Make sure you set them up as "Copy to output". Then you declare the FullTrustProcess extension in the appxmanifest to point at your included EXE, and use the FullTrustProcessLauncher API to launch it from the UWP.

Some more info here:
https://docs.microsoft.com/en-us/uwp/api/windows.applicationmodel.fulltrustprocesslauncher https://stefanwick.com/2018/04/06/uwp-with-desktop-extension-part-1/



来源:https://stackoverflow.com/questions/55908493/how-best-to-use-uwp-fulltrustprocesslauncher-to-launch-seperate-unity-game

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!