如何最好地使用 UWP FullTrustProcessLauncher 启动单独的 Unity 游戏 [英] How Best to Use UWP FullTrustProcessLauncher to Launch Seperate Unity Game

查看:18
本文介绍了如何最好地使用 UWP FullTrustProcessLauncher 启动单独的 Unity 游戏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为一个客户工作,他想要一个 UWP 门户应用程序和一个可以从门户应用程序内部启动的 Pac-Man 克隆游戏.我在 UWP 应用程序中设置了 FullTrustProcessLauncher 功能来处理游戏的 exe 启动.我还必须添加一个构建后项目,以将 exe 和随附的数据文件夹复制到构建的 AppX 文件夹中.FullTrustProcessLauncher 可以很好地触发 exe,但我不断收到未找到数据文件夹错误".

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".

所以我的问题是:1. 为什么老是说文件夹不见了,但是就在旁边?2. 有没有更好的方法来做到这一点?

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?

完全公开,这是我创建的第一个应用程序,也是我在 StackOverflow 上的第一篇文章.

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

  • 我将 Unity 项目的构建选项设置为 .NET 2.0,但这并不能解决问题
  • 我已将 Pac-Man 文件夹添加到我的 Visual Studio,但必须执行 XCOPY 以使其可访问

我希望 Pac-Man 应用程序能够像导航到文件夹并启动 exe 一样启动

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

推荐答案

将您的 EXE(和任何所需的支持文件)作为内容"添加到您的 UWP 项目中.确保将它们设置为复制到输出".然后在 appxmanifest 中声明 FullTrustProcess 扩展以指向包含的 EXE,并使用 FullTrustProcessLauncher API 从 UWP 启动它.

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.

这里有更多信息:
https://docs.microsoft.com/en-us/uwp/api/windows.applicationmodel.fulltrustprocesslauncherhttps://stefanwick.com/2018/04/06/uwp-with-desktop-extension-part-1/

这篇关于如何最好地使用 UWP FullTrustProcessLauncher 启动单独的 Unity 游戏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆