|
@@ -192,6 +192,36 @@ Error EditorExportPlatformWindows::export_project(const Ref<EditorExportPreset>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ bool export_as_zip = p_path.ends_with("zip");
|
|
|
|
+ bool embedded = p_preset->get("binary_format/embed_pck");
|
|
|
|
+
|
|
|
|
+ String pkg_name;
|
|
|
|
+ if (String(ProjectSettings::get_singleton()->get("application/config/name")) != "") {
|
|
|
|
+ pkg_name = String(ProjectSettings::get_singleton()->get("application/config/name"));
|
|
|
|
+ } else {
|
|
|
|
+ pkg_name = "Unnamed";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ pkg_name = OS::get_singleton()->get_safe_dir_name(pkg_name);
|
|
|
|
+
|
|
|
|
+ // Setup temp folder.
|
|
|
|
+ String path = p_path;
|
|
|
|
+ String tmp_dir_path = EditorPaths::get_singleton()->get_temp_dir().path_join(pkg_name);
|
|
|
|
+ Ref<DirAccess> tmp_app_dir = DirAccess::create_for_path(tmp_dir_path);
|
|
|
|
+ if (export_as_zip) {
|
|
|
|
+ if (tmp_app_dir.is_null()) {
|
|
|
|
+ add_message(EXPORT_MESSAGE_ERROR, TTR("Prepare Templates"), vformat(TTR("Could not create and open the directory: \"%s\""), tmp_dir_path));
|
|
|
|
+ return ERR_CANT_CREATE;
|
|
|
|
+ }
|
|
|
|
+ if (DirAccess::exists(tmp_dir_path)) {
|
|
|
|
+ if (tmp_app_dir->change_dir(tmp_dir_path) == OK) {
|
|
|
|
+ tmp_app_dir->erase_contents_recursive();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ tmp_app_dir->make_dir_recursive(tmp_dir_path);
|
|
|
|
+ path = tmp_dir_path.path_join(p_path.get_file().get_basename() + ".exe");
|
|
|
|
+ }
|
|
|
|
+
|
|
int export_angle = p_preset->get("application/export_angle");
|
|
int export_angle = p_preset->get("application/export_angle");
|
|
bool include_angle_libs = false;
|
|
bool include_angle_libs = false;
|
|
if (export_angle == 0) {
|
|
if (export_angle == 0) {
|
|
@@ -202,10 +232,10 @@ Error EditorExportPlatformWindows::export_project(const Ref<EditorExportPreset>
|
|
if (include_angle_libs) {
|
|
if (include_angle_libs) {
|
|
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
|
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
|
if (da->file_exists(template_path.get_base_dir().path_join("libEGL." + arch + ".dll"))) {
|
|
if (da->file_exists(template_path.get_base_dir().path_join("libEGL." + arch + ".dll"))) {
|
|
- da->copy(template_path.get_base_dir().path_join("libEGL." + arch + ".dll"), p_path.get_base_dir().path_join("libEGL.dll"), get_chmod_flags());
|
|
|
|
|
|
+ da->copy(template_path.get_base_dir().path_join("libEGL." + arch + ".dll"), path.get_base_dir().path_join("libEGL.dll"), get_chmod_flags());
|
|
}
|
|
}
|
|
if (da->file_exists(template_path.get_base_dir().path_join("libGLESv2." + arch + ".dll"))) {
|
|
if (da->file_exists(template_path.get_base_dir().path_join("libGLESv2." + arch + ".dll"))) {
|
|
- da->copy(template_path.get_base_dir().path_join("libGLESv2." + arch + ".dll"), p_path.get_base_dir().path_join("libGLESv2.dll"), get_chmod_flags());
|
|
|
|
|
|
+ da->copy(template_path.get_base_dir().path_join("libGLESv2." + arch + ".dll"), path.get_base_dir().path_join("libGLESv2.dll"), get_chmod_flags());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -221,55 +251,25 @@ Error EditorExportPlatformWindows::export_project(const Ref<EditorExportPreset>
|
|
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
|
Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
|
if (da->file_exists(template_path.get_base_dir().path_join("D3D12Core." + arch + ".dll"))) {
|
|
if (da->file_exists(template_path.get_base_dir().path_join("D3D12Core." + arch + ".dll"))) {
|
|
if (agility_sdk_multiarch) {
|
|
if (agility_sdk_multiarch) {
|
|
- da->make_dir_recursive(p_path.get_base_dir().path_join(arch));
|
|
|
|
- da->copy(template_path.get_base_dir().path_join("D3D12Core." + arch + ".dll"), p_path.get_base_dir().path_join(arch).path_join("D3D12Core.dll"), get_chmod_flags());
|
|
|
|
|
|
+ da->make_dir_recursive(path.get_base_dir().path_join(arch));
|
|
|
|
+ da->copy(template_path.get_base_dir().path_join("D3D12Core." + arch + ".dll"), path.get_base_dir().path_join(arch).path_join("D3D12Core.dll"), get_chmod_flags());
|
|
} else {
|
|
} else {
|
|
- da->copy(template_path.get_base_dir().path_join("D3D12Core." + arch + ".dll"), p_path.get_base_dir().path_join("D3D12Core.dll"), get_chmod_flags());
|
|
|
|
|
|
+ da->copy(template_path.get_base_dir().path_join("D3D12Core." + arch + ".dll"), path.get_base_dir().path_join("D3D12Core.dll"), get_chmod_flags());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (da->file_exists(template_path.get_base_dir().path_join("d3d12SDKLayers." + arch + ".dll"))) {
|
|
if (da->file_exists(template_path.get_base_dir().path_join("d3d12SDKLayers." + arch + ".dll"))) {
|
|
if (agility_sdk_multiarch) {
|
|
if (agility_sdk_multiarch) {
|
|
- da->make_dir_recursive(p_path.get_base_dir().path_join(arch));
|
|
|
|
- da->copy(template_path.get_base_dir().path_join("d3d12SDKLayers." + arch + ".dll"), p_path.get_base_dir().path_join(arch).path_join("d3d12SDKLayers.dll"), get_chmod_flags());
|
|
|
|
|
|
+ da->make_dir_recursive(path.get_base_dir().path_join(arch));
|
|
|
|
+ da->copy(template_path.get_base_dir().path_join("d3d12SDKLayers." + arch + ".dll"), path.get_base_dir().path_join(arch).path_join("d3d12SDKLayers.dll"), get_chmod_flags());
|
|
} else {
|
|
} else {
|
|
- da->copy(template_path.get_base_dir().path_join("d3d12SDKLayers." + arch + ".dll"), p_path.get_base_dir().path_join("d3d12SDKLayers.dll"), get_chmod_flags());
|
|
|
|
|
|
+ da->copy(template_path.get_base_dir().path_join("d3d12SDKLayers." + arch + ".dll"), path.get_base_dir().path_join("d3d12SDKLayers.dll"), get_chmod_flags());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (da->file_exists(template_path.get_base_dir().path_join("WinPixEventRuntime." + arch + ".dll"))) {
|
|
if (da->file_exists(template_path.get_base_dir().path_join("WinPixEventRuntime." + arch + ".dll"))) {
|
|
- da->copy(template_path.get_base_dir().path_join("WinPixEventRuntime." + arch + ".dll"), p_path.get_base_dir().path_join("WinPixEventRuntime.dll"), get_chmod_flags());
|
|
|
|
|
|
+ da->copy(template_path.get_base_dir().path_join("WinPixEventRuntime." + arch + ".dll"), path.get_base_dir().path_join("WinPixEventRuntime.dll"), get_chmod_flags());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- bool export_as_zip = p_path.ends_with("zip");
|
|
|
|
- bool embedded = p_preset->get("binary_format/embed_pck");
|
|
|
|
-
|
|
|
|
- String pkg_name;
|
|
|
|
- if (String(ProjectSettings::get_singleton()->get("application/config/name")) != "") {
|
|
|
|
- pkg_name = String(ProjectSettings::get_singleton()->get("application/config/name"));
|
|
|
|
- } else {
|
|
|
|
- pkg_name = "Unnamed";
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- pkg_name = OS::get_singleton()->get_safe_dir_name(pkg_name);
|
|
|
|
-
|
|
|
|
- // Setup temp folder.
|
|
|
|
- String path = p_path;
|
|
|
|
- String tmp_dir_path = EditorPaths::get_singleton()->get_temp_dir().path_join(pkg_name);
|
|
|
|
- Ref<DirAccess> tmp_app_dir = DirAccess::create_for_path(tmp_dir_path);
|
|
|
|
- if (export_as_zip) {
|
|
|
|
- if (tmp_app_dir.is_null()) {
|
|
|
|
- add_message(EXPORT_MESSAGE_ERROR, TTR("Prepare Templates"), vformat(TTR("Could not create and open the directory: \"%s\""), tmp_dir_path));
|
|
|
|
- return ERR_CANT_CREATE;
|
|
|
|
- }
|
|
|
|
- if (DirAccess::exists(tmp_dir_path)) {
|
|
|
|
- if (tmp_app_dir->change_dir(tmp_dir_path) == OK) {
|
|
|
|
- tmp_app_dir->erase_contents_recursive();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- tmp_app_dir->make_dir_recursive(tmp_dir_path);
|
|
|
|
- path = tmp_dir_path.path_join(p_path.get_file().get_basename() + ".exe");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
// Export project.
|
|
// Export project.
|
|
String pck_path = path;
|
|
String pck_path = path;
|
|
if (embedded) {
|
|
if (embedded) {
|