Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there a way to detect VC redist version? #32

Open
RPG3D opened this issue Dec 26, 2018 · 2 comments
Open

is there a way to detect VC redist version? #32

RPG3D opened this issue Dec 26, 2018 · 2 comments

Comments

@RPG3D
Copy link

RPG3D commented Dec 26, 2018

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.

@ricekab
Copy link

ricekab commented Jan 2, 2019

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

@msolemajor
Copy link

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');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants