Open RPG3D opened 5 years ago
The easiest way would probably to use a base path from some registry value and then search relative to that location. May not work for all situations but it's what UnrealEngine does internally as well. I'd recommend just taking a look at UnrealBuildTool/Platform/Windows/VCEnvironment.cs
in UnrealEngine for reference.
I do the same thing here: https://gist.github.com/RiceKab/60d7dd434afaab295d1c21d2fe1981b0#file-vcenvironmentfastbuildextensions-cs
Ugly has hell but works fine :)
string RedistFilePath = string.Format("{0}/VC/Auxiliary/Build/Microsoft.VCRedistVersion.default.txt", VCInstallDir);
string RedistVersionNumber = System.IO.File.ReadAllText(RedistFilePath).TrimEnd('\r', '\n');
I want to avoid using a fixed version string in code such as :
AddText(string.Format("\t\t'{0}/Redist/MSVC/14.16.27012/x64/Microsoft.VC141.CRT/msvcp{1}.dll'\n", @"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC", platformVersionNumber));
the redist version is diffirent from ToolChainVersion.