public override bool Execute() { RegistryKey emulatorsKey = GetDeviceFrameworkPaths.OpenDeviceFrameworkKey(Registry.LocalMachine, _frameworkVersion, RegistryKeys.Emulators); if (_currentUser) // make sure the CurrentUser key for the framework exists { System.Diagnostics.Debug.Assert(emulatorsKey.Name.StartsWith(@"HKEY_LOCAL_MACHINE\")); String keyName = emulatorsKey.Name.Remove(0, @"HKEY_LOCAL_MACHINE\".Length); emulatorsKey.Close(); emulatorsKey = Registry.CurrentUser.CreateSubKey(keyName); } RegistryKey emulatorKey = emulatorsKey.CreateSubKey(_subkeyName); emulatorKey.SetValue(RegistryValues.EmulatorName, _name); string config = null; if (!String.IsNullOrEmpty(_config)) { config = System.IO.Path.Combine(Environment.CurrentDirectory, _config); } ConditionalSetValue(emulatorKey, RegistryValues.EmulatorConfig, config); ConditionalSetValue(emulatorKey, RegistryValues.EmulatorPath, System.IO.Path.Combine(Environment.CurrentDirectory, _path)); ConditionalSetValue(emulatorKey, RegistryValues.EmulatorOptions, _additionalCommandLineOptions); emulatorKey.Close(); emulatorsKey.Close(); return(true); }
protected override string GenerateFullPathToTool() { // try Porting Kit path first string spoclient = Environment.GetEnvironmentVariable("SPOCLIENT"); string filenameMDP = ""; if (!string.IsNullOrEmpty(spoclient)) { filenameMDP = Path.Combine(spoclient, "Tools\\Bin\\MetaDataProcessor.exe"); } if (string.IsNullOrEmpty(filenameMDP) || !File.Exists(filenameMDP)) { filenameMDP = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "MetaDataProcessor.exe"); if (!File.Exists(filenameMDP)) { GetDeviceFrameworkPaths getDevice = new GetDeviceFrameworkPaths(); if (getDevice.Execute()) { filenameMDP = Path.Combine(getDevice.ToolsPath, "MetaDataProcessor.exe"); } } } if (!File.Exists(filenameMDP)) { Log.LogError(string.Format("No MetadataProcessor tool found at \"{0}\"", filenameMDP)); } return(filenameMDP); }
protected override string GenerateFullPathToTool() { // try Porting Kit path first string spoclient = Environment.GetEnvironmentVariable("BUILD_TREE_SERVER"); string filenameMDP = ""; if (!string.IsNullOrEmpty(spoclient)) { filenameMDP = Path.Combine(spoclient, "dll\\MetaDataProcessor.exe"); } if (string.IsNullOrEmpty(filenameMDP) || !File.Exists(filenameMDP)) { filenameMDP = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "MetaDataProcessor.exe"); if (!File.Exists(filenameMDP)) { string path = Path.Combine(Environment.GetEnvironmentVariable("ProgramFiles"), @"Reference Assemblies\Microsoft\Framework\.NETMicroFramework"); if (Directory.Exists(path)) { string ver = m_bag.ContainsKey("TargetFrameworkVersion") ? (string)m_bag["TargetFrameworkVersion"] : "v4.2"; filenameMDP = Path.Combine(Path.Combine(path, ver), "MetaDataProcessor.exe"); if (!File.Exists(filenameMDP)) { GetDeviceFrameworkPaths getDevice = new GetDeviceFrameworkPaths(); if (getDevice.Execute()) { filenameMDP = Path.Combine(getDevice.ToolsPath, "MetaDataProcessor.exe"); } } } } } if (!File.Exists(filenameMDP)) { Log.LogError(string.Format("No MetadataProcessor tool found at \"{0}\"", filenameMDP)); } return(filenameMDP); }
protected override string GenerateFullPathToTool() { // try Porting Kit path first string spoclient = Environment.GetEnvironmentVariable("BUILD_TREE_SERVER"); string filenameMDP = ""; if (!string.IsNullOrEmpty(spoclient)) { filenameMDP = Path.Combine(spoclient, "dll\\MetaDataProcessor.exe"); } if (string.IsNullOrEmpty(filenameMDP) || !File.Exists(filenameMDP)) { filenameMDP = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "MetaDataProcessor.exe"); if (!File.Exists(filenameMDP)) { string path = Path.Combine(Environment.GetEnvironmentVariable("ProgramFiles"), @"Reference Assemblies\Microsoft\Framework\.NETMicroFramework"); if(Directory.Exists(path)) { string ver = m_bag.ContainsKey("TargetFrameworkVersion") ? (string)m_bag["TargetFrameworkVersion"] : "v4.2"; filenameMDP = Path.Combine(Path.Combine( path, ver ), "MetaDataProcessor.exe"); if(!File.Exists(filenameMDP)) { GetDeviceFrameworkPaths getDevice = new GetDeviceFrameworkPaths(); if (getDevice.Execute()) { filenameMDP = Path.Combine(getDevice.ToolsPath, "MetaDataProcessor.exe"); } } } } } if (!File.Exists(filenameMDP)) { Log.LogError( string.Format("No MetadataProcessor tool found at \"{0}\"", filenameMDP) ); } return filenameMDP; }
private void EnsureInitialization(string version) { GetDeviceFrameworkPaths deviceFrameworkPaths = new GetDeviceFrameworkPaths(); while (true) { deviceFrameworkPaths.RuntimeVersion = version; if (deviceFrameworkPaths.Execute()) { m_frameworkAssembliesPath = deviceFrameworkPaths.FrameworkAssembliesPath; m_frameworkToolsPath = deviceFrameworkPaths.ToolsPath; m_runtimeVersionInstalled = version; break; } Debug.Assert(version[0] == 'v'); //remove the build number from the version, and try again int iDot = version.LastIndexOf('.'); if (iDot < 0) break; version = version.Substring(0, iDot); } }
protected override string GenerateFullPathToTool() { // try Porting Kit path first string spoclient = Environment.GetEnvironmentVariable("SPOCLIENT"); string filenameMDP = ""; if (!string.IsNullOrEmpty(spoclient)) { filenameMDP = Path.Combine(spoclient, "Tools\\Bin\\MetaDataProcessor.exe"); } if (string.IsNullOrEmpty(filenameMDP) || !File.Exists(filenameMDP)) { filenameMDP = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "MetaDataProcessor.exe"); if (!File.Exists(filenameMDP)) { GetDeviceFrameworkPaths getDevice = new GetDeviceFrameworkPaths(); if (getDevice.Execute()) { filenameMDP = Path.Combine(getDevice.ToolsPath, "MetaDataProcessor.exe"); } } } if (!File.Exists(filenameMDP)) { Log.LogError( string.Format("No MetadataProcessor tool found at \"{0}\"", filenameMDP) ); } return filenameMDP; }