File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -108,11 +108,22 @@ for %%v in ( %* ) do (
108
108
:: suggest them.
109
109
:: This has been tested on VS 2017, 2019 and 2022
110
110
:: Note that VCToolsVersion is only defined after vcvarsall.bat been run.
111
+
111
112
@ if defined VCToolsVersion (
112
113
set MSVC_RUNTIME_MAJOR_VERSION = %VCToolsVersion:~0 ,2 %
114
+ set MSVC_RUNTIME_FILE_VERSION = %MSVC_RUNTIME_MAJOR_VERSION% 0
115
+ rem NOTE 1 Since the upgrade to VS 17.10.5 this attempt to set the runtime minor
116
+ rem version is broken as it now returns '4'. Note also that vcvars.bat has v143
117
+ rem hard-coded. It does not seem to be possible to dynamically derived the minor
118
+ rem version using the available env vars so we test to see if the runtime dir
119
+ rem exists and if not we fall back to 3.
120
+ rem NOTE 2 This code is likely to break again in the future !!!!
113
121
set MSVC_RUNTIME_MINOR_VERSION = %VCToolsVersion:~3 ,1 %
122
+ if not exist %VCToolsRedistDir%%VSCMD_ARG_TGT_ARCH% \Microsoft.VC%MSVC_RUNTIME_MAJOR_VERSION%%MSVC_RUNTIME_MINOR_VERSION% .CRT (
123
+ set MSVC_RUNTIME_MINOR_VERSION = 3
124
+ )
114
125
set MSVC_RUNTIME_LIBRARY_VERSION = %MSVC_RUNTIME_MAJOR_VERSION%%MSVC_RUNTIME_MINOR_VERSION%
115
- set MSVC_RUNTIME_FILE_VERSION = %MSVC_RUNTIME_MAJOR_VERSION% 0
126
+
116
127
)
117
128
@ echo .
118
129
You can’t perform that action at this time.
0 commit comments