diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index ca49d8d0731..0bc37420459 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -191,7 +191,7 @@ function _load_vcvarsall(vcvarsall, vsver, arch, opt) -- then parse it from `WindowsSdkBinPath`, such as: `C:\\Program Files (x86)\\Windows Kits\\8.1\\bin` local WindowsSdkBinPath = variables["WindowsSdkBinPath"] if WindowsSdkBinPath then - WindowsSDKVersion = string.match(WindowsSdkBinPath, "\\(%d+%.?%d*)\\bin") + WindowsSDKVersion = string.match(WindowsSdkBinPath, "\\(%d+%.%d+)\\bin$") if WindowsSDKVersion then variables["WindowsSDKVersion"] = WindowsSDKVersion end