From 8f7c2ccefd2be100af3cfe71b4524393df7f24c1 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 29 Jun 2021 10:38:28 +0300 Subject: [PATCH] [Windows Export] Use temporary file for osslsigncode signing. --- platform/windows/export/export.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index 03093ab6ddf..10f953f2ecd 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -310,7 +310,7 @@ Error EditorExportPlatformWindows::_code_sign(const Ref &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 &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; }