發佈至 Microsoft StorePublishing to the Microsoft Store

當您準備好要對外發佈您的 Unreal 應用程式時,在提交至 Microsoft Store 之前,必須先更新幾項專案設定。When you're ready to get your Unreal app out to the world, there are a few project settings that need updating before you submit to the Microsoft Store. 這些設定全都有預設值,但應針對生產環境加以變更,讓應用程式獲得最佳展現。All of these settings have default values, but should be changed for production to best represent the application.

市集封裝的專案設定Project settings for the store packaging

  1. 首先,選取 [專案設定] > [說明],並更新遊戲和發行者資訊:First, select Project Settings > Description and update the game and publisher information:
    • [遊戲名稱] 會出現在 HoloLens 上的應用程式磚中The Game Name will appear in the app tile on the HoloLens
    • 產生專案憑證時會使用 [公司辨別名稱],而其格式應為:The Company Distinguished Name is used when generating the project certificate and should be in the format:
      • CN=CommonName, O=OrganizationName, L=LocalityName, S=StateOrProvinceName, C=CountryNameCN=CommonName, O=OrganizationName, L=LocalityName, S=StateOrProvinceName, C=CountryName:

Unreal 編輯器的螢幕擷取畫面,其中已展開專案設定中的 [說明] 區段

  1. 展開專案設定的 [HoloLens] 區段,並更新封裝資源。Expand the HoloLens section of the project settings and update the packaging resources. 應用程式的市集頁面上會顯示下列資源名稱:These resource names will be shown on the application’s store page:

Unreal 編輯器的螢幕擷取畫面,其中已展開專案設定中的 [封裝] 區段

  1. 展開 [影像] 區段,並以顯示商店應用程式的材質來更新預設市集影像。Expand the Images section and update the default store images with textures that represent the store app. 選擇性地選取 [3D 標誌] 核取方塊,以上傳在啟動應用程式時作為 3D 即時立方體的 glb 檔案:Optionally, select the 3D Logo checkbox to upload a glb file to use as a 3D live cube when launching the application:

Unreal 編輯器的螢幕擷取畫面,其中已展開專案設定中的 [影像] 區段

  1. 最後,選取 [產生新的],以從專案名稱和公司辨別名稱產生簽署憑證Lastly, select Generate New to generate a signing certificate from the project name and company distinguished name
    • 設定 [磚背景色彩],此色彩會顯示在商店影像中任何透明像素的位置上。Set a Tile Background Color, which will appear in place of any transparent pixels in the store images.
    • 展開下拉式清單,並啟用 [使用零售 Windows Store 環境],使其在零售鎖定 (而非開發解除鎖定) 的裝置上執行。Expand the dropdown and enable Use Retail Windows Store Environment to run on retail-locked, not dev-unlocked, devices.

Unreal 編輯器的螢幕擷取畫面,其中已展開專案設定中的 [憑證產生] 區段

選用應用程式安裝Optional App Installer

您可以從 [專案設定] > [HoloLens] 建立應用程式安裝程式檔案,用來在市集以外散發應用程式。An App Installer file can be created from Project Settings > HoloLens, which can be used to distribute the application outside of the store. 啟用 [應建立應用程式安裝程式] 核取方塊,並設定要用來儲存遊戲 appxbundle 的 URL 或網路路徑。Enable the Should Create App Installer checkbox and set a URL or network path where you'd like the game’s appxbundle to be stored.

Unreal 編輯器的螢幕擷取畫面,其中已展開專案設定中的 [應用程式安裝程式] 區段

封裝應用程式時,將會產生 appxbundle 和 appinstaller。When the app is being packaged, both the appxbundle and appinstaller will be generated. 將 appxbundle 上傳至安裝 URL,然後啟動 appinstaller 以從網路位置安裝應用程式。Upload the appxbundle to the installation URL, then launch the appinstaller to install the app from the network location.

Windows 應用程式認證套件Windows App Certification Kit

Windows 10 SDK 隨附 Windows 應用程式認證套件 (WACK),用以驗證可能影響到套件上傳至市集的常見問題。The Windows 10 SDK ships with the Windows App Certification Kit (WACK) to validate common issues that could affect uploading a package to the store. 您可以在 Windows Kits 目錄中找到 WACK,通常位於下列路徑下:You can find the WACK in the Windows Kits directory, usually under the following path:

C:\Program Files (x86)\Windows Kits\10\App Certification Kit.
  1. 將 appx 檔案封裝以供發佈後,請執行 appcertui.exe,並依照提示對 appx 進行掃描:After your appx file is packaged for publication, run appcertui.exe and follow the prompts to scan the appx:

此螢幕擷取畫面顯示 Windows 應用程式認證套件中經選取要驗證的應用程式

  1. 選取 [驗證市集應用程式]:Select Validate Store App:

在 Windows 應用程式認證套件中選取驗證項目的螢幕擷取畫面

  1. 瀏覽頂端區段中的 appx,然後選取 [下一步]:Browse for the appx in the top section and select Next:

在 Windows 應用程式認證套件中選取測試項目的螢幕擷取畫面

  1. 選取 [下一步] 以執行測試並建立報表:Select Next to run the tests and create a report:
    • 依預設會啟用可在主機電腦上執行的所有測試All available tests that can be run on the host PC will be enabled by default

Windows 應用程式認證套件中的應用程式驗證進度的螢幕擷取畫面

  1. 等候測試完成。Wait for the tests to finish. 完成後,最後一個視窗會顯示通過或失敗的結果,您可以在儲存的報表中檢視該結果。Once complete, the final window will show a pass or fail result, which can be viewed in the saved report.

Windows 應用程式認證套件中的最終報表結果的螢幕擷取畫面

4.25 的已知 WACK 失敗Known WACK failure with 4.25

Unreal 4.25 中的 Windows Mixed Reality 外掛程式將無法通過 WACK,因為在封裝 HoloLens 時,其中包含了一些 x64 二進位檔。The Windows Mixed Reality plugin in Unreal 4.25 will fail WACK because some x64 binaries are included while packaging for HoloLens. 失敗的情形顯示如下:The failure will look like this:

在 Windows 應用程式認證套件中,由於二進位分析器和支援的 API 而導致失敗結果的螢幕擷取畫面

若要修正此問題:To fix the issue:

  1. 開啟 Unreal 專案,以瀏覽至 Unreal 安裝或來源目錄的根目錄,並以滑鼠右鍵按一下工作列中的 Unreal 圖示。Browse to the Unreal installation or source directory root by opening an Unreal project and right-click on the Unreal icon in the taskbar.
  2. 以滑鼠右鍵按一下 UE4Editor,選取 [屬性],然後瀏覽至 [位置] 項目中的路徑:Right-click on UE4Editor, select properties, and browse to the path in the Location entry:
Open Engine\Plugins\Runtime\WindowsMixedReality\Source\WindowsMixedRealityHMD\WindowsMixedRealityHMD.Build.cs.
  1. WindowsMixedRealityHMD.Build.cs 中,將 第 32行 從:In WindowsMixedRealityHMD.Build.cs, modify line 32 from:
if(Target.Platform != UnrealTargetPlatform.Win32)

變更為:to:

if(Target.Platform == UnrealTargetPlatform.Win64)

  1. 關閉 Unreal、重新開啟專案,然後重新封裝 HoloLens。Close Unreal, reopen the project, and repackage for HoloLens. 重新執行 WACK,此錯誤就會消失。Rerun WACK and the error will be gone.

另請參閱See also