Exporting game to Windows results in empty and unusable .exe file

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dr-pop

Hello everyone.

I’m trying to export my project(s) to Windows, but Godot only produces an empty (0kb) .exe file (as well as a .pck file). I use the right version of the export templates. The problem appears with all of my projects, including the official Godot tutorial projects (e.g. Dodge the Creeps).

Version information
I am using:

  • Windows 10
  • Godot version 3.2.3
  • Godot export templates version 3.2.3

I’m new to Godot, so after working on my own project for a while I decided to try to export a project for the first time. (This entire bug report applies both to my personal project and to my version of the tutorial game Dodge the Creeps.)

I downloaded and installed (from file) the appropriate export templates (version 3.2.3). Subsequently, in my project, I got to Project > Export… > select Windows Desktop, don’t change any of the default settings > Export Project > choose destination folder and file name.

Expected results
An .exe file in the destination folder that can be run and will play the game.

Actual results
In the destination folder, an .exe file appears that is 0kb large and cannot be run. There is also a .pck file that is has a nonzero size. (I understand the .pck is not the problem.)

Steps to Reproduce

  1. Download my project folder for Dodge the Creeps and import it into Godot.
  2. If necessary, configure the project (screen size, name, main scene) and install the latest export templates (version 3.2.3) from the Godot website.
  3. Go to Project > Export… > select Windows Desktop Runnable > Export Project > Choose destination folder and file name.
  4. Go to the destination folder. You will find an .exe file of 0kb large and a .pck file of 2107kb large. The .exe obviously cannot be run.

Further information
The console gives no information whasoever. Just that it opened the project for editing:

Godot Engine v3.2.3.stable.official - https://godotengine.org OpenGL ES 3.0 Renderer: Intel(R) HD Graphics 515

Editing project: C:/Users/UserName/Documents/5) Creatief/Godot game development/Dodge the Creeps/Project folder (C:::Users::UserName::Documents::5) Creatief::Godot game development::Dodge the Creeps::Project folder) Godot Engine v3.2.3.stable.official - https://godotengine.org OpenGL ES 3.0 Renderer: Intel(R) HD Graphics 515

The same error happens in all of my projects, including:

  • My own project
  • The tutorial project Dodge the Creeps
  • A newly created reduced test case that only consisted of a ColorRect

At first, I also got the following error. However, upon later attempts to reproduce it, it stopped appearing (at least not consistently). Others with the same problem, however, have reported a similar error in the console (see below for other cases):

ERROR: store_buffer: Condition "fwrite(p_src, 1, p_length, f) != (size_t)p_length" is true. 
At: drivers/windows/file_access_windows.cpp:312

In another attempt to fix this, I deleted the Godot executable and the AppData folder. Then I re-downloaded Godot and reconfigured it (resulting in a new AppData folder) but to no avail.

Other cases
I could find only two other cases of people encountering this problem:
Exporting a tutorial project makes an empty .exe file (Mar 14 2018)
Godot error message whle exporting (Jan 11 2020

The above people report the same ‘store_buffer’ error and a 0kb executable. The 2018 post resolved the problem as follows, but he does not specify which directory (and why):

I made this work by deleting an AppData\Godot directory!!!
commented Mar 15, 2018 by Ilya Fedorinov

The second post found out that it was caused by mismatched versions. But that does not apply to my case, AFAIK:

EDIT: after more research, the error means that my template and Godot dont have the same version! What do I do? Im using godot 3.1.1
commented Jan 12 by Anastasia

My guess
I really don’t know, to be honest. But I doubt it has anything to do with my projects. It probably is a problem with the export templates. At first, I thought maybe my PC has run out of storage space, but that’s not the case either (well, 3GB left - not much, but should be enough).

Any advice is very welcome! Thanks in advance.

Try reinstalling the export templates from the editor. Go to Editor->Manage Export Templates, from there you can reinstall.
If this doesn’t work you should go where Godot executable is located and in the same folder create an empty file named “sc” without the “”. What that file does is it’s forcing Godot to save it’s preferences in the same directory like it is a portable application.

ra45 | 2020-11-21 09:10

It worked!

How odd, though. I had removed the Godot program and the Local/AppData folder for Godot before, then reinstalled everything, but that did not help back then. But now, following you advice, I uninstalled the export templates (through the Godot program) and installed them anew, and this time the export functionality works as intended! Hurrah!

I’m not sure why it didn’t work at first and does work now, but I’m very happy it worked out. Thanks a lot @ra45!

dr-pop | 2020-11-23 14:15

Glad I could help

ra45 | 2020-11-23 15:48

Ye thanks a lot, I was having this problem, too with Godot.

afk27111 | 2021-02-04 17:41