Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Exportieren für Windows
Siehe auch
Diese Seite beschreibt, wie man ein Godot-Projekt nach Windows exportiert. Wenn Sie stattdessen Editor- oder Exportvorlagen-Binärdateien aus dem Quellcode kompilieren möchten, lesen Sie Kompilieren für Windows.
Der einfachste Weg, ein Spiel für den PC zu verbreiten, besteht darin, die ausführbare Datei (godot.exe) zu kopieren, den Ordner zu komprimieren und ihn an jemand anderen zu schicken. Dies ist jedoch oft nicht erwünscht.
Godot bietet einen eleganteren Ansatz für die PC-Verteilung, wenn das Exportsystem verwendet wird. Beim Export für Windows nimmt der Exporter alle Projektdateien und erstellt eine Datei data.pck. Diese Datei ist mit einer speziell optimierten Binärdatei gebündelt, die kleiner und schneller ist und den Editor und Debugger nicht enthält.
Architektur
There are 3 different processor architectures that exported Godot projects can run on in Windows:
x86_64
x86_32
arm64
The default is x86_64, this is the most common architecture of PC processors today. All modern Intel and AMD processors as of writing this are x86_64.
x86_32 will give you a 32bit executable that can run on 32bit-only versions of Windows as well as modern versions which are 64bit. It is not recommended to use this option unless you are trying to get your project to run on an old 32bit version of Windows. And it should be noted that no 32bit versions of Windows receive Microsoft support anymore.
arm64 processors are modern but less common than x86_64, and run Windows on ARM. Snapdragon X Elite is an example of a modern Windows ARM processor. Using this export option will allow your project to run natively on arm processors without Microsoft's Prism emulator. Executables made using this option will not run on regular Windows with an x86_64 processor. If you're uploading your project to a platform that allows multiple executables, such as itch.io, and are confident a Snapdragon X Elite processor is powerful enough to run it, we would recommend providing an ARM version. Prism emulation is far from perfect, and Godot does not require you to build or design your game in any special way to run on ARM.
Changing the executable icon
Godot will automatically use whatever image is set as your project's icon in the project settings, and convert it to an ICO file for the exported project. If you want to manually create an ICO file for greater control over how the icon looks at different resolutions then see the Manually changing application icon for Windows page.
PCK embedding
PCK embedding is only supported on executables up to ~3.89 GB in size. This metric includes both the executable and embedded PCK size, so in practice, the PCK file may only weigh up to ~3.75 GB. This can also vary depending on build options when using a custom export template.
Code-Signierung
Godot is capable of automatic code signing on export. To do this you must have the
Windows SDK (on Windows) or osslsigncode
(on any other OS) installed. You will also need a package signing certificate,
information on creating one can be found here.
Einrichtung
Die Einstellungen müssen an zwei Stellen geändert werden. Erstens in den Editoreinstellungen unter Export > Windows. Klicken Sie auf den Ordner neben der Einstellung Sign Tool. Wenn Sie Windows verwenden, navigieren Sie zu SignTool.exe und wählen Sie es aus, wenn Sie ein anderes Betriebssystem verwenden, wählen Sie osslsigncode.
Der zweite Ort ist das Windows-Exportprofil, die Sie unter Projekt > Exportieren... finden können. Fügen Sie eom Windows-Desktop-Profil hinzu, wenn Sie dies noch nicht getan haben. Unter Optionen gibt es eine Kategorie für Code Signing.
Aktiviert muss auf "true" gesetzt werden, und Identität muss auf das Signierzertifikat gesetzt werden. Die anderen Einstellungen können nach Bedarf angepasst werden. Sobald dies erledigt ist, wird Godot Ihr Projekt beim Export signieren.
Umgebungsvariablen
Sie können die folgenden Umgebungsvariablen verwenden, um Exportoptionen außerhalb des Editors festzulegen. Während des Exportvorgangs überschreiben diese die Werte, die Sie im Exportmenü festgelegt haben.
Export-Option |
Umgebungsvariable |
|---|---|
Verschlüsselung / Verschlüsselungsschlüssel |
|
Optionen / Codesign / Identitätstyp |
|
Optionen / Codesign / Identität |
|
Optionen / Codesign / Passwort |
|
Exportoptionen
You can find a full list of export options available in the EditorExportPlatformWindows class reference.