exporting_for_uwp.rst 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. .. _doc_exporting_for_uwp:
  2. Exporting for Universal Windows Platform
  3. ========================================
  4. .. seealso::
  5. This page describes how to export a Godot project to UWP.
  6. If you're looking to compile export template binaries from source instead,
  7. read :ref:`doc_compiling_for_uwp`.
  8. There's no extra requirement to export an ``.appx`` package that can be
  9. installed as a Windows App or submitted to the Windows Store. Exporting UWP
  10. packages also works from any platform, not only from Windows.
  11. However, if you want to install and run the app, you need to sign it with a
  12. trusted signature. Godot supports automatic signing of packages with
  13. external tools.
  14. Also, make sure the Publisher Name you set when exporting the package matches
  15. the name used on the certificate.
  16. Limitations on Xbox One
  17. -----------------------
  18. As described in the `UWP documentation <https://docs.microsoft.com/en-us/windows/uwp/xbox-apps/system-resource-allocation>`__:
  19. - Submitted as an "App"
  20. - available memory is 1GB
  21. - share of 2-4 CPU cores
  22. - shared access of GPU power (45%)
  23. - Submitted as a "Game" (through `Xbox Live Creators Program <https://www.xbox.com/en-US/developers/creators-program>`__)
  24. - available memory is 5GB
  25. - 4 exclusive CPU cores and 2 shared CPU cores
  26. - exclusive access to GPU power (100%)
  27. - Exceeding these memory limitations will cause allocation failures and the application will crash.
  28. Creating a signing certificate
  29. ------------------------------
  30. This requires the ``MakeCert.exe`` and ``Pvk2Pfx.exe`` tools, which come with
  31. the Windows SDK. If you use Visual Studio, you can open one of its Developer
  32. Prompts, since it comes with these tools and they can be located in the path.
  33. You can get more detailed instructions from `Microsoft's documentation
  34. <https://msdn.microsoft.com/en-us/library/windows/desktop/jj835832(v=vs.85).aspx>`__.
  35. First, run ``MakeCert`` to create a private key::
  36. MakeCert /n publisherName /r /h 0 /eku "1.3.6.1.5.5.7.3.3,1.3.6.1.4.1.311.10.3.13" /e expirationDate /sv MyKey.pvk MyKey.cer
  37. Where ``publisherName`` matches the Publisher Name of your package and
  38. ``expirationDate`` is in the ``mm/dd/yyyy`` format.
  39. Next, create a Personal Information Exchange (.pfx) file using ``Pvk2Pfx.exe``::
  40. Pvk2Pfx /pvk MyKey.pvk /pi pvkPassword /spc MyKey.cer /pfx MyKey.pfx [/po pfxPassword]
  41. If you don't specify a password with ``/po`` argument, the PFX will have the
  42. same password as the private key.
  43. You will also need to trust this certificate in order to be able to install your
  44. app. Open the Command Prompt as Administrator and run the following command::
  45. Certutil -addStore TrustedPeople MyKey.cer
  46. Setting up automatic signing
  47. ----------------------------
  48. To setup automatic signing on export you need to go to Editor Settings > Export > Uwp.
  49. From there you need to click on the folder for ``Signtool``, and navigate to
  50. the ``SignTool.exe`` file on your computer.
  51. .. image:: img/UWP_sign_tool.png
  52. After setting that up close the editor settings, go to Project > Export,
  53. and select the UWP preset. Under the ``Signing`` options click on the folder
  54. next to ``Certificate`` and go to the certificate file. Then enter the
  55. pfxPassword in the password field.
  56. .. image:: img/UWP_export_signing.png
  57. Your project will now be automatically signed on export.
  58. If you want to sign an exported app manually run ``SignTool.exe`` and use the
  59. following command.
  60. SignTool sign /fd SHA256 /a /f MyKey.pfx /p pfxPassword package.appx
  61. Installing the package
  62. ----------------------
  63. As of the Windows 10 Anniversary Update, you are able to install packages simply by
  64. double clicking the ``.appx`` file from Windows Explorer.
  65. It's also possible to install by using the ``Add-AppxPackage`` PowerShell cmdlet.
  66. .. note:: If you want to update your already installed app, you must
  67. update the version number on the new package or first uninstall
  68. the previous package.