Merge pull request #49985 from bruvzg/win_sign_temp_file

[Windows Export] Use temporary file for osslsigncode signing.
This commit is contained in:
Rémi Verschelde 2021-06-29 10:08:55 +02:00 committed by GitHub
commit 45b66e91e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}