private FilePath GetFromDisc() { // Get the path to program files. var programFilesPath = _environment.Is64BitOperativeSystem() ? _environment.GetSpecialPath(SpecialPath.ProgramFilesX86) : _environment.GetSpecialPath(SpecialPath.ProgramFiles); // Get a list of the files we should check. var files = new List <FilePath>(); if (_environment.Is64BitOperativeSystem()) { // 64-bit specific paths. files.Add(programFilesPath.Combine(@"Windows Kits\8.1\bin\x64").CombineWithFilePath("signtool.exe")); files.Add(programFilesPath.Combine(@"Windows Kits\8.0\bin\x64").CombineWithFilePath("signtool.exe")); files.Add(programFilesPath.Combine(@"Microsoft SDKs\Windows\v7.1A\Bin").CombineWithFilePath("signtool.exe")); } else { // 32-bit specific paths. files.Add(programFilesPath.Combine(@"Windows Kits\8.1\bin\x86").CombineWithFilePath("signtool.exe")); files.Add(programFilesPath.Combine(@"Windows Kits\8.0\bin\x86").CombineWithFilePath("signtool.exe")); files.Add(programFilesPath.Combine(@"Microsoft SDKs\Windows\v7.1A\Bin").CombineWithFilePath("signtool.exe")); } // Return the first path that exist. return(files.FirstOrDefault(file => _fileSystem.Exist(file))); }
private static DirectoryPath GetFrameworkPath(ICakeEnvironment environment, PlatformTarget target, string version) { // Get the Microsoft .NET folder. var windowsFolder = environment.GetSpecialPath(SpecialPath.Windows); var netFolder = windowsFolder.Combine("Microsoft.NET"); if (target == PlatformTarget.MSIL) { // Get the framework folder. var is64Bit = environment.Is64BitOperativeSystem(); var frameWorkFolder = is64Bit ? netFolder.Combine("Framework64") : netFolder.Combine("Framework"); return(frameWorkFolder.Combine(version)); } if (target == PlatformTarget.x86) { return(netFolder.Combine("Framework").Combine(version)); } if (target == PlatformTarget.x64) { return(netFolder.Combine("Framework64").Combine(version)); } throw new NotSupportedException(); }
private static DirectoryPath GetMonoPathWindows() { var programFiles = _environment.Is64BitOperativeSystem() ? Environment.SpecialFolder.ProgramFilesX86 : Environment.SpecialFolder.ProgramFiles; var programFilesPath = new DirectoryPath(Environment.GetFolderPath(programFiles)); var monoPath = programFilesPath.Combine("Mono").Combine("bin"); return(_fileSystem.GetDirectory(monoPath).Exists ? monoPath : null); }
private static DirectoryPath GetVisualStudioPath(ICakeEnvironment environment, PlatformTarget target) { // Get the bin path. var programFilesPath = environment.GetSpecialPath(SpecialPath.ProgramFilesX86); var binPath = programFilesPath.Combine("MSBuild/12.0/Bin"); if (target == PlatformTarget.MSIL) { if (environment.Is64BitOperativeSystem()) { binPath = binPath.Combine("amd64"); } } if (target == PlatformTarget.x64) { binPath = binPath.Combine("amd64"); } return binPath; }
private static DirectoryPath GetVisualStudioPath(ICakeEnvironment environment, MSBuildPlatform buildPlatform, string version) { // Get the bin path. var programFilesPath = environment.GetSpecialPath(SpecialPath.ProgramFilesX86); var binPath = programFilesPath.Combine(string.Concat("MSBuild/", version, "/Bin")); if (buildPlatform == MSBuildPlatform.Automatic) { if (environment.Is64BitOperativeSystem()) { binPath = binPath.Combine("amd64"); } } if (buildPlatform == MSBuildPlatform.x64) { binPath = binPath.Combine("amd64"); } return(binPath); }
private static DirectoryPath GetMonoPathWindows() { DirectoryPath programFiles; if (_environment.Is64BitOperativeSystem()) { programFiles = new DirectoryPath(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)); } else { programFiles = new DirectoryPath(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)); } var monoPath = programFiles.Combine("Mono").Combine("bin"); if (_fileSystem.GetDirectory(monoPath).Exists) { return(monoPath); } return(null); }