From adb9815199b3416fc841b453e2a53dde622300fa Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Wed, 20 Mar 2019 17:55:09 +0100 Subject: [PATCH] Add support for new MSBuild directory naming introduced in VS 2019. (cherry picked from commit 7440295ad1cd94b4066733cc20680429ca690f2d) --- modules/mono/utils/mono_reg_utils.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/mono/utils/mono_reg_utils.cpp b/modules/mono/utils/mono_reg_utils.cpp index 14401f02ef0..fe4f73e0275 100644 --- a/modules/mono/utils/mono_reg_utils.cpp +++ b/modules/mono/utils/mono_reg_utils.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "mono_reg_utils.h" +#include "core/os/dir_access.h" #ifdef WINDOWS_ENABLED @@ -202,6 +203,13 @@ String find_msbuild_tools_path() { val += "\\"; } + // Since VS2019, the directory is simply named "Current" + String msBuildDirectory = val + "MSBuild\\Current\\Bin"; + if (DirAccess::exists(msBuildDirectory)) { + return msBuildDirectory; + } + + // Directory name "15.0" is used in VS 2017 return val + "MSBuild\\15.0\\Bin"; } }