public static void InitLogAtPath(string logFilePath, string _, bool doLogRotation) { Logger.s_loggerInited = true; Logger.s_HdLoggerCallback = new Logger.HdLoggerCallback(Logger.HdLogger); Logger.s_processId = Process.GetCurrentProcess().Id; Logger.s_processName = Process.GetCurrentProcess().ProcessName; string directoryName = Path.GetDirectoryName(logFilePath); if (!Directory.Exists(directoryName)) { Directory.CreateDirectory(directoryName); } Logger.s_logFilePath = logFilePath; Logger.LogLevelsInit(); Logger.Open(); if (!doLogRotation) { return; } Thread thread = new Thread((ThreadStart)(() => Logger.DoLogRotation())); if (((int)RegistryUtils.GetRegistryValue(Path.Combine(Strings.RegistryBaseKeyPath, "Client"), "RotateLog", (object)1, RegistryKeyKind.HKEY_LOCAL_MACHINE) == 0 ? 0 : 1) == 0) { return; } thread.IsBackground = true; thread.Start(); }
private static void LogLevelsInit() { Logger.s_logLevels = (string)RegistryUtils.GetRegistryValue(Strings.RegistryBaseKeyPath, "DebugLogs", (object)null, RegistryKeyKind.HKEY_CURRENT_USER); if (!string.IsNullOrEmpty(Logger.s_logLevels)) { return; } Logger.s_logLevels = (string)RegistryUtils.GetRegistryValue(Strings.RegistryBaseKeyPath, "DebugLogs", (object)null, RegistryKeyKind.HKEY_LOCAL_MACHINE); if (string.IsNullOrEmpty(Logger.s_logLevels)) { return; } Logger.s_logLevels = Logger.s_logLevels.ToUpper(CultureInfo.InvariantCulture); }
public static string GetIdFromRegistryOrFile(string id) { string str1 = (string)RegistryUtils.GetRegistryValue("Software\\BlueStacksInstaller", id, (object)"", RegistryKeyKind.HKEY_LOCAL_MACHINE); if (!string.IsNullOrEmpty(str1)) { return(str1); } try { string str2 = Path.Combine(new DirectoryInfo(ShortcutHelper.CommonDesktopPath).Parent.FullName, "BlueStacks"); if (!Directory.Exists(str2)) { Directory.CreateDirectory(str2); } string path = Path.Combine(str2, id); if (File.Exists(path)) { string str3 = File.ReadAllText(path); if (!string.IsNullOrEmpty(str3)) { str1 = str3; } } } catch { } if (!string.IsNullOrEmpty(str1)) { return(str1); } RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\BlueStacksInstaller"); if (registryKey != null) { str1 = (string)registryKey.GetValue(id, (object)""); } return(str1); }
private static bool IsOSWin10() { return(((string)RegistryUtils.GetRegistryValue("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "ProductName", (object)"", RegistryKeyKind.HKEY_LOCAL_MACHINE)).Contains("Windows 10")); }