Repository: godotengine/godot (language: cpp)

Issue:
Can't export project in self-contained mode
### Tested versions

Regression from #100150

### System information

W10

### Issue description

When using portable mode (the `._sc_` thing), exporting project results in:
```
  ERROR: Couldn't save project.binary at 'C:/godot_source/bin/editor_data/temp/tmpproject.binary'.
  ERROR: Can't open file from path 'C:/godot_source/bin/editor_data/temp/tmpproject.binary'.
  ERROR: Cannot remove non-existent file or directory: 'C:/godot_source/bin/editor_data/temp/tmpproject.binary'.
  ERROR: C:\godot_source\editor\export\editor_export_platform.h:241 - Save ZIP: Failed to move temporary file "C:/godot_source/bin/editor_data/temp/packtmp" to "C:/Program Files/Godot/BugReports/Repro/.export/project.zip".
```
Although after further testing, seems like temp folder is missing for some reason and it's not created automatically. I didn't test if it's a problem in non-portable mode (it would happen with a clean Godot installation).

### Steps to reproduce

1. Enable [self-contained mode](https://docs.godotengine.org/en/stable/tutorials/io/data_paths.html#doc-data-paths-self-contained-mode)
2. Export project
3. The exported files are not created

### Minimal reproduction project (MRP)

N/A


Discussion / hints:

Fix patch:
diff --git a/editor/editor_paths.cpp b/editor/editor_paths.cpp
index 8e9df68f3b70..cd17559ac3dc 100644
--- a/editor/editor_paths.cpp
+++ b/editor/editor_paths.cpp
@@ -237,6 +237,17 @@ EditorPaths::EditorPaths() {
 		}
 	}
 
+	// Temporary dir.
+	{
+		if (dir->change_dir(temp_dir) != OK) {
+			dir->make_dir_recursive(temp_dir);
+			if (dir->change_dir(temp_dir) != OK) {
+				ERR_PRINT("Could not create editor temporary directory: " + temp_dir);
+				paths_valid = false;
+			}
+		}
+	}
+
 	// Validate or create project-specific editor data dir,
 	// including shader cache subdir.
 	if (Engine::get_singleton()->is_project_manager_hint() || (Main::is_cmdline_tool() && !ProjectSettings::get_singleton()->is_project_loaded())) {


Test patch: