static ProgramFinder() { AddCommonSearchLocations("%path%"); AddCommonSearchLocations(Environment.CurrentDirectory); ProgramFiles = new ProgramFinder("", @"%ProgramFiles(x86)%;%ProgramFiles%;%ProgramW6432%"); ProgramFilesAndSys32 = new ProgramFinder("",@"%ProgramFiles(x86)%;%ProgramFiles%;%ProgramW6432%;%SystemRoot%\system32"); ProgramFilesAndDotNet = new ProgramFinder("", @"%ProgramFiles(x86)%;%ProgramFiles%;%ProgramW6432%;%SystemRoot%\Microsoft.NET"); ProgramFilesSys32AndDotNet = new ProgramFinder("", @"%ProgramFiles(x86)%;%ProgramFiles%;%ProgramW6432%;%SystemRoot%\system32;%SystemRoot%\Microsoft.NET"); }
static ProgramFinder() { AddCommonSearchLocations("%path%"); AddCommonSearchLocations(Environment.CurrentDirectory); AddCommonSearchLocations(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)); ProgramFiles = new ProgramFinder("", @"%ProgramFiles(x86)%;%ProgramFiles%;%ProgramW6432%"); ProgramFilesAndSys32 = new ProgramFinder("", @"%ProgramFiles(x86)%;%ProgramFiles%;%ProgramW6432%;%SystemRoot%\system32"); ProgramFilesAndDotNet = new ProgramFinder("", @"%ProgramFiles(x86)%;%ProgramFiles%;%ProgramW6432%;%SystemRoot%\Microsoft.NET"); ProgramFilesSys32AndDotNet = new ProgramFinder("", @"%ProgramFiles(x86)%;%ProgramFiles%;%ProgramW6432%;%SystemRoot%\system32;%SystemRoot%\Microsoft.NET"); var sdkFolder = RegistryView.System[@"SOFTWARE\Microsoft\Microsoft SDKs\Windows", "CurrentInstallFolder"].Value as string; var wdkFolder = RegistryView.System[@"SOFTWARE\Wow6432Node\Microsoft\WDKDocumentation\7600.091201\Setup", "Build"].Value as string; if (string.IsNullOrEmpty(wdkFolder)) { wdkFolder = RegistryView.System[@"SOFTWARE\Microsoft\WDKDocumentation\7600.091201\Setup", "Build"].Value as string; } ProgramFilesAndDotNetAndSdk = string.IsNullOrEmpty(sdkFolder) ? ProgramFilesAndDotNet : new ProgramFinder("", @"%ProgramFiles(x86)%;%ProgramFiles%;%ProgramW6432%;%SystemRoot%\Microsoft.NET;" + sdkFolder + ";" + wdkFolder); }
private void Load(string[] args) { var options = args.Switches(); var parameters = args.Parameters(); foreach (var arg in args) { var argumentParameters = options[arg]; if (arg.StartsWith("exe-")) { var appname = arg.Substring(4); var t = AddEXE(GetItemName(appname), GetItemVersion(appname)); t.Ignore = false; foreach (var item in argumentParameters) { t.Dependencies.Add(AddDLL(GetItemName(item), GetItemVersion(item))); } break; } else if (arg.StartsWith("dll-")) { var dllname = arg.Substring(4); var t = AddDLL(GetItemName(dllname), GetItemVersion(dllname)); t.Ignore = false; foreach (var item in argumentParameters) { if (!String.IsNullOrEmpty(item)) t.Dependencies.Add(AddDLL(GetItemName(item), GetItemVersion(item))); } break; } else if (arg.StartsWith("policy-")) { var dllname = arg.Substring(7); var t = AddDLL(GetItemName(dllname), GetItemVersion(dllname)); foreach (var policyText in argumentParameters) { var policy = policyText.Split('-'); t.Policies.Add(new Tuple<string, string>(policy[0], policy.Length == 2 ? policy[1] : policy[0])); } break; } } cl_x86 = new ProcessUtility(ProgramFinder.ProgramFilesAndDotNet.ScanForFile("cl.exe", ExecutableInfo.x86, new[] { @"*\x86_amd64\*", @"*\x86_ia64\*" })); cl_x64 = new ProcessUtility(ProgramFinder.ProgramFilesAndDotNet.ScanForFile("cl.exe", ExecutableInfo.x64)); //This only works if var cscpf = new ProgramFinder("C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319"); csc_msil = new ProcessUtility(cscpf.ScanForFile("csc.exe")); al_msil = new ProcessUtility(ProgramFinder.ProgramFilesAndDotNet.ScanForFile("al.exe")); lib_x86 = new ProcessUtility(ProgramFinder.ProgramFilesAndDotNet.ScanForFile("lib.exe", ExecutableInfo.x86, new[] { @"*\x86_amd64\*", @"*\x86_ia64\*" })); lib_x64 = new ProcessUtility(ProgramFinder.ProgramFilesAndDotNet.ScanForFile("lib.exe", ExecutableInfo.x64)); pktExtract = new ProcessUtility(ProgramFinder.ProgramFilesAndDotNet.ScanForFile("pktExtract.exe")); }