Skip to content

Commit

Permalink
Merge pull request #49985 from bruvzg/win_sign_temp_file
Browse files Browse the repository at this point in the history
[Windows Export] Use temporary file for osslsigncode signing.
  • Loading branch information
akien-mga authored Jun 29, 2021
2 parents eb318d3 + 8f7c2cc commit 45b66e9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion platform/windows/export/export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit 45b66e9

Please sign in to comment.