Skip to content

Commit 70dc1d4

Browse files
authored
Merge pull request godotengine#7720 from Calinou/uwp-non-functional
2 parents 9544325 + 3dda1b3 commit 70dc1d4

File tree

2 files changed

+10
-263
lines changed

2 files changed

+10
-263
lines changed

contributing/development/compiling/compiling_for_uwp.rst

Lines changed: 5 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -3,152 +3,10 @@
33
Compiling for Universal Windows Platform
44
========================================
55

6-
.. highlight:: shell
6+
.. important::
77

8-
.. seealso::
8+
Compiling UWP export templates is not implemented in Godot 4.
9+
Godot 3 has limited UWP support, but there are many
10+
`known issues <https://github.com/godotengine/godot/issues?q=is%3Aopen+is%3Aissue+label%3Aplatform%3Auwp>`__.
911

10-
This page describes how to compile UWP export template binaries from source.
11-
If you're looking to export your project to UWP instead, read :ref:`doc_exporting_for_uwp`.
12-
13-
Requirements
14-
------------
15-
16-
- `Python 3.6+ <https://www.python.org/downloads/windows/>`_.
17-
**Make sure to enable the option to add Python to the ``PATH`` in the installer.**
18-
- `SCons 3.0+ <https://scons.org/pages/download.html>`_ build system. Using the
19-
latest release is recommended, especially for proper support of recent Visual
20-
Studio releases.
21-
- Windows 10 SDK (can be selected in Visual Studio installation).
22-
- `ANGLE source <https://github.com/Microsoft/angle>`__. Use the
23-
``ms_master`` (default) branch. Keep it in a path without spaces to
24-
avoid problems.
25-
26-
.. note:: The ANGLE repo by Microsoft has been discontinued and the
27-
``ms_master`` branch has been cleared out.
28-
29-
As a temporary workaround however, it is still possible to
30-
download an older state of the source code via commit
31-
`c61d048 <https://github.com/microsoft/angle/tree/c61d0488abd9663e0d4d2450db7345baa2c0dfb6>`__.
32-
33-
This page will eventually be updated in the future to reflect
34-
the new build instructions.
35-
36-
.. seealso:: To get the Godot source code for compiling, see
37-
:ref:`doc_getting_source`.
38-
39-
For a general overview of SCons usage for Godot, see
40-
:ref:`doc_introduction_to_the_buildsystem`.
41-
42-
Compiling
43-
---------
44-
45-
You need to open a proper Visual Studio prompt for the target architecture
46-
you want to build. Check :ref:`doc_compiling_for_windows` to see how these
47-
prompts work.
48-
49-
There are three target architectures for UWP: x86 (32-bits), x64 (64-bits)
50-
and ARM (32-bits). For the latter, you can run ``vcvarsall.bat`` with
51-
``x86_arm`` or ``amd64_arm`` as argument to set the environment.
52-
53-
Set the ``ANGLE_SRC_PATH`` to the directory where you downloaded the ANGLE
54-
source code. The build process will also build ANGLE to produce the
55-
required DLLs for the selected architecture.
56-
57-
Once you're set, run the SCons command similarly to the other platforms::
58-
59-
C:\godot>scons platform=uwp
60-
61-
Creating UWP export templates
62-
-----------------------------
63-
64-
To export using the editor you need to properly build package the templates.
65-
You need all three architectures with ``debug`` and ``release`` templates to
66-
be able to export.
67-
68-
Open the command prompt for one architecture and run SCons twice (once for
69-
each target)::
70-
71-
C:\godot>scons platform=uwp target=template_debug
72-
C:\godot>scons platform=uwp target=template_release
73-
74-
Repeat for the other architectures.
75-
76-
In the end your ``bin`` folder will have the ``.exe`` binaries with a name
77-
like ``godot.uwp.opt.debug.32.x86.exe`` (with variations for each
78-
target/arch).
79-
80-
Copy one of these to ``misc/dist/uwp_template`` inside the Godot source
81-
folder and rename the binary to ``godot.uwp.exe``. From the ANGLE source,
82-
under ``winrt/10/src/Release_%arch%`` (where ``%arch%`` can be ``Win32``,
83-
``x64`` or ``ARM``), get the ``libEGL.dll`` and the ``libGLESv2.dll``,
84-
putting them along with the executable.
85-
86-
Add the files in the ``uwp_template`` folder to a ZIP. Rename the resulting
87-
Zip according to the target/architecture of the template::
88-
89-
uwp_x86_debug.zip
90-
uwp_x86_release.zip
91-
uwp_x64_debug.zip
92-
uwp_x64_release.zip
93-
uwp_arm_debug.zip
94-
uwp_arm_release.zip
95-
96-
Move those templates to the ``[versionstring]\templates`` folder in Godot
97-
settings path, where `versionstring` is the version of Godot you have compiled
98-
the export templates for - e.g. `3.0.alpha` for the alpha version of Godot 3.
99-
If you don't want to replace the templates, you can set the "Custom Package"
100-
property in the export window.
101-
102-
Running UWP apps with Visual Studio
103-
-----------------------------------
104-
105-
If you want to debug the UWP port or simply run your apps without packaging
106-
and signing, you can deploy and launch them using Visual Studio. It might be
107-
the easiest way if you are testing on a device such as a Windows Phone or an
108-
Xbox One.
109-
110-
Within the ANGLE source folder, open ``templates`` and double-click the
111-
``install.bat`` script file. This will install the Visual Studio project
112-
templates for ANGLE apps.
113-
114-
If you have not built Godot yet, open the ``winrt/10/src/angle.sln`` solution
115-
from the ANGLE source and build it to Release/Win32 target. You may also need
116-
to build it for ARM if you plan to run on a device. You can also use MSBuild if
117-
you're comfortable with the command line.
118-
119-
Create a new Windows App project using the "App for OpenGL ES
120-
(Windows Universal)" project template, which can be found under the
121-
``Visual C++/Windows/Universal`` category.
122-
123-
This is a base project with the ANGLE dependencies already set up. However, by
124-
default it picks the debug version of the DLLs which usually have poor
125-
performance. So in the "Binaries" filter, click in each of the DLLs there
126-
and in the "Properties" window and change the relative path from
127-
``Debug_Win32`` to ``Release_Win32`` (or ``Release_ARM`` for devices).
128-
129-
In the same "Binaries" filter, select "Add > Existing Item" and point to the
130-
Godot executable for UWP you have. In the "Properties" window, set "Content"
131-
to ``True`` so it's included in the project.
132-
133-
Right-click the ``Package.appxmanifest`` file and select "Open With... > XML
134-
(Text) Editor". In the ``Package/Applications/Application`` element, replace
135-
the ``Executable`` attribute from ``$targetnametoken$.exe`` to
136-
``godot.uwp.exe`` (or whatever your Godot executable is called). Also change
137-
the ``EntryPoint`` attribute to ``GodotUWP.App``. This will ensure that
138-
the Godot executable is correctly called when the app starts.
139-
140-
Create a folder (*not* a filter) called ``game`` in your Visual Studio project
141-
folder and there you can put either a ``data.pck`` file or your Godot project
142-
files. After that, make sure to include it all with the "Add > Existing Item"
143-
command and set their "Content" property to ``True`` so they're copied to the
144-
app.
145-
146-
To ease the workflow, you can open the "Solution Properties" and in the
147-
"Configuration" section untick the "Build" option for the app. You still have
148-
to build it at least once to generate some needed files, you can do so by
149-
right-clicking the project (*not* the solution) in the "Solution Explorer" and
150-
selecting "Build".
151-
152-
Now you can just run the project and your app should open. You can also use
153-
the "Start Without Debugging" option from the "Debug" menu (or press :kbd:`Ctrl + F5`) to make it
154-
launch faster.
12+
We recommend you use the :ref:`Win32 export <doc_exporting_for_windows>` instead.
Lines changed: 5 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,123 +1,12 @@
1-
:article_outdated: True
2-
31
.. _doc_exporting_for_uwp:
42

53
Exporting for Universal Windows Platform
64
========================================
75

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

113-
.. list-table:: UWP export environment variables
114-
:header-rows: 1
8+
Exporting projects to UWP is not implemented in Godot 4.
9+
Godot 3 has limited UWP support, but there are many
10+
`known issues <https://github.com/godotengine/godot/issues?q=is%3Aopen+is%3Aissue+label%3Aplatform%3Auwp>`__.
11511

116-
* - Export option
117-
- Environment variable
118-
* - Encryption / Encryption Key
119-
- GODOT_SCRIPT_ENCRYPTION_KEY
120-
* - Options / Signing / Certificate
121-
- GODOT_UWP_SIGNING_CERTIFICATE
122-
* - Options / Signing / Password
123-
- GODOT_UWP_SIGNING_PASSWORD
12+
We recommend you use the :ref:`Win32 export <doc_exporting_for_windows>` instead.

0 commit comments

Comments
 (0)