diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-02-15 19:04:45 +0100 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-02-15 19:52:32 +0100 |
commit | a8dfe9ff7f1a7e19e57fe574bb0a683350e57b44 (patch) | |
tree | bc98fc88c944b4ace160be66e5119195f441b76e | |
parent | d17ba9a1409464e9de5b84acb7e67f0b21d82a39 (diff) |
Don't print 'Cannot find Mono in the registry' if bundled with Godot
Closes #24753
-rw-r--r-- | modules/mono/mono_gd/gd_mono.cpp | 12 | ||||
-rw-r--r-- | modules/mono/utils/mono_reg_utils.cpp | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index 00850b4d94..bba8b1050f 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -241,11 +241,21 @@ void GDMono::initialize() { assembly_rootdir = bundled_assembly_rootdir; config_dir = bundled_config_dir; } + +#ifdef WINDOWS_ENABLED + if (assembly_rootdir.empty() || config_dir.empty()) { + // Assertion: if they are not set, then they weren't found in the registry + CRASH_COND(mono_reg_info.assembly_dir.length() > 0 || mono_reg_info.config_dir.length() > 0); + + ERR_PRINT("Cannot find Mono in the registry"); + } +#endif // WINDOWS_ENABLED + #else // These are always the directories in export templates assembly_rootdir = bundled_assembly_rootdir; config_dir = bundled_config_dir; -#endif +#endif // TOOLS_ENABLED // Leak if we call mono_set_dirs more than once mono_set_dirs(assembly_rootdir.length() ? assembly_rootdir.utf8().get_data() : NULL, diff --git a/modules/mono/utils/mono_reg_utils.cpp b/modules/mono/utils/mono_reg_utils.cpp index 76b250e038..0eb4b3b8b3 100644 --- a/modules/mono/utils/mono_reg_utils.cpp +++ b/modules/mono/utils/mono_reg_utils.cpp @@ -158,8 +158,6 @@ MonoRegInfo find_mono() { if (_find_mono_in_reg_old("Software\\Novell\\Mono", info) == ERROR_SUCCESS) return info; - ERR_PRINT("Cannot find mono in the registry"); - return MonoRegInfo(); } |