Merge pull request #96777 from bruvzg/and_exp_win

[Windows] Only use long executable path when necessary, fix broken apksigner detection.
This commit is contained in:
Rémi Verschelde 2024-09-10 09:51:34 +02:00
commit 444683bd09
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 6 additions and 1 deletions

View File

@ -2276,6 +2276,11 @@ String EditorExportPlatformAndroid::get_apksigner_path(int p_target_sdk, bool p_
bool failed = false;
String version_to_use;
String java_sdk_path = EDITOR_GET("export/android/java_sdk_path");
if (!java_sdk_path.is_empty()) {
OS::get_singleton()->set_environment("JAVA_HOME", java_sdk_path);
}
List<String> args;
args.push_back("--version");
String output;

View File

@ -101,7 +101,7 @@ static String fix_path(const String &p_path) {
}
path = path.simplify_path();
path = path.replace("/", "\\");
if (!path.is_network_share_path() && !path.begins_with(R"(\\?\)")) {
if (path.size() >= MAX_PATH && !path.is_network_share_path() && !path.begins_with(R"(\\?\)")) {
path = R"(\\?\)" + path;
}
return path;