summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-06-29 10:08:55 +0200
committerGitHub <noreply@github.com>2021-06-29 10:08:55 +0200
commit45b66e91e73eff0f556ef36264d36f49b0089a89 (patch)
tree6e631103c46b01f2fde9f522a15a14017f067542
parenteb318d3e04ac6d3bb01b0f2a8311d06ba55c3a2b (diff)
parent8f7c2ccefd2be100af3cfe71b4524393df7f24c1 (diff)
Merge pull request #49985 from bruvzg/win_sign_temp_file
[Windows Export] Use temporary file for osslsigncode signing.
-rw-r--r--platform/windows/export/export.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp
index 03093ab6dd..10f953f2ec 100644
--- a/platform/windows/export/export.cpp
+++ b/platform/windows/export/export.cpp
@@ -310,7 +310,7 @@ Error EditorExportPlatformWindows::_code_sign(const Ref<EditorExportPreset> &p_p
args.push_back(p_path);
#ifndef WINDOWS_ENABLED
args.push_back("-out");
- args.push_back(p_path);
+ args.push_back(p_path + "_signed");
#endif
String str;
@@ -326,6 +326,16 @@ Error EditorExportPlatformWindows::_code_sign(const Ref<EditorExportPreset> &p_p
return FAILED;
}
+#ifndef WINDOWS_ENABLED
+ DirAccessRef tmp_dir = DirAccess::create_for_path(p_path.get_base_dir());
+
+ err = tmp_dir->remove(p_path);
+ ERR_FAIL_COND_V(err != OK, err);
+
+ err = tmp_dir->rename(p_path + "_signed", p_path);
+ ERR_FAIL_COND_V(err != OK, err);
+#endif
+
return OK;
}