Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

Exportation pour Windows

Voir aussi

Cette page explique comment exporter un projet Godot vers Windows. Si vous cherchez à compiler l’éditeur ou à exporter les binaires des modèles depuis le code source, voyez plutôt Compilation pour Windows.

La façon la plus simple de distribuer un jeu pour PC est de copier l'exécutable (godot.exe), de compresser le dossier et de l'envoyer à quelqu'un d'autre. Cependant, cela n'est souvent pas souhaité.

Godot propose une approche plus élégante pour la distribution sur PC en utilisant le système d'exportation. Lors de l'exportation pour Windows, l'exportateur prend tous les fichiers du projet et crée un fichier data.pck. Ce fichier est empaqueté à l'aide d'un binaire spécialement optimisé, plus petit, plus rapide et ne contenant ni éditeur ni débogueur.

Code signing

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.

Avertissement

Si vous exportez pour Windows avec des fichiers PCK intégrés, vous ne pourrez pas signer le programme car il se cassera.

Sous Windows, l'incorporation de PCK est également connue pour provoquer des faux positifs dans les programmes antivirus. Par conséquent, il est recommandé d'éviter de l'utiliser, sauf si vous distribuez votre projet via Steam, car il contourne la signature du code et les contrôles antivirus.

Configuration

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.

../../_images/windows_editor_settings.png

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.

../../_images/windows_export_codesign.png

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.

Variables d'environnement

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.

Windows export environment variables

Export option

Environment variable

Encryption / Encryption Key

GODOT_SCRIPT_ENCRYPTION_KEY

Options / Codesign / Identity Type

GODOT_WINDOWS_CODESIGN_IDENTITY_TYPE

Options / Codesign / Identity

GODOT_WINDOWS_CODESIGN_IDENTITY

Options / Codesign / Password

GODOT_WINDOWS_CODESIGN_PASSWORD