exporting_for_uwp.rst 3.7 KB

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