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); } }
private void AppendEmulators(List <Emulator> emulators, RegistryKey topLevelKey) { using (RegistryKey key = GetDeviceFrameworkPaths.OpenDeviceFrameworkKey(topLevelKey, m_runtimeVersionInstalled, RegistryKeys.Emulators)) { if (key != null) { string[] subkeyNames = key.GetSubKeyNames(); for (int iSubkey = 0; iSubkey < subkeyNames.Length; iSubkey++) { string subkeyName = subkeyNames[iSubkey]; using (RegistryKey subkey = key.OpenSubKey(subkeyName)) { string path = subkey.GetValue(RegistryValues.EmulatorPath) as string; string name = subkey.GetValue(RegistryValues.EmulatorName) as string; string config = subkey.GetValue(RegistryValues.EmulatorConfig) as string; string options = subkey.GetValue(RegistryValues.EmulatorOptions) as string; int? legacyCommandLine = subkey.GetValue(RegistryValues.EmulatorLegacyCommandLine) as int?; bool fLegacyCommandLine; string persistableName = subkeyName; if (string.IsNullOrEmpty(name)) { name = persistableName; } fLegacyCommandLine = legacyCommandLine != null && legacyCommandLine.Value != 0; Emulator emulator = new Emulator(); emulator.additionalOptions = options; emulator.application = path; emulator.config = config; emulator.legacyCommandLine = fLegacyCommandLine; emulator.name = name; emulator.persistableName = persistableName; emulators.Add(emulator); } } } } }
private void AppendFolders(List <string> folders, RegistryKey topLevelKey) { //Add the AssemblyFoldersEx registry entries //HKCU settings as well? Currently just using HKLM using (RegistryKey key = GetDeviceFrameworkPaths.OpenDeviceFrameworkKey(topLevelKey, m_runtimeVersionInstalled, RegistryKeys.AssemblyFoldersEx)) { if (key != null) { string[] subkeys = key.GetSubKeyNames(); for (int iSubKey = 0; iSubKey < subkeys.Length; iSubKey++) { using (RegistryKey subkey = key.OpenSubKey(subkeys[iSubKey])) { AppendFolder(folders, (string)subkey.GetValue(RegistryValues.Default)); } } } } }