public KitsRootPaths() { string kitsRegistryKeyString = string.Format(@"SOFTWARE{0}\Microsoft\Windows Kits\Installed Roots", Environment.Is64BitProcess ? @"\Wow6432Node" : string.Empty); s_defaultKitsRoots[KitsRootEnum.KitsRoot] = Util.GetRegistryLocalMachineSubKeyValue(kitsRegistryKeyString, KitsRootEnum.KitsRoot.ToString(), @"C:\Program Files (x86)\Windows Kits\8.0\", enableLog: false); s_defaultKitsRoots[KitsRootEnum.KitsRoot81] = Util.GetRegistryLocalMachineSubKeyValue(kitsRegistryKeyString, KitsRootEnum.KitsRoot81.ToString(), @"C:\Program Files (x86)\Windows Kits\8.1\", enableLog: false); s_defaultKitsRoots[KitsRootEnum.KitsRoot10] = Util.GetRegistryLocalMachineSubKeyValue(kitsRegistryKeyString, KitsRootEnum.KitsRoot10.ToString(), @"C:\Program Files (x86)\Windows Kits\10\", enableLog: false); s_defaultKitsRootForDevEnv[DevEnv.vs2015] = Tuple.Create <KitsRootEnum, Options.Vc.General.WindowsTargetPlatformVersion?>(KitsRootEnum.KitsRoot81, Options.Vc.General.WindowsTargetPlatformVersion.v8_1); s_defaultKitsRootForDevEnv[DevEnv.vs2017] = Tuple.Create <KitsRootEnum, Options.Vc.General.WindowsTargetPlatformVersion?>(KitsRootEnum.KitsRoot10, Options.Vc.General.WindowsTargetPlatformVersion.v10_0_10586_0); s_defaultKitsRootForDevEnv[DevEnv.vs2019] = Tuple.Create <KitsRootEnum, Options.Vc.General.WindowsTargetPlatformVersion?>(KitsRootEnum.KitsRoot10, Options.Vc.General.WindowsTargetPlatformVersion.v10_0_16299_0); }
public static string GetVisualStudioDir(this DevEnv visualVersion) { string registryKeyString = string.Format( @"SOFTWARE{0}\Microsoft\VisualStudio\SxS\VS7", Environment.Is64BitProcess ? @"\Wow6432Node" : string.Empty); string fallback = visualVersion == DevEnv.vs2017 ? @"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional" : @"C:\Program Files (x86)\Microsoft Visual Studio " + visualVersion.GetVisualVersionString(); string installDir = Util.GetRegistryLocalMachineSubKeyValue(registryKeyString, visualVersion.GetVisualVersionString(), fallback); return(Util.SimplifyPath(installDir)); }
public static string GetNETFXToolsDir(DotNetFramework dotNetFramework) { string netFxToolsDir; if (s_netFxKitsDir.TryGetValue(dotNetFramework, out netFxToolsDir)) { return(netFxToolsDir); } var microsoftSdksRegistryKeyString = string.Format(@"SOFTWARE{0}\Microsoft\Microsoft SDKs", Environment.Is64BitProcess ? @"\Wow6432Node" : string.Empty); if (dotNetFramework >= DotNetFramework.v4_6) { netFxToolsDir = Util.GetRegistryLocalMachineSubKeyValue( $@"{microsoftSdksRegistryKeyString}\NETFXSDK\{dotNetFramework.ToVersionString()}\WinSDK-NetFx40Tools-x86", "InstallationFolder", $@"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX {dotNetFramework.ToVersionString()} Tools\"); } else if (dotNetFramework >= DotNetFramework.v4_5_1) // Note: .Net 4.5.2 lacks a NETFX tools release, so we use the previous version { netFxToolsDir = Util.GetRegistryLocalMachineSubKeyValue( $@"{microsoftSdksRegistryKeyString}\Windows\v8.1A\WinSDK-NetFx40Tools-x86", "InstallationFolder", $@"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\"); } else if (dotNetFramework >= DotNetFramework.v4_0) { netFxToolsDir = Util.GetRegistryLocalMachineSubKeyValue( $@"{microsoftSdksRegistryKeyString}\Windows\v8.0A\WinSDK-NetFx40Tools-x86", "InstallationFolder", $@"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\"); } else if (dotNetFramework >= DotNetFramework.v3_5) { netFxToolsDir = Util.GetRegistryLocalMachineSubKeyValue( $@"{microsoftSdksRegistryKeyString}\Windows\v8.0A\WinSDK-NetFx35Tools-x86", "InstallationFolder", $@"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\"); } else { throw new NotImplementedException("No NETFXToolsDir associated with " + dotNetFramework); } s_netFxToolsDir.TryAdd(dotNetFramework, netFxToolsDir); return(netFxToolsDir); }
public KitsRootPaths() { string kitsRegistryKeyString = string.Format(@"SOFTWARE{0}\Microsoft\Windows Kits\Installed Roots", Environment.Is64BitProcess ? @"\Wow6432Node" : string.Empty); s_defaultKitsRoots[KitsRootEnum.KitsRoot] = Util.GetRegistryLocalMachineSubKeyValue(kitsRegistryKeyString, KitsRootEnum.KitsRoot.ToString(), @"C:\Program Files (x86)\Windows Kits\8.0\"); s_defaultKitsRoots[KitsRootEnum.KitsRoot81] = Util.GetRegistryLocalMachineSubKeyValue(kitsRegistryKeyString, KitsRootEnum.KitsRoot81.ToString(), @"C:\Program Files (x86)\Windows Kits\8.1\"); s_defaultKitsRoots[KitsRootEnum.KitsRoot10] = Util.GetRegistryLocalMachineSubKeyValue(kitsRegistryKeyString, KitsRootEnum.KitsRoot10.ToString(), @"C:\Program Files (x86)\Windows Kits\10\"); string netFXSdkRegistryKeyString = string.Format(@"SOFTWARE{0}\Microsoft\Microsoft SDKs\NETFXSDK", Environment.Is64BitProcess ? @"\Wow6432Node" : string.Empty); s_netFxKitsDir[DotNetFramework.v4_6] = Util.GetRegistryLocalMachineSubKeyValue(netFXSdkRegistryKeyString + @"\" + DotNetFramework.v4_6.ToVersionString(), "KitsInstallationFolder", @"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\"); s_netFxKitsDir[DotNetFramework.v4_6_1] = Util.GetRegistryLocalMachineSubKeyValue(netFXSdkRegistryKeyString + @"\" + DotNetFramework.v4_6_1.ToVersionString(), "KitsInstallationFolder", @"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\"); s_defaultKitsRootForDevEnv[DevEnv.vs2012] = KitsRootEnum.KitsRoot; s_defaultKitsRootForDevEnv[DevEnv.vs2013] = KitsRootEnum.KitsRoot81; s_defaultKitsRootForDevEnv[DevEnv.vs2015] = KitsRootEnum.KitsRoot81; s_defaultKitsRootForDevEnv[DevEnv.vs2017] = KitsRootEnum.KitsRoot10; }
public static string GetNETFXKitsDir(DotNetFramework dotNetFramework) { string netFxKitsDir; if (s_netFxKitsDir.TryGetValue(dotNetFramework, out netFxKitsDir)) return netFxKitsDir; if (dotNetFramework >= DotNetFramework.v4_6) { var netFXSdkRegistryKeyString = string.Format(@"SOFTWARE{0}\Microsoft\Microsoft SDKs\NETFXSDK", Environment.Is64BitProcess ? @"\Wow6432Node" : string.Empty); netFxKitsDir = Util.GetRegistryLocalMachineSubKeyValue(netFXSdkRegistryKeyString + @"\" + dotNetFramework.ToVersionString(), "KitsInstallationFolder", $@"C:\Program Files (x86)\Windows Kits\NETFXSDK\{dotNetFramework.ToVersionString()}\"); s_netFxKitsDir.TryAdd(dotNetFramework, netFxKitsDir); return netFxKitsDir; } throw new NotImplementedException("No NETFXKitsDir associated with " + dotNetFramework); }
public static string GetVisualStudioDir(this DevEnv visualVersion) { // First check if the visual studio path is overriden from default value. string pathOverride; if (s_visualStudioDirOverrides.TryGetValue(visualVersion, out pathOverride)) { return(pathOverride); } string registryKeyString = string.Format( @"SOFTWARE{0}\Microsoft\VisualStudio\SxS\VS7", Environment.Is64BitProcess ? @"\Wow6432Node" : string.Empty); string fallback = visualVersion == DevEnv.vs2017 ? @"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional" : @"C:\Program Files (x86)\Microsoft Visual Studio " + visualVersion.GetVisualVersionString(); string installDir = Util.GetRegistryLocalMachineSubKeyValue(registryKeyString, visualVersion.GetVisualVersionString(), fallback); return(Util.SimplifyPath(installDir)); }
public KitsRootPaths() { string kitsRegistryKeyString = string.Format(@"SOFTWARE{0}\Microsoft\Windows Kits\Installed Roots", Environment.Is64BitProcess ? @"\Wow6432Node" : string.Empty); s_defaultKitsRoots[KitsRootEnum.KitsRoot] = Util.GetRegistryLocalMachineSubKeyValue(kitsRegistryKeyString, KitsRootEnum.KitsRoot.ToString(), @"C:\Program Files (x86)\Windows Kits\8.0\"); s_defaultKitsRoots[KitsRootEnum.KitsRoot81] = Util.GetRegistryLocalMachineSubKeyValue(kitsRegistryKeyString, KitsRootEnum.KitsRoot81.ToString(), @"C:\Program Files (x86)\Windows Kits\8.1\"); s_defaultKitsRoots[KitsRootEnum.KitsRoot10] = Util.GetRegistryLocalMachineSubKeyValue(kitsRegistryKeyString, KitsRootEnum.KitsRoot10.ToString(), @"C:\Program Files (x86)\Windows Kits\10\"); var netFXSdkRegistryKeyString = string.Format(@"SOFTWARE{0}\Microsoft\Microsoft SDKs\NETFXSDK", Environment.Is64BitProcess ? @"\Wow6432Node" : string.Empty); foreach (var dotNet in Enum.GetValues(typeof(DotNetFramework)).Cast <DotNetFramework>().Where(d => d >= DotNetFramework.v4_6)) { s_netFxKitsDir[dotNet] = Util.GetRegistryLocalMachineSubKeyValue(netFXSdkRegistryKeyString + @"\" + dotNet.ToVersionString(), "KitsInstallationFolder", $@"C:\Program Files (x86)\Windows Kits\NETFXSDK\{dotNet.ToVersionString()}\"); } s_defaultKitsRootForDevEnv[DevEnv.vs2012] = Tuple.Create <KitsRootEnum, Options.Vc.General.WindowsTargetPlatformVersion?>(KitsRootEnum.KitsRoot, null); s_defaultKitsRootForDevEnv[DevEnv.vs2013] = Tuple.Create <KitsRootEnum, Options.Vc.General.WindowsTargetPlatformVersion?>(KitsRootEnum.KitsRoot81, Options.Vc.General.WindowsTargetPlatformVersion.v8_1); s_defaultKitsRootForDevEnv[DevEnv.vs2015] = Tuple.Create <KitsRootEnum, Options.Vc.General.WindowsTargetPlatformVersion?>(KitsRootEnum.KitsRoot81, Options.Vc.General.WindowsTargetPlatformVersion.v8_1); s_defaultKitsRootForDevEnv[DevEnv.vs2017] = Tuple.Create <KitsRootEnum, Options.Vc.General.WindowsTargetPlatformVersion?>(KitsRootEnum.KitsRoot10, Options.Vc.General.WindowsTargetPlatformVersion.v10_0_10586_0); }