发布到 Microsoft Store

若已准备好对外发布你的 Unreal 应用,在将应用提交到 Microsoft Store 之前,需要更新一些项目设置。 所有这些设置都具有默认值,但为了以最佳方式表示应用程序,这些设置应针对生产环境进行更改。

应用商店打包的项目设置

  1. 首先,选择“项目设置”>“说明”,更新游戏和发布者信息
    • 游戏名称将在 HoloLens 上的应用磁贴中显示
    • 在生成项目证书时,会使用公司可分辨名称,该名称应采用以下格式
      • CN=CommonName, O=OrganizationName, L=LocalityName, S=StateOrProvinceName, C=CountryName

Screenshot of Unreal editor with description section expanded in project settings

  1. 展开项目设置的“HoloLens”部分,更新打包资源。 这些资源名称将显示在应用程序的“应用商店”页上:

Screenshot of Unreal editor with packaging section expanded in project settings

  1. 展开“图像”部分,并使用表示应用商店应用的纹理更新默认应用商店图像。 根据需要,选中“3D 徽标”复选框,上传一个 glb 文件,在启动应用程序时将其用作 3D 实时多维数据集

Screenshot of Unreal editor with images section expanded in project settings

  1. 最后,选择“生成新项”,根据项目名称和公司可分辨名称生成一个签名证书
    • 设置一种磁贴背景颜色,这种颜色会显示在应用商店图像中任何透明像素的位置
    • 展开下拉菜单并启用“使用零售 Windows 应用商店环境”,以便在零售锁定的设备(而不是开发解锁的设备)上运行

Screenshot of Unreal editor with certificate generation section expanded in project settings

可选的应用安装程序

可以通过“项目设置”>“HoloLens”创建应用安装程序文件,该文件可用于在应用商店外分发应用程序。 启用“应创建应用安装程序”复选框,并设置要在其中存储游戏的 appxbundle 的 URL 或网络路径

Screenshot of Unreal editor with app installer section expanded in project settings

应用进行打包时,appxbundle 和 appinstaller 将随之生成。 将 appxbundle 上传到安装 URL,然后启动 appinstaller 以从该网络位置安装应用。

Windows 应用认证工具包

Windows 10 SDK 随附 Windows 应用认证工具包 (WACK),用于验证可能影响将包上传到应用商店的常见问题。 可在 Windows Kits 目录中找到 WACK,目录通常位于以下路径下:

C:\Program Files (x86)\Windows Kits\10\App Certification Kit.
  1. 将 appx 文件打包以进行发布后,运行 appcertui.exe 并按照提示扫描 appx

Screenshot of app being selected for validation in windows app certification kit

  1. 选择“验证应用商店应用”

Screenshot of validation selection in windows app certification kit

  1. 在顶部浏览找到 appx,并选择“下一步”

Screenshot of test select in windows app certification kit

  1. 选择“下一步”,运行测试并创建报表
    • 默认情况下,可在主机上运行的所有可用测试都将启用

Screenshot of app validation progress in windows app certification kit

  1. 等待测试完成。 完成后,最终窗口将显示一个指示“通过”或“失败”的结果,可在保存的报表中查看该结果。

Screenshot of final report results in windows app certification kit

4.25 版的已知 WACK 故障

Unreal 4.25 中的 Windows Mixed Reality 插件无法通过 WACK 测试,因为在针对 HoloLens 进行打包时,其中包含一些 x64 二进制文件。 故障如下所示:

Screenshot of a failed result due to binary analyzer and supported APIs from the windows app certification kit

若要解决这一问题,请执行以下操作:

  1. 打开一个 Unreal 项目并右键单击任务栏中的 Unreal 图标,浏览到 Unreal 安装或源目录根。
  2. 右键单击 UE4Editor,选择“属性”,然后浏览到“位置”条目中的路径
Open Engine\Plugins\Runtime\WindowsMixedReality\Source\WindowsMixedRealityHMD\WindowsMixedRealityHMD.Build.cs.
  1. 在 WindowsMixedRealityHMD.Build.cs 中,修改第 32 行
if(Target.Platform != UnrealTargetPlatform.Win32)

更改为:

if(Target.Platform == UnrealTargetPlatform.Win64)

  1. 关闭 Unreal,重新打开该项目,并重新针对 HoloLens 进行打包。 重新运行 WACK,错误将消失。

另请参阅