You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
C#/netcore: Add base desktop game export implementation
This base implementation is still very barebones but it defines the path for how exporting will work (at least when embedding the .NET runtime). Many manual steps are still needed, which should be automatized in the future. For example, in addition to the API assemblies, now you also need to copy the GodotPlugins assembly to each game project.
This commit is contained in:
@@ -51,6 +51,37 @@
|
||||
|
||||
namespace path {
|
||||
|
||||
String find_executable(const String &p_name) {
|
||||
#ifdef WINDOWS_ENABLED
|
||||
Vector<String> exts = OS::get_singleton()->get_environment("PATHEXT").split(ENV_PATH_SEP, false);
|
||||
#endif
|
||||
Vector<String> env_path = OS::get_singleton()->get_environment("PATH").split(ENV_PATH_SEP, false);
|
||||
|
||||
if (env_path.is_empty()) {
|
||||
return String();
|
||||
}
|
||||
|
||||
for (int i = 0; i < env_path.size(); i++) {
|
||||
String p = path::join(env_path[i], p_name);
|
||||
|
||||
#ifdef WINDOWS_ENABLED
|
||||
for (int j = 0; j < exts.size(); j++) {
|
||||
String p2 = p + exts[j].to_lower(); // lowercase to reduce risk of case mismatch warning
|
||||
|
||||
if (FileAccess::exists(p2)) {
|
||||
return p2;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (FileAccess::exists(p)) {
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return String();
|
||||
}
|
||||
|
||||
String cwd() {
|
||||
#ifdef WINDOWS_ENABLED
|
||||
const DWORD expected_size = ::GetCurrentDirectoryW(0, nullptr);
|
||||
|
||||
Reference in New Issue
Block a user