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...
Exportando para Windows
Ver também
This page describes how to export a Godot project to Windows. If you're looking to compile editor or export template binaries from source instead, read Compilando para Windows.
A maneira mais simples de distribuir um jogo para PC é copiar o executável (godot.exe), comprimir a pasta e enviá-la para outra pessoa. Entretanto, muitas vezes isto não é desejado.
A Godot oferece uma abordagem mais elegante para a distribuição de PCs ao utilizar o sistema de exportação. Ao exportar para Windows, o exportador pega todos os arquivos do projeto e cria um arquivo data.pck. Este arquivo é empacotado com um binário especialmente otimizado que é menor, mais rápido e não contém o editor e depurador.
Architecture
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.
Assinatura de código
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.
Configurar
Settings need to be changed in two places. First, in the editor settings, under
Export > Windows. Click on the folder next to the Sign Tool setting, if
you're using Windows navigate to and select SignTool.exe, if you're on a different
OS select osslsigncode.
The second location is the Windows export preset, which can be found in Project > Export.... Add a windows desktop preset if you haven't already. Under options there is a code signing category.
Enabled must be set to true, and Identity must be set to the signing
certificate. The other settings can be adjusted as needed. Once this is Done
Godot will sign your project on export.
Variáveis de ambiente
You can use the following environment variables to set export options outside of the editor. During the export process, these override the values that you set in the export menu.
Export option |
Environment variable |
|---|---|
Encryption / Encryption Key |
|
Options / Codesign / Identity Type |
|
Options / Codesign / Identity |
|
Options / Codesign / Password |
|
Opções de exportação
You can find a full list of export options available in the EditorExportPlatformWindows class reference.